]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/pin.c
working connect command, new sleep command
[z180-stamp.git] / avr / pin.c
index 14896b31901ea59c99464b1431dcfaa3cd6b699d..6e88aa576c561f280aecc82a57be5f44070e4502 100644 (file)
--- 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