fix initialization of input pins (polarity of pull-resistor was not set)

This commit is contained in:
Wolfgang Hottgenroth 2016-02-17 15:35:08 +01:00
parent 8d1b633928
commit 85d4af6ac2

View File

@ -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;