summaryrefslogtreecommitdiff
path: root/avr/pin.c
diff options
context:
space:
mode:
authorLeo C2014-10-26 12:43:57 +0100
committerLeo C2014-10-26 12:43:57 +0100
commit8a7deceacd30529e5c32082b2c719eb055841d0d (patch)
tree19b22d5a0363847ad5e29dd2d8c726191b1b5c82 /avr/pin.c
parent889202c46ced1be4fc0db3faf63564722eba2865 (diff)
downloadz180-stamp-8a7deceacd30529e5c32082b2c719eb055841d0d.zip
working connect command, new sleep command
Diffstat (limited to 'avr/pin.c')
-rw-r--r--avr/pin.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/avr/pin.c b/avr/pin.c
index 14896b3..6e88aa5 100644
--- a/avr/pin.c
+++ b/avr/pin.c
@@ -130,14 +130,14 @@ int pin_config(int pin, pinmode_t mode)
switch (mode) {
case INPUT:
pin_timer_off(pinlist[pin].timer);
- ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
+ ATOMIC_BLOCK(ATOMIC_FORCEON) {
p->ddr &= ~bit;
p->pout &= ~bit;
}
break;
case INPUT_PULLUP:
pin_timer_off(pinlist[pin].timer);
- ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
+ ATOMIC_BLOCK(ATOMIC_FORCEON) {
p->ddr &= ~bit;
p->pout |= bit;
}
@@ -145,7 +145,7 @@ int pin_config(int pin, pinmode_t mode)
case OUTPUT:
pin_timer_off(pinlist[pin].timer);
case OUTPUT_TIMER:
- ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
+ ATOMIC_BLOCK(ATOMIC_FORCEON) {
p->ddr |= bit;
}
break;
@@ -162,7 +162,7 @@ void pin_write(int pin, uint8_t val)
port_t *p = pinlist[pin].adr;
uint8_t bit = pinlist[pin].mask;
- ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
+ ATOMIC_BLOCK(ATOMIC_FORCEON) {
if (val)
p->pout |= bit;
else