- explicit disable wdt_disable

- use switch for leaving error mode
- use Uart with message fifo
- fixed portGet, added PwrSwitch_in

git-svn-id: http://moon:8086/svn/projects/HendiControl@33 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2019-03-02 11:17:38 +00:00
parent 0bd94e6859
commit 7f6dfc2928
6 changed files with 115 additions and 116 deletions
+5 -4
View File
@@ -12,8 +12,8 @@ void port_init()
{
DDRB = 0x03;
DDRC = 0x01;
PORTB = PORTB | 0x03;
PORTC = PORTC | 0x01;
PORTB = 0x03;
PORTC = 0x01;
}
@@ -30,6 +30,7 @@ const Port_t portItems[NUM_ITEMS] =
{0x05, 1, 1},
{0x05, 2, 1},
{0x08, 0, 1},
{0x06, 1, 1},
};
void portSet(int portItem, int enable)
@@ -51,6 +52,6 @@ int portGet(int portItem)
{
uint8_t addr = portItems[portItem].port;
uint8_t pin_mask = 1 << portItems[portItem].pin;
int enable = (_SFR_IO8(addr) & pin_mask) != portItems[portItem].pol;
return enable;
int enable = (_SFR_IO8(addr) & pin_mask) != pin_mask;
return enable ^ portItems[portItem].pol;
}