fix initialization of input pins (polarity of pull-resistor was not set)
This commit is contained in:
parent
8d1b633928
commit
85d4af6ac2
@ -77,9 +77,11 @@ class SwitchPort2 : public SwitchPort {
|
||||
public:
|
||||
SwitchPort2(uint16_t bit) : SwitchPort() {
|
||||
m_bit = bit;
|
||||
P2REN |= bit;
|
||||
P2DIR &= ~bit;
|
||||
P2REN |= bit;
|
||||
P2OUT |= bit;
|
||||
P2SEL &= ~bit;
|
||||
P2SEL2 &= ~bit;
|
||||
};
|
||||
virtual bool getSwitchState() {
|
||||
bool a = P2IN & m_bit;
|
||||
@ -96,9 +98,11 @@ class SwitchPort1 : public SwitchPort {
|
||||
public:
|
||||
SwitchPort1(uint16_t bit) : SwitchPort() {
|
||||
m_bit = bit;
|
||||
P1REN |= bit;
|
||||
P1DIR &= ~bit;
|
||||
P1REN |= bit;
|
||||
P1OUT |= bit;
|
||||
P1SEL &= ~bit;
|
||||
P1SEL2 &= ~bit;
|
||||
};
|
||||
virtual bool getSwitchState() {
|
||||
return P1IN & m_bit;
|
||||
|
Loading…
x
Reference in New Issue
Block a user