diff --git a/io-helper.c b/io-helper.c index 98e9165..6609f3f 100644 --- a/io-helper.c +++ b/io-helper.c @@ -1,4 +1,5 @@ #include +#include #include "io-helper.h" volatile uint8_t outStates[nrOfOutputs/8]; @@ -81,2323 +82,2450 @@ void ioHelperIoConf(void) { } #ifdef DDRA - DDRA|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRA|=0 #ifdef BitPA0 - |(1<<0) + |(1<<0) #endif #ifdef BitPA1 - |(1<<1) + |(1<<1) #endif #ifdef BitPA2 - |(1<<2) + |(1<<2) #endif #ifdef BitPA3 - |(1<<3) + |(1<<3) #endif #ifdef BitPA4 - |(1<<4) + |(1<<4) #endif #ifdef BitPA5 - |(1<<5) + |(1<<5) #endif #ifdef BitPA6 - |(1<<6) + |(1<<6) #endif #ifdef BitPA7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRB - DDRB|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRB|=0 #ifdef BitPB0 - |(1<<0) + |(1<<0) #endif #ifdef BitPB1 - |(1<<1) + |(1<<1) #endif #ifdef BitPB2 - |(1<<2) + |(1<<2) #endif #ifdef BitPB3 - |(1<<3) + |(1<<3) #endif #ifdef BitPB4 - |(1<<4) + |(1<<4) #endif #ifdef BitPB5 - |(1<<5) + |(1<<5) #endif #ifdef BitPB6 - |(1<<6) + |(1<<6) #endif #ifdef BitPB7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRC - DDRC|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRC|=0 #ifdef BitPC0 - |(1<<0) + |(1<<0) #endif #ifdef BitPC1 - |(1<<1) + |(1<<1) #endif #ifdef BitPC2 - |(1<<2) + |(1<<2) #endif #ifdef BitPC3 - |(1<<3) + |(1<<3) #endif #ifdef BitPC4 - |(1<<4) + |(1<<4) #endif #ifdef BitPC5 - |(1<<5) + |(1<<5) #endif #ifdef BitPC6 - |(1<<6) + |(1<<6) #endif #ifdef BitPC7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRD - DDRD|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRD|=0 #ifdef BitPD0 - |(1<<0) + |(1<<0) #endif #ifdef BitPD1 - |(1<<1) + |(1<<1) #endif #ifdef BitPD2 - |(1<<2) + |(1<<2) #endif #ifdef BitPD3 - |(1<<3) + |(1<<3) #endif #ifdef BitPD4 - |(1<<4) + |(1<<4) #endif #ifdef BitPD5 - |(1<<5) + |(1<<5) #endif #ifdef BitPD6 - |(1<<6) + |(1<<6) #endif #ifdef BitPD7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRE - DDRE|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRE|=0 #ifdef BitPE0 - |(1<<0) + |(1<<0) #endif #ifdef BitPE1 - |(1<<1) + |(1<<1) #endif #ifdef BitPE2 - |(1<<2) + |(1<<2) #endif #ifdef BitPE3 - |(1<<3) + |(1<<3) #endif #ifdef BitPE4 - |(1<<4) + |(1<<4) #endif #ifdef BitPE5 - |(1<<5) + |(1<<5) #endif #ifdef BitPE6 - |(1<<6) + |(1<<6) #endif #ifdef BitPE7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRF - DDRF|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRF|=0 #ifdef BitPF0 - |(1<<0) + |(1<<0) #endif #ifdef BitPF1 - |(1<<1) + |(1<<1) #endif #ifdef BitPF2 - |(1<<2) + |(1<<2) #endif #ifdef BitPF3 - |(1<<3) + |(1<<3) #endif #ifdef BitPF4 - |(1<<4) + |(1<<4) #endif #ifdef BitPF5 - |(1<<5) + |(1<<5) #endif #ifdef BitPF6 - |(1<<6) + |(1<<6) #endif #ifdef BitPF7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRG - DDRG|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRG|=0 #ifdef BitPG0 - |(1<<0) + |(1<<0) #endif #ifdef BitPG1 - |(1<<1) + |(1<<1) #endif #ifdef BitPG2 - |(1<<2) + |(1<<2) #endif #ifdef BitPG3 - |(1<<3) + |(1<<3) #endif #ifdef BitPG4 - |(1<<4) + |(1<<4) #endif #ifdef BitPG5 - |(1<<5) + |(1<<5) #endif #ifdef BitPG6 - |(1<<6) + |(1<<6) #endif #ifdef BitPG7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRH - DDRH|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRH|=0 #ifdef BitPH0 - |(1<<0) + |(1<<0) #endif #ifdef BitPH1 - |(1<<1) + |(1<<1) #endif #ifdef BitPH2 - |(1<<2) + |(1<<2) #endif #ifdef BitPH3 - |(1<<3) + |(1<<3) #endif #ifdef BitPH4 - |(1<<4) + |(1<<4) #endif #ifdef BitPH5 - |(1<<5) + |(1<<5) #endif #ifdef BitPH6 - |(1<<6) + |(1<<6) #endif #ifdef BitPH7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRI - DDRI|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRI|=0 #ifdef BitPI0 - |(1<<0) + |(1<<0) #endif #ifdef BitPI1 - |(1<<1) + |(1<<1) #endif #ifdef BitPI2 - |(1<<2) + |(1<<2) #endif #ifdef BitPI3 - |(1<<3) + |(1<<3) #endif #ifdef BitPI4 - |(1<<4) + |(1<<4) #endif #ifdef BitPI5 - |(1<<5) + |(1<<5) #endif #ifdef BitPI6 - |(1<<6) + |(1<<6) #endif #ifdef BitPI7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRJ - DDRJ|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRJ|=0 #ifdef BitPJ0 - |(1<<0) + |(1<<0) #endif #ifdef BitPJ1 - |(1<<1) + |(1<<1) #endif #ifdef BitPJ2 - |(1<<2) + |(1<<2) #endif #ifdef BitPJ3 - |(1<<3) + |(1<<3) #endif #ifdef BitPJ4 - |(1<<4) + |(1<<4) #endif #ifdef BitPJ5 - |(1<<5) + |(1<<5) #endif #ifdef BitPJ6 - |(1<<6) + |(1<<6) #endif #ifdef BitPJ7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRK - DDRK|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRK|=0 #ifdef BitPK0 - |(1<<0) + |(1<<0) #endif #ifdef BitPK1 - |(1<<1) + |(1<<1) #endif #ifdef BitPK2 - |(1<<2) + |(1<<2) #endif #ifdef BitPK3 - |(1<<3) + |(1<<3) #endif #ifdef BitPK4 - |(1<<4) + |(1<<4) #endif #ifdef BitPK5 - |(1<<5) + |(1<<5) #endif #ifdef BitPK6 - |(1<<6) + |(1<<6) #endif #ifdef BitPK7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRL - DDRL|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRL|=0 #ifdef BitPL0 - |(1<<0) + |(1<<0) #endif #ifdef BitPL1 - |(1<<1) + |(1<<1) #endif #ifdef BitPL2 - |(1<<2) + |(1<<2) #endif #ifdef BitPL3 - |(1<<3) + |(1<<3) #endif #ifdef BitPL4 - |(1<<4) + |(1<<4) #endif #ifdef BitPL5 - |(1<<5) + |(1<<5) #endif #ifdef BitPL6 - |(1<<6) + |(1<<6) #endif #ifdef BitPL7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRM - DDRM|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRM|=0 #ifdef BitPM0 - |(1<<0) + |(1<<0) #endif #ifdef BitPM1 - |(1<<1) + |(1<<1) #endif #ifdef BitPM2 - |(1<<2) + |(1<<2) #endif #ifdef BitPM3 - |(1<<3) + |(1<<3) #endif #ifdef BitPM4 - |(1<<4) + |(1<<4) #endif #ifdef BitPM5 - |(1<<5) + |(1<<5) #endif #ifdef BitPM6 - |(1<<6) + |(1<<6) #endif #ifdef BitPM7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRN - DDRN|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRN|=0 #ifdef BitPN0 - |(1<<0) + |(1<<0) #endif #ifdef BitPN1 - |(1<<1) + |(1<<1) #endif #ifdef BitPN2 - |(1<<2) + |(1<<2) #endif #ifdef BitPN3 - |(1<<3) + |(1<<3) #endif #ifdef BitPN4 - |(1<<4) + |(1<<4) #endif #ifdef BitPN5 - |(1<<5) + |(1<<5) #endif #ifdef BitPN6 - |(1<<6) + |(1<<6) #endif #ifdef BitPN7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRO - DDRO|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRO|=0 #ifdef BitPO0 - |(1<<0) + |(1<<0) #endif #ifdef BitPO1 - |(1<<1) + |(1<<1) #endif #ifdef BitPO2 - |(1<<2) + |(1<<2) #endif #ifdef BitPO3 - |(1<<3) + |(1<<3) #endif #ifdef BitPO4 - |(1<<4) + |(1<<4) #endif #ifdef BitPO5 - |(1<<5) + |(1<<5) #endif #ifdef BitPO6 - |(1<<6) + |(1<<6) #endif #ifdef BitPO7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRP - DDRP|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRP|=0 #ifdef BitPP0 - |(1<<0) + |(1<<0) #endif #ifdef BitPP1 - |(1<<1) + |(1<<1) #endif #ifdef BitPP2 - |(1<<2) + |(1<<2) #endif #ifdef BitPP3 - |(1<<3) + |(1<<3) #endif #ifdef BitPP4 - |(1<<4) + |(1<<4) #endif #ifdef BitPP5 - |(1<<5) + |(1<<5) #endif #ifdef BitPP6 - |(1<<6) + |(1<<6) #endif #ifdef BitPP7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRQ - DDRQ|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRQ|=0 #ifdef BitPQ0 - |(1<<0) + |(1<<0) #endif #ifdef BitPQ1 - |(1<<1) + |(1<<1) #endif #ifdef BitPQ2 - |(1<<2) + |(1<<2) #endif #ifdef BitPQ3 - |(1<<3) + |(1<<3) #endif #ifdef BitPQ4 - |(1<<4) + |(1<<4) #endif #ifdef BitPQ5 - |(1<<5) + |(1<<5) #endif #ifdef BitPQ6 - |(1<<6) + |(1<<6) #endif #ifdef BitPQ7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRR - DDRR|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRR|=0 #ifdef BitPR0 - |(1<<0) + |(1<<0) #endif #ifdef BitPR1 - |(1<<1) + |(1<<1) #endif #ifdef BitPR2 - |(1<<2) + |(1<<2) #endif #ifdef BitPR3 - |(1<<3) + |(1<<3) #endif #ifdef BitPR4 - |(1<<4) + |(1<<4) #endif #ifdef BitPR5 - |(1<<5) + |(1<<5) #endif #ifdef BitPR6 - |(1<<6) + |(1<<6) #endif #ifdef BitPR7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRS - DDRS|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRS|=0 #ifdef BitPS0 - |(1<<0) + |(1<<0) #endif #ifdef BitPS1 - |(1<<1) + |(1<<1) #endif #ifdef BitPS2 - |(1<<2) + |(1<<2) #endif #ifdef BitPS3 - |(1<<3) + |(1<<3) #endif #ifdef BitPS4 - |(1<<4) + |(1<<4) #endif #ifdef BitPS5 - |(1<<5) + |(1<<5) #endif #ifdef BitPS6 - |(1<<6) + |(1<<6) #endif #ifdef BitPS7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRT - DDRT|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRT|=0 #ifdef BitPT0 - |(1<<0) + |(1<<0) #endif #ifdef BitPT1 - |(1<<1) + |(1<<1) #endif #ifdef BitPT2 - |(1<<2) + |(1<<2) #endif #ifdef BitPT3 - |(1<<3) + |(1<<3) #endif #ifdef BitPT4 - |(1<<4) + |(1<<4) #endif #ifdef BitPT5 - |(1<<5) + |(1<<5) #endif #ifdef BitPT6 - |(1<<6) + |(1<<6) #endif #ifdef BitPT7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRU - DDRU|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRU|=0 #ifdef BitPU0 - |(1<<0) + |(1<<0) #endif #ifdef BitPU1 - |(1<<1) + |(1<<1) #endif #ifdef BitPU2 - |(1<<2) + |(1<<2) #endif #ifdef BitPU3 - |(1<<3) + |(1<<3) #endif #ifdef BitPU4 - |(1<<4) + |(1<<4) #endif #ifdef BitPU5 - |(1<<5) + |(1<<5) #endif #ifdef BitPU6 - |(1<<6) + |(1<<6) #endif #ifdef BitPU7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRV - DDRV|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRV|=0 #ifdef BitPV0 - |(1<<0) + |(1<<0) #endif #ifdef BitPV1 - |(1<<1) + |(1<<1) #endif #ifdef BitPV2 - |(1<<2) + |(1<<2) #endif #ifdef BitPV3 - |(1<<3) + |(1<<3) #endif #ifdef BitPV4 - |(1<<4) + |(1<<4) #endif #ifdef BitPV5 - |(1<<5) + |(1<<5) #endif #ifdef BitPV6 - |(1<<6) + |(1<<6) #endif #ifdef BitPV7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRW - DDRW|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRW|=0 #ifdef BitPW0 - |(1<<0) + |(1<<0) #endif #ifdef BitPW1 - |(1<<1) + |(1<<1) #endif #ifdef BitPW2 - |(1<<2) + |(1<<2) #endif #ifdef BitPW3 - |(1<<3) + |(1<<3) #endif #ifdef BitPW4 - |(1<<4) + |(1<<4) #endif #ifdef BitPW5 - |(1<<5) + |(1<<5) #endif #ifdef BitPW6 - |(1<<6) + |(1<<6) #endif #ifdef BitPW7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRX - DDRX|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRX|=0 #ifdef BitPX0 - |(1<<0) + |(1<<0) #endif #ifdef BitPX1 - |(1<<1) + |(1<<1) #endif #ifdef BitPX2 - |(1<<2) + |(1<<2) #endif #ifdef BitPX3 - |(1<<3) + |(1<<3) #endif #ifdef BitPX4 - |(1<<4) + |(1<<4) #endif #ifdef BitPX5 - |(1<<5) + |(1<<5) #endif #ifdef BitPX6 - |(1<<6) + |(1<<6) #endif #ifdef BitPX7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRY - DDRY|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRY|=0 #ifdef BitPY0 - |(1<<0) + |(1<<0) #endif #ifdef BitPY1 - |(1<<1) + |(1<<1) #endif #ifdef BitPY2 - |(1<<2) + |(1<<2) #endif #ifdef BitPY3 - |(1<<3) + |(1<<3) #endif #ifdef BitPY4 - |(1<<4) + |(1<<4) #endif #ifdef BitPY5 - |(1<<5) + |(1<<5) #endif #ifdef BitPY6 - |(1<<6) + |(1<<6) #endif #ifdef BitPY7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif #ifdef DDRZ - DDRZ|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + DDRZ|=0 #ifdef BitPZ0 - |(1<<0) + |(1<<0) #endif #ifdef BitPZ1 - |(1<<1) + |(1<<1) #endif #ifdef BitPZ2 - |(1<<2) + |(1<<2) #endif #ifdef BitPZ3 - |(1<<3) + |(1<<3) #endif #ifdef BitPZ4 - |(1<<4) + |(1<<4) #endif #ifdef BitPZ5 - |(1<<5) + |(1<<5) #endif #ifdef BitPZ6 - |(1<<6) + |(1<<6) #endif #ifdef BitPZ7 - |(1<<7) + |(1<<7) #endif - |0; - + |0; + } #endif - - } void ioHelperSetOuts(void) { #ifdef PORTA - PORTA|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTA|=0 #ifdef BitPA0 - |(getBit1(BitPA0)<<0) + |(getBit1(BitPA0)<<0) #endif #ifdef BitPA1 - |(getBit1(BitPA1)<<1) + |(getBit1(BitPA1)<<1) #endif #ifdef BitPA2 - |(getBit1(BitPA2)<<2) + |(getBit1(BitPA2)<<2) #endif #ifdef BitPA3 - |(getBit1(BitPA3)<<3) + |(getBit1(BitPA3)<<3) #endif #ifdef BitPA4 - |(getBit1(BitPA4)<<4) + |(getBit1(BitPA4)<<4) #endif #ifdef BitPA5 - |(getBit1(BitPA5)<<5) + |(getBit1(BitPA5)<<5) #endif #ifdef BitPA6 - |(getBit1(BitPA6)<<6) + |(getBit1(BitPA6)<<6) #endif #ifdef BitPA7 - |(getBit1(BitPA7)<<7) + |(getBit1(BitPA7)<<7) #endif - |0; + |0; + } - PORTA&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTA&=~(0 #ifdef BitPA0 - |(getBit0(BitPA0)<<0) + |(getBit0(BitPA0)<<0) #endif #ifdef BitPA1 - |(getBit0(BitPA1)<<1) + |(getBit0(BitPA1)<<1) #endif #ifdef BitPA2 - |(getBit0(BitPA2)<<2) + |(getBit0(BitPA2)<<2) #endif #ifdef BitPA3 - |(getBit0(BitPA3)<<3) + |(getBit0(BitPA3)<<3) #endif #ifdef BitPA4 - |(getBit0(BitPA4)<<4) + |(getBit0(BitPA4)<<4) #endif #ifdef BitPA5 - |(getBit0(BitPA5)<<5) + |(getBit0(BitPA5)<<5) #endif #ifdef BitPA6 - |(getBit0(BitPA6)<<6) + |(getBit0(BitPA6)<<6) #endif #ifdef BitPA7 - |(getBit0(BitPA7)<<7) + |(getBit0(BitPA7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTB - PORTB|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTB|=0 #ifdef BitPB0 - |(getBit1(BitPB0)<<0) + |(getBit1(BitPB0)<<0) #endif #ifdef BitPB1 - |(getBit1(BitPB1)<<1) + |(getBit1(BitPB1)<<1) #endif #ifdef BitPB2 - |(getBit1(BitPB2)<<2) + |(getBit1(BitPB2)<<2) #endif #ifdef BitPB3 - |(getBit1(BitPB3)<<3) + |(getBit1(BitPB3)<<3) #endif #ifdef BitPB4 - |(getBit1(BitPB4)<<4) + |(getBit1(BitPB4)<<4) #endif #ifdef BitPB5 - |(getBit1(BitPB5)<<5) + |(getBit1(BitPB5)<<5) #endif #ifdef BitPB6 - |(getBit1(BitPB6)<<6) + |(getBit1(BitPB6)<<6) #endif #ifdef BitPB7 - |(getBit1(BitPB7)<<7) + |(getBit1(BitPB7)<<7) #endif - |0; + |0; + } - PORTB&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTB&=~(0 #ifdef BitPB0 - |(getBit0(BitPB0)<<0) + |(getBit0(BitPB0)<<0) #endif #ifdef BitPB1 - |(getBit0(BitPB1)<<1) + |(getBit0(BitPB1)<<1) #endif #ifdef BitPB2 - |(getBit0(BitPB2)<<2) + |(getBit0(BitPB2)<<2) #endif #ifdef BitPB3 - |(getBit0(BitPB3)<<3) + |(getBit0(BitPB3)<<3) #endif #ifdef BitPB4 - |(getBit0(BitPB4)<<4) + |(getBit0(BitPB4)<<4) #endif #ifdef BitPB5 - |(getBit0(BitPB5)<<5) + |(getBit0(BitPB5)<<5) #endif #ifdef BitPB6 - |(getBit0(BitPB6)<<6) + |(getBit0(BitPB6)<<6) #endif #ifdef BitPB7 - |(getBit0(BitPB7)<<7) + |(getBit0(BitPB7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTC - PORTC|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTC|=0 #ifdef BitPC0 - |(getBit1(BitPC0)<<0) + |(getBit1(BitPC0)<<0) #endif #ifdef BitPC1 - |(getBit1(BitPC1)<<1) + |(getBit1(BitPC1)<<1) #endif #ifdef BitPC2 - |(getBit1(BitPC2)<<2) + |(getBit1(BitPC2)<<2) #endif #ifdef BitPC3 - |(getBit1(BitPC3)<<3) + |(getBit1(BitPC3)<<3) #endif #ifdef BitPC4 - |(getBit1(BitPC4)<<4) + |(getBit1(BitPC4)<<4) #endif #ifdef BitPC5 - |(getBit1(BitPC5)<<5) + |(getBit1(BitPC5)<<5) #endif #ifdef BitPC6 - |(getBit1(BitPC6)<<6) + |(getBit1(BitPC6)<<6) #endif #ifdef BitPC7 - |(getBit1(BitPC7)<<7) + |(getBit1(BitPC7)<<7) #endif - |0; + |0; + } - PORTC&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTC&=~(0 #ifdef BitPC0 - |(getBit0(BitPC0)<<0) + |(getBit0(BitPC0)<<0) #endif #ifdef BitPC1 - |(getBit0(BitPC1)<<1) + |(getBit0(BitPC1)<<1) #endif #ifdef BitPC2 - |(getBit0(BitPC2)<<2) + |(getBit0(BitPC2)<<2) #endif #ifdef BitPC3 - |(getBit0(BitPC3)<<3) + |(getBit0(BitPC3)<<3) #endif #ifdef BitPC4 - |(getBit0(BitPC4)<<4) + |(getBit0(BitPC4)<<4) #endif #ifdef BitPC5 - |(getBit0(BitPC5)<<5) + |(getBit0(BitPC5)<<5) #endif #ifdef BitPC6 - |(getBit0(BitPC6)<<6) + |(getBit0(BitPC6)<<6) #endif #ifdef BitPC7 - |(getBit0(BitPC7)<<7) + |(getBit0(BitPC7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTD - PORTD|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTD|=0 #ifdef BitPD0 - |(getBit1(BitPD0)<<0) + |(getBit1(BitPD0)<<0) #endif #ifdef BitPD1 - |(getBit1(BitPD1)<<1) + |(getBit1(BitPD1)<<1) #endif #ifdef BitPD2 - |(getBit1(BitPD2)<<2) + |(getBit1(BitPD2)<<2) #endif #ifdef BitPD3 - |(getBit1(BitPD3)<<3) + |(getBit1(BitPD3)<<3) #endif #ifdef BitPD4 - |(getBit1(BitPD4)<<4) + |(getBit1(BitPD4)<<4) #endif #ifdef BitPD5 - |(getBit1(BitPD5)<<5) + |(getBit1(BitPD5)<<5) #endif #ifdef BitPD6 - |(getBit1(BitPD6)<<6) + |(getBit1(BitPD6)<<6) #endif #ifdef BitPD7 - |(getBit1(BitPD7)<<7) + |(getBit1(BitPD7)<<7) #endif - |0; + |0; + } - PORTD&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTD&=~(0 #ifdef BitPD0 - |(getBit0(BitPD0)<<0) + |(getBit0(BitPD0)<<0) #endif #ifdef BitPD1 - |(getBit0(BitPD1)<<1) + |(getBit0(BitPD1)<<1) #endif #ifdef BitPD2 - |(getBit0(BitPD2)<<2) + |(getBit0(BitPD2)<<2) #endif #ifdef BitPD3 - |(getBit0(BitPD3)<<3) + |(getBit0(BitPD3)<<3) #endif #ifdef BitPD4 - |(getBit0(BitPD4)<<4) + |(getBit0(BitPD4)<<4) #endif #ifdef BitPD5 - |(getBit0(BitPD5)<<5) + |(getBit0(BitPD5)<<5) #endif #ifdef BitPD6 - |(getBit0(BitPD6)<<6) + |(getBit0(BitPD6)<<6) #endif #ifdef BitPD7 - |(getBit0(BitPD7)<<7) + |(getBit0(BitPD7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTE - PORTE|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTE|=0 #ifdef BitPE0 - |(getBit1(BitPE0)<<0) + |(getBit1(BitPE0)<<0) #endif #ifdef BitPE1 - |(getBit1(BitPE1)<<1) + |(getBit1(BitPE1)<<1) #endif #ifdef BitPE2 - |(getBit1(BitPE2)<<2) + |(getBit1(BitPE2)<<2) #endif #ifdef BitPE3 - |(getBit1(BitPE3)<<3) + |(getBit1(BitPE3)<<3) #endif #ifdef BitPE4 - |(getBit1(BitPE4)<<4) + |(getBit1(BitPE4)<<4) #endif #ifdef BitPE5 - |(getBit1(BitPE5)<<5) + |(getBit1(BitPE5)<<5) #endif #ifdef BitPE6 - |(getBit1(BitPE6)<<6) + |(getBit1(BitPE6)<<6) #endif #ifdef BitPE7 - |(getBit1(BitPE7)<<7) + |(getBit1(BitPE7)<<7) #endif - |0; + |0; + } - PORTE&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTE&=~(0 #ifdef BitPE0 - |(getBit0(BitPE0)<<0) + |(getBit0(BitPE0)<<0) #endif #ifdef BitPE1 - |(getBit0(BitPE1)<<1) + |(getBit0(BitPE1)<<1) #endif #ifdef BitPE2 - |(getBit0(BitPE2)<<2) + |(getBit0(BitPE2)<<2) #endif #ifdef BitPE3 - |(getBit0(BitPE3)<<3) + |(getBit0(BitPE3)<<3) #endif #ifdef BitPE4 - |(getBit0(BitPE4)<<4) + |(getBit0(BitPE4)<<4) #endif #ifdef BitPE5 - |(getBit0(BitPE5)<<5) + |(getBit0(BitPE5)<<5) #endif #ifdef BitPE6 - |(getBit0(BitPE6)<<6) + |(getBit0(BitPE6)<<6) #endif #ifdef BitPE7 - |(getBit0(BitPE7)<<7) + |(getBit0(BitPE7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTF - PORTF|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTF|=0 #ifdef BitPF0 - |(getBit1(BitPF0)<<0) + |(getBit1(BitPF0)<<0) #endif #ifdef BitPF1 - |(getBit1(BitPF1)<<1) + |(getBit1(BitPF1)<<1) #endif #ifdef BitPF2 - |(getBit1(BitPF2)<<2) + |(getBit1(BitPF2)<<2) #endif #ifdef BitPF3 - |(getBit1(BitPF3)<<3) + |(getBit1(BitPF3)<<3) #endif #ifdef BitPF4 - |(getBit1(BitPF4)<<4) + |(getBit1(BitPF4)<<4) #endif #ifdef BitPF5 - |(getBit1(BitPF5)<<5) + |(getBit1(BitPF5)<<5) #endif #ifdef BitPF6 - |(getBit1(BitPF6)<<6) + |(getBit1(BitPF6)<<6) #endif #ifdef BitPF7 - |(getBit1(BitPF7)<<7) + |(getBit1(BitPF7)<<7) #endif - |0; + |0; + } - PORTF&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTF&=~(0 #ifdef BitPF0 - |(getBit0(BitPF0)<<0) + |(getBit0(BitPF0)<<0) #endif #ifdef BitPF1 - |(getBit0(BitPF1)<<1) + |(getBit0(BitPF1)<<1) #endif #ifdef BitPF2 - |(getBit0(BitPF2)<<2) + |(getBit0(BitPF2)<<2) #endif #ifdef BitPF3 - |(getBit0(BitPF3)<<3) + |(getBit0(BitPF3)<<3) #endif #ifdef BitPF4 - |(getBit0(BitPF4)<<4) + |(getBit0(BitPF4)<<4) #endif #ifdef BitPF5 - |(getBit0(BitPF5)<<5) + |(getBit0(BitPF5)<<5) #endif #ifdef BitPF6 - |(getBit0(BitPF6)<<6) + |(getBit0(BitPF6)<<6) #endif #ifdef BitPF7 - |(getBit0(BitPF7)<<7) + |(getBit0(BitPF7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTG - PORTG|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTG|=0 #ifdef BitPG0 - |(getBit1(BitPG0)<<0) + |(getBit1(BitPG0)<<0) #endif #ifdef BitPG1 - |(getBit1(BitPG1)<<1) + |(getBit1(BitPG1)<<1) #endif #ifdef BitPG2 - |(getBit1(BitPG2)<<2) + |(getBit1(BitPG2)<<2) #endif #ifdef BitPG3 - |(getBit1(BitPG3)<<3) + |(getBit1(BitPG3)<<3) #endif #ifdef BitPG4 - |(getBit1(BitPG4)<<4) + |(getBit1(BitPG4)<<4) #endif #ifdef BitPG5 - |(getBit1(BitPG5)<<5) + |(getBit1(BitPG5)<<5) #endif #ifdef BitPG6 - |(getBit1(BitPG6)<<6) + |(getBit1(BitPG6)<<6) #endif #ifdef BitPG7 - |(getBit1(BitPG7)<<7) + |(getBit1(BitPG7)<<7) #endif - |0; + |0; + } - PORTG&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTG&=~(0 #ifdef BitPG0 - |(getBit0(BitPG0)<<0) + |(getBit0(BitPG0)<<0) #endif #ifdef BitPG1 - |(getBit0(BitPG1)<<1) + |(getBit0(BitPG1)<<1) #endif #ifdef BitPG2 - |(getBit0(BitPG2)<<2) + |(getBit0(BitPG2)<<2) #endif #ifdef BitPG3 - |(getBit0(BitPG3)<<3) + |(getBit0(BitPG3)<<3) #endif #ifdef BitPG4 - |(getBit0(BitPG4)<<4) + |(getBit0(BitPG4)<<4) #endif #ifdef BitPG5 - |(getBit0(BitPG5)<<5) + |(getBit0(BitPG5)<<5) #endif #ifdef BitPG6 - |(getBit0(BitPG6)<<6) + |(getBit0(BitPG6)<<6) #endif #ifdef BitPG7 - |(getBit0(BitPG7)<<7) + |(getBit0(BitPG7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTH - PORTH|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTH|=0 #ifdef BitPH0 - |(getBit1(BitPH0)<<0) + |(getBit1(BitPH0)<<0) #endif #ifdef BitPH1 - |(getBit1(BitPH1)<<1) + |(getBit1(BitPH1)<<1) #endif #ifdef BitPH2 - |(getBit1(BitPH2)<<2) + |(getBit1(BitPH2)<<2) #endif #ifdef BitPH3 - |(getBit1(BitPH3)<<3) + |(getBit1(BitPH3)<<3) #endif #ifdef BitPH4 - |(getBit1(BitPH4)<<4) + |(getBit1(BitPH4)<<4) #endif #ifdef BitPH5 - |(getBit1(BitPH5)<<5) + |(getBit1(BitPH5)<<5) #endif #ifdef BitPH6 - |(getBit1(BitPH6)<<6) + |(getBit1(BitPH6)<<6) #endif #ifdef BitPH7 - |(getBit1(BitPH7)<<7) + |(getBit1(BitPH7)<<7) #endif - |0; + |0; + } - PORTH&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTH&=~(0 #ifdef BitPH0 - |(getBit0(BitPH0)<<0) + |(getBit0(BitPH0)<<0) #endif #ifdef BitPH1 - |(getBit0(BitPH1)<<1) + |(getBit0(BitPH1)<<1) #endif #ifdef BitPH2 - |(getBit0(BitPH2)<<2) + |(getBit0(BitPH2)<<2) #endif #ifdef BitPH3 - |(getBit0(BitPH3)<<3) + |(getBit0(BitPH3)<<3) #endif #ifdef BitPH4 - |(getBit0(BitPH4)<<4) + |(getBit0(BitPH4)<<4) #endif #ifdef BitPH5 - |(getBit0(BitPH5)<<5) + |(getBit0(BitPH5)<<5) #endif #ifdef BitPH6 - |(getBit0(BitPH6)<<6) + |(getBit0(BitPH6)<<6) #endif #ifdef BitPH7 - |(getBit0(BitPH7)<<7) + |(getBit0(BitPH7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTI - PORTI|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTI|=0 #ifdef BitPI0 - |(getBit1(BitPI0)<<0) + |(getBit1(BitPI0)<<0) #endif #ifdef BitPI1 - |(getBit1(BitPI1)<<1) + |(getBit1(BitPI1)<<1) #endif #ifdef BitPI2 - |(getBit1(BitPI2)<<2) + |(getBit1(BitPI2)<<2) #endif #ifdef BitPI3 - |(getBit1(BitPI3)<<3) + |(getBit1(BitPI3)<<3) #endif #ifdef BitPI4 - |(getBit1(BitPI4)<<4) + |(getBit1(BitPI4)<<4) #endif #ifdef BitPI5 - |(getBit1(BitPI5)<<5) + |(getBit1(BitPI5)<<5) #endif #ifdef BitPI6 - |(getBit1(BitPI6)<<6) + |(getBit1(BitPI6)<<6) #endif #ifdef BitPI7 - |(getBit1(BitPI7)<<7) + |(getBit1(BitPI7)<<7) #endif - |0; + |0; + } - PORTI&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTI&=~(0 #ifdef BitPI0 - |(getBit0(BitPI0)<<0) + |(getBit0(BitPI0)<<0) #endif #ifdef BitPI1 - |(getBit0(BitPI1)<<1) + |(getBit0(BitPI1)<<1) #endif #ifdef BitPI2 - |(getBit0(BitPI2)<<2) + |(getBit0(BitPI2)<<2) #endif #ifdef BitPI3 - |(getBit0(BitPI3)<<3) + |(getBit0(BitPI3)<<3) #endif #ifdef BitPI4 - |(getBit0(BitPI4)<<4) + |(getBit0(BitPI4)<<4) #endif #ifdef BitPI5 - |(getBit0(BitPI5)<<5) + |(getBit0(BitPI5)<<5) #endif #ifdef BitPI6 - |(getBit0(BitPI6)<<6) + |(getBit0(BitPI6)<<6) #endif #ifdef BitPI7 - |(getBit0(BitPI7)<<7) + |(getBit0(BitPI7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTJ - PORTJ|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTJ|=0 #ifdef BitPJ0 - |(getBit1(BitPJ0)<<0) + |(getBit1(BitPJ0)<<0) #endif #ifdef BitPJ1 - |(getBit1(BitPJ1)<<1) + |(getBit1(BitPJ1)<<1) #endif #ifdef BitPJ2 - |(getBit1(BitPJ2)<<2) + |(getBit1(BitPJ2)<<2) #endif #ifdef BitPJ3 - |(getBit1(BitPJ3)<<3) + |(getBit1(BitPJ3)<<3) #endif #ifdef BitPJ4 - |(getBit1(BitPJ4)<<4) + |(getBit1(BitPJ4)<<4) #endif #ifdef BitPJ5 - |(getBit1(BitPJ5)<<5) + |(getBit1(BitPJ5)<<5) #endif #ifdef BitPJ6 - |(getBit1(BitPJ6)<<6) + |(getBit1(BitPJ6)<<6) #endif #ifdef BitPJ7 - |(getBit1(BitPJ7)<<7) + |(getBit1(BitPJ7)<<7) #endif - |0; + |0; + } - PORTJ&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTJ&=~(0 #ifdef BitPJ0 - |(getBit0(BitPJ0)<<0) + |(getBit0(BitPJ0)<<0) #endif #ifdef BitPJ1 - |(getBit0(BitPJ1)<<1) + |(getBit0(BitPJ1)<<1) #endif #ifdef BitPJ2 - |(getBit0(BitPJ2)<<2) + |(getBit0(BitPJ2)<<2) #endif #ifdef BitPJ3 - |(getBit0(BitPJ3)<<3) + |(getBit0(BitPJ3)<<3) #endif #ifdef BitPJ4 - |(getBit0(BitPJ4)<<4) + |(getBit0(BitPJ4)<<4) #endif #ifdef BitPJ5 - |(getBit0(BitPJ5)<<5) + |(getBit0(BitPJ5)<<5) #endif #ifdef BitPJ6 - |(getBit0(BitPJ6)<<6) + |(getBit0(BitPJ6)<<6) #endif #ifdef BitPJ7 - |(getBit0(BitPJ7)<<7) + |(getBit0(BitPJ7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTK - PORTK|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTK|=0 #ifdef BitPK0 - |(getBit1(BitPK0)<<0) + |(getBit1(BitPK0)<<0) #endif #ifdef BitPK1 - |(getBit1(BitPK1)<<1) + |(getBit1(BitPK1)<<1) #endif #ifdef BitPK2 - |(getBit1(BitPK2)<<2) + |(getBit1(BitPK2)<<2) #endif #ifdef BitPK3 - |(getBit1(BitPK3)<<3) + |(getBit1(BitPK3)<<3) #endif #ifdef BitPK4 - |(getBit1(BitPK4)<<4) + |(getBit1(BitPK4)<<4) #endif #ifdef BitPK5 - |(getBit1(BitPK5)<<5) + |(getBit1(BitPK5)<<5) #endif #ifdef BitPK6 - |(getBit1(BitPK6)<<6) + |(getBit1(BitPK6)<<6) #endif #ifdef BitPK7 - |(getBit1(BitPK7)<<7) + |(getBit1(BitPK7)<<7) #endif - |0; + |0; + } - PORTK&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTK&=~(0 #ifdef BitPK0 - |(getBit0(BitPK0)<<0) + |(getBit0(BitPK0)<<0) #endif #ifdef BitPK1 - |(getBit0(BitPK1)<<1) + |(getBit0(BitPK1)<<1) #endif #ifdef BitPK2 - |(getBit0(BitPK2)<<2) + |(getBit0(BitPK2)<<2) #endif #ifdef BitPK3 - |(getBit0(BitPK3)<<3) + |(getBit0(BitPK3)<<3) #endif #ifdef BitPK4 - |(getBit0(BitPK4)<<4) + |(getBit0(BitPK4)<<4) #endif #ifdef BitPK5 - |(getBit0(BitPK5)<<5) + |(getBit0(BitPK5)<<5) #endif #ifdef BitPK6 - |(getBit0(BitPK6)<<6) + |(getBit0(BitPK6)<<6) #endif #ifdef BitPK7 - |(getBit0(BitPK7)<<7) + |(getBit0(BitPK7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTL - PORTL|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTL|=0 #ifdef BitPL0 - |(getBit1(BitPL0)<<0) + |(getBit1(BitPL0)<<0) #endif #ifdef BitPL1 - |(getBit1(BitPL1)<<1) + |(getBit1(BitPL1)<<1) #endif #ifdef BitPL2 - |(getBit1(BitPL2)<<2) + |(getBit1(BitPL2)<<2) #endif #ifdef BitPL3 - |(getBit1(BitPL3)<<3) + |(getBit1(BitPL3)<<3) #endif #ifdef BitPL4 - |(getBit1(BitPL4)<<4) + |(getBit1(BitPL4)<<4) #endif #ifdef BitPL5 - |(getBit1(BitPL5)<<5) + |(getBit1(BitPL5)<<5) #endif #ifdef BitPL6 - |(getBit1(BitPL6)<<6) + |(getBit1(BitPL6)<<6) #endif #ifdef BitPL7 - |(getBit1(BitPL7)<<7) + |(getBit1(BitPL7)<<7) #endif - |0; + |0; + } - PORTL&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTL&=~(0 #ifdef BitPL0 - |(getBit0(BitPL0)<<0) + |(getBit0(BitPL0)<<0) #endif #ifdef BitPL1 - |(getBit0(BitPL1)<<1) + |(getBit0(BitPL1)<<1) #endif #ifdef BitPL2 - |(getBit0(BitPL2)<<2) + |(getBit0(BitPL2)<<2) #endif #ifdef BitPL3 - |(getBit0(BitPL3)<<3) + |(getBit0(BitPL3)<<3) #endif #ifdef BitPL4 - |(getBit0(BitPL4)<<4) + |(getBit0(BitPL4)<<4) #endif #ifdef BitPL5 - |(getBit0(BitPL5)<<5) + |(getBit0(BitPL5)<<5) #endif #ifdef BitPL6 - |(getBit0(BitPL6)<<6) + |(getBit0(BitPL6)<<6) #endif #ifdef BitPL7 - |(getBit0(BitPL7)<<7) + |(getBit0(BitPL7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTM - PORTM|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTM|=0 #ifdef BitPM0 - |(getBit1(BitPM0)<<0) + |(getBit1(BitPM0)<<0) #endif #ifdef BitPM1 - |(getBit1(BitPM1)<<1) + |(getBit1(BitPM1)<<1) #endif #ifdef BitPM2 - |(getBit1(BitPM2)<<2) + |(getBit1(BitPM2)<<2) #endif #ifdef BitPM3 - |(getBit1(BitPM3)<<3) + |(getBit1(BitPM3)<<3) #endif #ifdef BitPM4 - |(getBit1(BitPM4)<<4) + |(getBit1(BitPM4)<<4) #endif #ifdef BitPM5 - |(getBit1(BitPM5)<<5) + |(getBit1(BitPM5)<<5) #endif #ifdef BitPM6 - |(getBit1(BitPM6)<<6) + |(getBit1(BitPM6)<<6) #endif #ifdef BitPM7 - |(getBit1(BitPM7)<<7) + |(getBit1(BitPM7)<<7) #endif - |0; + |0; + } - PORTM&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTM&=~(0 #ifdef BitPM0 - |(getBit0(BitPM0)<<0) + |(getBit0(BitPM0)<<0) #endif #ifdef BitPM1 - |(getBit0(BitPM1)<<1) + |(getBit0(BitPM1)<<1) #endif #ifdef BitPM2 - |(getBit0(BitPM2)<<2) + |(getBit0(BitPM2)<<2) #endif #ifdef BitPM3 - |(getBit0(BitPM3)<<3) + |(getBit0(BitPM3)<<3) #endif #ifdef BitPM4 - |(getBit0(BitPM4)<<4) + |(getBit0(BitPM4)<<4) #endif #ifdef BitPM5 - |(getBit0(BitPM5)<<5) + |(getBit0(BitPM5)<<5) #endif #ifdef BitPM6 - |(getBit0(BitPM6)<<6) + |(getBit0(BitPM6)<<6) #endif #ifdef BitPM7 - |(getBit0(BitPM7)<<7) + |(getBit0(BitPM7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTN - PORTN|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTN|=0 #ifdef BitPN0 - |(getBit1(BitPN0)<<0) + |(getBit1(BitPN0)<<0) #endif #ifdef BitPN1 - |(getBit1(BitPN1)<<1) + |(getBit1(BitPN1)<<1) #endif #ifdef BitPN2 - |(getBit1(BitPN2)<<2) + |(getBit1(BitPN2)<<2) #endif #ifdef BitPN3 - |(getBit1(BitPN3)<<3) + |(getBit1(BitPN3)<<3) #endif #ifdef BitPN4 - |(getBit1(BitPN4)<<4) + |(getBit1(BitPN4)<<4) #endif #ifdef BitPN5 - |(getBit1(BitPN5)<<5) + |(getBit1(BitPN5)<<5) #endif #ifdef BitPN6 - |(getBit1(BitPN6)<<6) + |(getBit1(BitPN6)<<6) #endif #ifdef BitPN7 - |(getBit1(BitPN7)<<7) + |(getBit1(BitPN7)<<7) #endif - |0; + |0; + } - PORTN&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTN&=~(0 #ifdef BitPN0 - |(getBit0(BitPN0)<<0) + |(getBit0(BitPN0)<<0) #endif #ifdef BitPN1 - |(getBit0(BitPN1)<<1) + |(getBit0(BitPN1)<<1) #endif #ifdef BitPN2 - |(getBit0(BitPN2)<<2) + |(getBit0(BitPN2)<<2) #endif #ifdef BitPN3 - |(getBit0(BitPN3)<<3) + |(getBit0(BitPN3)<<3) #endif #ifdef BitPN4 - |(getBit0(BitPN4)<<4) + |(getBit0(BitPN4)<<4) #endif #ifdef BitPN5 - |(getBit0(BitPN5)<<5) + |(getBit0(BitPN5)<<5) #endif #ifdef BitPN6 - |(getBit0(BitPN6)<<6) + |(getBit0(BitPN6)<<6) #endif #ifdef BitPN7 - |(getBit0(BitPN7)<<7) + |(getBit0(BitPN7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTO - PORTO|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTO|=0 #ifdef BitPO0 - |(getBit1(BitPO0)<<0) + |(getBit1(BitPO0)<<0) #endif #ifdef BitPO1 - |(getBit1(BitPO1)<<1) + |(getBit1(BitPO1)<<1) #endif #ifdef BitPO2 - |(getBit1(BitPO2)<<2) + |(getBit1(BitPO2)<<2) #endif #ifdef BitPO3 - |(getBit1(BitPO3)<<3) + |(getBit1(BitPO3)<<3) #endif #ifdef BitPO4 - |(getBit1(BitPO4)<<4) + |(getBit1(BitPO4)<<4) #endif #ifdef BitPO5 - |(getBit1(BitPO5)<<5) + |(getBit1(BitPO5)<<5) #endif #ifdef BitPO6 - |(getBit1(BitPO6)<<6) + |(getBit1(BitPO6)<<6) #endif #ifdef BitPO7 - |(getBit1(BitPO7)<<7) + |(getBit1(BitPO7)<<7) #endif - |0; + |0; + } - PORTO&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTO&=~(0 #ifdef BitPO0 - |(getBit0(BitPO0)<<0) + |(getBit0(BitPO0)<<0) #endif #ifdef BitPO1 - |(getBit0(BitPO1)<<1) + |(getBit0(BitPO1)<<1) #endif #ifdef BitPO2 - |(getBit0(BitPO2)<<2) + |(getBit0(BitPO2)<<2) #endif #ifdef BitPO3 - |(getBit0(BitPO3)<<3) + |(getBit0(BitPO3)<<3) #endif #ifdef BitPO4 - |(getBit0(BitPO4)<<4) + |(getBit0(BitPO4)<<4) #endif #ifdef BitPO5 - |(getBit0(BitPO5)<<5) + |(getBit0(BitPO5)<<5) #endif #ifdef BitPO6 - |(getBit0(BitPO6)<<6) + |(getBit0(BitPO6)<<6) #endif #ifdef BitPO7 - |(getBit0(BitPO7)<<7) + |(getBit0(BitPO7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTP - PORTP|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTP|=0 #ifdef BitPP0 - |(getBit1(BitPP0)<<0) + |(getBit1(BitPP0)<<0) #endif #ifdef BitPP1 - |(getBit1(BitPP1)<<1) + |(getBit1(BitPP1)<<1) #endif #ifdef BitPP2 - |(getBit1(BitPP2)<<2) + |(getBit1(BitPP2)<<2) #endif #ifdef BitPP3 - |(getBit1(BitPP3)<<3) + |(getBit1(BitPP3)<<3) #endif #ifdef BitPP4 - |(getBit1(BitPP4)<<4) + |(getBit1(BitPP4)<<4) #endif #ifdef BitPP5 - |(getBit1(BitPP5)<<5) + |(getBit1(BitPP5)<<5) #endif #ifdef BitPP6 - |(getBit1(BitPP6)<<6) + |(getBit1(BitPP6)<<6) #endif #ifdef BitPP7 - |(getBit1(BitPP7)<<7) + |(getBit1(BitPP7)<<7) #endif - |0; + |0; + } - PORTP&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTP&=~(0 #ifdef BitPP0 - |(getBit0(BitPP0)<<0) + |(getBit0(BitPP0)<<0) #endif #ifdef BitPP1 - |(getBit0(BitPP1)<<1) + |(getBit0(BitPP1)<<1) #endif #ifdef BitPP2 - |(getBit0(BitPP2)<<2) + |(getBit0(BitPP2)<<2) #endif #ifdef BitPP3 - |(getBit0(BitPP3)<<3) + |(getBit0(BitPP3)<<3) #endif #ifdef BitPP4 - |(getBit0(BitPP4)<<4) + |(getBit0(BitPP4)<<4) #endif #ifdef BitPP5 - |(getBit0(BitPP5)<<5) + |(getBit0(BitPP5)<<5) #endif #ifdef BitPP6 - |(getBit0(BitPP6)<<6) + |(getBit0(BitPP6)<<6) #endif #ifdef BitPP7 - |(getBit0(BitPP7)<<7) + |(getBit0(BitPP7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTQ - PORTQ|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTQ|=0 #ifdef BitPQ0 - |(getBit1(BitPQ0)<<0) + |(getBit1(BitPQ0)<<0) #endif #ifdef BitPQ1 - |(getBit1(BitPQ1)<<1) + |(getBit1(BitPQ1)<<1) #endif #ifdef BitPQ2 - |(getBit1(BitPQ2)<<2) + |(getBit1(BitPQ2)<<2) #endif #ifdef BitPQ3 - |(getBit1(BitPQ3)<<3) + |(getBit1(BitPQ3)<<3) #endif #ifdef BitPQ4 - |(getBit1(BitPQ4)<<4) + |(getBit1(BitPQ4)<<4) #endif #ifdef BitPQ5 - |(getBit1(BitPQ5)<<5) + |(getBit1(BitPQ5)<<5) #endif #ifdef BitPQ6 - |(getBit1(BitPQ6)<<6) + |(getBit1(BitPQ6)<<6) #endif #ifdef BitPQ7 - |(getBit1(BitPQ7)<<7) + |(getBit1(BitPQ7)<<7) #endif - |0; + |0; + } - PORTQ&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTQ&=~(0 #ifdef BitPQ0 - |(getBit0(BitPQ0)<<0) + |(getBit0(BitPQ0)<<0) #endif #ifdef BitPQ1 - |(getBit0(BitPQ1)<<1) + |(getBit0(BitPQ1)<<1) #endif #ifdef BitPQ2 - |(getBit0(BitPQ2)<<2) + |(getBit0(BitPQ2)<<2) #endif #ifdef BitPQ3 - |(getBit0(BitPQ3)<<3) + |(getBit0(BitPQ3)<<3) #endif #ifdef BitPQ4 - |(getBit0(BitPQ4)<<4) + |(getBit0(BitPQ4)<<4) #endif #ifdef BitPQ5 - |(getBit0(BitPQ5)<<5) + |(getBit0(BitPQ5)<<5) #endif #ifdef BitPQ6 - |(getBit0(BitPQ6)<<6) + |(getBit0(BitPQ6)<<6) #endif #ifdef BitPQ7 - |(getBit0(BitPQ7)<<7) + |(getBit0(BitPQ7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTR - PORTR|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTR|=0 #ifdef BitPR0 - |(getBit1(BitPR0)<<0) + |(getBit1(BitPR0)<<0) #endif #ifdef BitPR1 - |(getBit1(BitPR1)<<1) + |(getBit1(BitPR1)<<1) #endif #ifdef BitPR2 - |(getBit1(BitPR2)<<2) + |(getBit1(BitPR2)<<2) #endif #ifdef BitPR3 - |(getBit1(BitPR3)<<3) + |(getBit1(BitPR3)<<3) #endif #ifdef BitPR4 - |(getBit1(BitPR4)<<4) + |(getBit1(BitPR4)<<4) #endif #ifdef BitPR5 - |(getBit1(BitPR5)<<5) + |(getBit1(BitPR5)<<5) #endif #ifdef BitPR6 - |(getBit1(BitPR6)<<6) + |(getBit1(BitPR6)<<6) #endif #ifdef BitPR7 - |(getBit1(BitPR7)<<7) + |(getBit1(BitPR7)<<7) #endif - |0; + |0; + } - PORTR&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTR&=~(0 #ifdef BitPR0 - |(getBit0(BitPR0)<<0) + |(getBit0(BitPR0)<<0) #endif #ifdef BitPR1 - |(getBit0(BitPR1)<<1) + |(getBit0(BitPR1)<<1) #endif #ifdef BitPR2 - |(getBit0(BitPR2)<<2) + |(getBit0(BitPR2)<<2) #endif #ifdef BitPR3 - |(getBit0(BitPR3)<<3) + |(getBit0(BitPR3)<<3) #endif #ifdef BitPR4 - |(getBit0(BitPR4)<<4) + |(getBit0(BitPR4)<<4) #endif #ifdef BitPR5 - |(getBit0(BitPR5)<<5) + |(getBit0(BitPR5)<<5) #endif #ifdef BitPR6 - |(getBit0(BitPR6)<<6) + |(getBit0(BitPR6)<<6) #endif #ifdef BitPR7 - |(getBit0(BitPR7)<<7) + |(getBit0(BitPR7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTS - PORTS|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTS|=0 #ifdef BitPS0 - |(getBit1(BitPS0)<<0) + |(getBit1(BitPS0)<<0) #endif #ifdef BitPS1 - |(getBit1(BitPS1)<<1) + |(getBit1(BitPS1)<<1) #endif #ifdef BitPS2 - |(getBit1(BitPS2)<<2) + |(getBit1(BitPS2)<<2) #endif #ifdef BitPS3 - |(getBit1(BitPS3)<<3) + |(getBit1(BitPS3)<<3) #endif #ifdef BitPS4 - |(getBit1(BitPS4)<<4) + |(getBit1(BitPS4)<<4) #endif #ifdef BitPS5 - |(getBit1(BitPS5)<<5) + |(getBit1(BitPS5)<<5) #endif #ifdef BitPS6 - |(getBit1(BitPS6)<<6) + |(getBit1(BitPS6)<<6) #endif #ifdef BitPS7 - |(getBit1(BitPS7)<<7) + |(getBit1(BitPS7)<<7) #endif - |0; + |0; + } - PORTS&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTS&=~(0 #ifdef BitPS0 - |(getBit0(BitPS0)<<0) + |(getBit0(BitPS0)<<0) #endif #ifdef BitPS1 - |(getBit0(BitPS1)<<1) + |(getBit0(BitPS1)<<1) #endif #ifdef BitPS2 - |(getBit0(BitPS2)<<2) + |(getBit0(BitPS2)<<2) #endif #ifdef BitPS3 - |(getBit0(BitPS3)<<3) + |(getBit0(BitPS3)<<3) #endif #ifdef BitPS4 - |(getBit0(BitPS4)<<4) + |(getBit0(BitPS4)<<4) #endif #ifdef BitPS5 - |(getBit0(BitPS5)<<5) + |(getBit0(BitPS5)<<5) #endif #ifdef BitPS6 - |(getBit0(BitPS6)<<6) + |(getBit0(BitPS6)<<6) #endif #ifdef BitPS7 - |(getBit0(BitPS7)<<7) + |(getBit0(BitPS7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTT - PORTT|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTT|=0 #ifdef BitPT0 - |(getBit1(BitPT0)<<0) + |(getBit1(BitPT0)<<0) #endif #ifdef BitPT1 - |(getBit1(BitPT1)<<1) + |(getBit1(BitPT1)<<1) #endif #ifdef BitPT2 - |(getBit1(BitPT2)<<2) + |(getBit1(BitPT2)<<2) #endif #ifdef BitPT3 - |(getBit1(BitPT3)<<3) + |(getBit1(BitPT3)<<3) #endif #ifdef BitPT4 - |(getBit1(BitPT4)<<4) + |(getBit1(BitPT4)<<4) #endif #ifdef BitPT5 - |(getBit1(BitPT5)<<5) + |(getBit1(BitPT5)<<5) #endif #ifdef BitPT6 - |(getBit1(BitPT6)<<6) + |(getBit1(BitPT6)<<6) #endif #ifdef BitPT7 - |(getBit1(BitPT7)<<7) + |(getBit1(BitPT7)<<7) #endif - |0; + |0; + } - PORTT&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTT&=~(0 #ifdef BitPT0 - |(getBit0(BitPT0)<<0) + |(getBit0(BitPT0)<<0) #endif #ifdef BitPT1 - |(getBit0(BitPT1)<<1) + |(getBit0(BitPT1)<<1) #endif #ifdef BitPT2 - |(getBit0(BitPT2)<<2) + |(getBit0(BitPT2)<<2) #endif #ifdef BitPT3 - |(getBit0(BitPT3)<<3) + |(getBit0(BitPT3)<<3) #endif #ifdef BitPT4 - |(getBit0(BitPT4)<<4) + |(getBit0(BitPT4)<<4) #endif #ifdef BitPT5 - |(getBit0(BitPT5)<<5) + |(getBit0(BitPT5)<<5) #endif #ifdef BitPT6 - |(getBit0(BitPT6)<<6) + |(getBit0(BitPT6)<<6) #endif #ifdef BitPT7 - |(getBit0(BitPT7)<<7) + |(getBit0(BitPT7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTU - PORTU|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTU|=0 #ifdef BitPU0 - |(getBit1(BitPU0)<<0) + |(getBit1(BitPU0)<<0) #endif #ifdef BitPU1 - |(getBit1(BitPU1)<<1) + |(getBit1(BitPU1)<<1) #endif #ifdef BitPU2 - |(getBit1(BitPU2)<<2) + |(getBit1(BitPU2)<<2) #endif #ifdef BitPU3 - |(getBit1(BitPU3)<<3) + |(getBit1(BitPU3)<<3) #endif #ifdef BitPU4 - |(getBit1(BitPU4)<<4) + |(getBit1(BitPU4)<<4) #endif #ifdef BitPU5 - |(getBit1(BitPU5)<<5) + |(getBit1(BitPU5)<<5) #endif #ifdef BitPU6 - |(getBit1(BitPU6)<<6) + |(getBit1(BitPU6)<<6) #endif #ifdef BitPU7 - |(getBit1(BitPU7)<<7) + |(getBit1(BitPU7)<<7) #endif - |0; + |0; + } - PORTU&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTU&=~(0 #ifdef BitPU0 - |(getBit0(BitPU0)<<0) + |(getBit0(BitPU0)<<0) #endif #ifdef BitPU1 - |(getBit0(BitPU1)<<1) + |(getBit0(BitPU1)<<1) #endif #ifdef BitPU2 - |(getBit0(BitPU2)<<2) + |(getBit0(BitPU2)<<2) #endif #ifdef BitPU3 - |(getBit0(BitPU3)<<3) + |(getBit0(BitPU3)<<3) #endif #ifdef BitPU4 - |(getBit0(BitPU4)<<4) + |(getBit0(BitPU4)<<4) #endif #ifdef BitPU5 - |(getBit0(BitPU5)<<5) + |(getBit0(BitPU5)<<5) #endif #ifdef BitPU6 - |(getBit0(BitPU6)<<6) + |(getBit0(BitPU6)<<6) #endif #ifdef BitPU7 - |(getBit0(BitPU7)<<7) + |(getBit0(BitPU7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTV - PORTV|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTV|=0 #ifdef BitPV0 - |(getBit1(BitPV0)<<0) + |(getBit1(BitPV0)<<0) #endif #ifdef BitPV1 - |(getBit1(BitPV1)<<1) + |(getBit1(BitPV1)<<1) #endif #ifdef BitPV2 - |(getBit1(BitPV2)<<2) + |(getBit1(BitPV2)<<2) #endif #ifdef BitPV3 - |(getBit1(BitPV3)<<3) + |(getBit1(BitPV3)<<3) #endif #ifdef BitPV4 - |(getBit1(BitPV4)<<4) + |(getBit1(BitPV4)<<4) #endif #ifdef BitPV5 - |(getBit1(BitPV5)<<5) + |(getBit1(BitPV5)<<5) #endif #ifdef BitPV6 - |(getBit1(BitPV6)<<6) + |(getBit1(BitPV6)<<6) #endif #ifdef BitPV7 - |(getBit1(BitPV7)<<7) + |(getBit1(BitPV7)<<7) #endif - |0; + |0; + } - PORTV&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTV&=~(0 #ifdef BitPV0 - |(getBit0(BitPV0)<<0) + |(getBit0(BitPV0)<<0) #endif #ifdef BitPV1 - |(getBit0(BitPV1)<<1) + |(getBit0(BitPV1)<<1) #endif #ifdef BitPV2 - |(getBit0(BitPV2)<<2) + |(getBit0(BitPV2)<<2) #endif #ifdef BitPV3 - |(getBit0(BitPV3)<<3) + |(getBit0(BitPV3)<<3) #endif #ifdef BitPV4 - |(getBit0(BitPV4)<<4) + |(getBit0(BitPV4)<<4) #endif #ifdef BitPV5 - |(getBit0(BitPV5)<<5) + |(getBit0(BitPV5)<<5) #endif #ifdef BitPV6 - |(getBit0(BitPV6)<<6) + |(getBit0(BitPV6)<<6) #endif #ifdef BitPV7 - |(getBit0(BitPV7)<<7) + |(getBit0(BitPV7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTW - PORTW|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTW|=0 #ifdef BitPW0 - |(getBit1(BitPW0)<<0) + |(getBit1(BitPW0)<<0) #endif #ifdef BitPW1 - |(getBit1(BitPW1)<<1) + |(getBit1(BitPW1)<<1) #endif #ifdef BitPW2 - |(getBit1(BitPW2)<<2) + |(getBit1(BitPW2)<<2) #endif #ifdef BitPW3 - |(getBit1(BitPW3)<<3) + |(getBit1(BitPW3)<<3) #endif #ifdef BitPW4 - |(getBit1(BitPW4)<<4) + |(getBit1(BitPW4)<<4) #endif #ifdef BitPW5 - |(getBit1(BitPW5)<<5) + |(getBit1(BitPW5)<<5) #endif #ifdef BitPW6 - |(getBit1(BitPW6)<<6) + |(getBit1(BitPW6)<<6) #endif #ifdef BitPW7 - |(getBit1(BitPW7)<<7) + |(getBit1(BitPW7)<<7) #endif - |0; + |0; + } - PORTW&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTW&=~(0 #ifdef BitPW0 - |(getBit0(BitPW0)<<0) + |(getBit0(BitPW0)<<0) #endif #ifdef BitPW1 - |(getBit0(BitPW1)<<1) + |(getBit0(BitPW1)<<1) #endif #ifdef BitPW2 - |(getBit0(BitPW2)<<2) + |(getBit0(BitPW2)<<2) #endif #ifdef BitPW3 - |(getBit0(BitPW3)<<3) + |(getBit0(BitPW3)<<3) #endif #ifdef BitPW4 - |(getBit0(BitPW4)<<4) + |(getBit0(BitPW4)<<4) #endif #ifdef BitPW5 - |(getBit0(BitPW5)<<5) + |(getBit0(BitPW5)<<5) #endif #ifdef BitPW6 - |(getBit0(BitPW6)<<6) + |(getBit0(BitPW6)<<6) #endif #ifdef BitPW7 - |(getBit0(BitPW7)<<7) + |(getBit0(BitPW7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTX - PORTX|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTX|=0 #ifdef BitPX0 - |(getBit1(BitPX0)<<0) + |(getBit1(BitPX0)<<0) #endif #ifdef BitPX1 - |(getBit1(BitPX1)<<1) + |(getBit1(BitPX1)<<1) #endif #ifdef BitPX2 - |(getBit1(BitPX2)<<2) + |(getBit1(BitPX2)<<2) #endif #ifdef BitPX3 - |(getBit1(BitPX3)<<3) + |(getBit1(BitPX3)<<3) #endif #ifdef BitPX4 - |(getBit1(BitPX4)<<4) + |(getBit1(BitPX4)<<4) #endif #ifdef BitPX5 - |(getBit1(BitPX5)<<5) + |(getBit1(BitPX5)<<5) #endif #ifdef BitPX6 - |(getBit1(BitPX6)<<6) + |(getBit1(BitPX6)<<6) #endif #ifdef BitPX7 - |(getBit1(BitPX7)<<7) + |(getBit1(BitPX7)<<7) #endif - |0; + |0; + } - PORTX&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTX&=~(0 #ifdef BitPX0 - |(getBit0(BitPX0)<<0) + |(getBit0(BitPX0)<<0) #endif #ifdef BitPX1 - |(getBit0(BitPX1)<<1) + |(getBit0(BitPX1)<<1) #endif #ifdef BitPX2 - |(getBit0(BitPX2)<<2) + |(getBit0(BitPX2)<<2) #endif #ifdef BitPX3 - |(getBit0(BitPX3)<<3) + |(getBit0(BitPX3)<<3) #endif #ifdef BitPX4 - |(getBit0(BitPX4)<<4) + |(getBit0(BitPX4)<<4) #endif #ifdef BitPX5 - |(getBit0(BitPX5)<<5) + |(getBit0(BitPX5)<<5) #endif #ifdef BitPX6 - |(getBit0(BitPX6)<<6) + |(getBit0(BitPX6)<<6) #endif #ifdef BitPX7 - |(getBit0(BitPX7)<<7) + |(getBit0(BitPX7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTY - PORTY|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTY|=0 #ifdef BitPY0 - |(getBit1(BitPY0)<<0) + |(getBit1(BitPY0)<<0) #endif #ifdef BitPY1 - |(getBit1(BitPY1)<<1) + |(getBit1(BitPY1)<<1) #endif #ifdef BitPY2 - |(getBit1(BitPY2)<<2) + |(getBit1(BitPY2)<<2) #endif #ifdef BitPY3 - |(getBit1(BitPY3)<<3) + |(getBit1(BitPY3)<<3) #endif #ifdef BitPY4 - |(getBit1(BitPY4)<<4) + |(getBit1(BitPY4)<<4) #endif #ifdef BitPY5 - |(getBit1(BitPY5)<<5) + |(getBit1(BitPY5)<<5) #endif #ifdef BitPY6 - |(getBit1(BitPY6)<<6) + |(getBit1(BitPY6)<<6) #endif #ifdef BitPY7 - |(getBit1(BitPY7)<<7) + |(getBit1(BitPY7)<<7) #endif - |0; + |0; + } - PORTY&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTY&=~(0 #ifdef BitPY0 - |(getBit0(BitPY0)<<0) + |(getBit0(BitPY0)<<0) #endif #ifdef BitPY1 - |(getBit0(BitPY1)<<1) + |(getBit0(BitPY1)<<1) #endif #ifdef BitPY2 - |(getBit0(BitPY2)<<2) + |(getBit0(BitPY2)<<2) #endif #ifdef BitPY3 - |(getBit0(BitPY3)<<3) + |(getBit0(BitPY3)<<3) #endif #ifdef BitPY4 - |(getBit0(BitPY4)<<4) + |(getBit0(BitPY4)<<4) #endif #ifdef BitPY5 - |(getBit0(BitPY5)<<5) + |(getBit0(BitPY5)<<5) #endif #ifdef BitPY6 - |(getBit0(BitPY6)<<6) + |(getBit0(BitPY6)<<6) #endif #ifdef BitPY7 - |(getBit0(BitPY7)<<7) + |(getBit0(BitPY7)<<7) #endif - |0); + |0); + } #endif #ifdef PORTZ - PORTZ|=0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTZ|=0 #ifdef BitPZ0 - |(getBit1(BitPZ0)<<0) + |(getBit1(BitPZ0)<<0) #endif #ifdef BitPZ1 - |(getBit1(BitPZ1)<<1) + |(getBit1(BitPZ1)<<1) #endif #ifdef BitPZ2 - |(getBit1(BitPZ2)<<2) + |(getBit1(BitPZ2)<<2) #endif #ifdef BitPZ3 - |(getBit1(BitPZ3)<<3) + |(getBit1(BitPZ3)<<3) #endif #ifdef BitPZ4 - |(getBit1(BitPZ4)<<4) + |(getBit1(BitPZ4)<<4) #endif #ifdef BitPZ5 - |(getBit1(BitPZ5)<<5) + |(getBit1(BitPZ5)<<5) #endif #ifdef BitPZ6 - |(getBit1(BitPZ6)<<6) + |(getBit1(BitPZ6)<<6) #endif #ifdef BitPZ7 - |(getBit1(BitPZ7)<<7) + |(getBit1(BitPZ7)<<7) #endif - |0; + |0; + } - PORTZ&=~(0 + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + PORTZ&=~(0 #ifdef BitPZ0 - |(getBit0(BitPZ0)<<0) + |(getBit0(BitPZ0)<<0) #endif #ifdef BitPZ1 - |(getBit0(BitPZ1)<<1) + |(getBit0(BitPZ1)<<1) #endif #ifdef BitPZ2 - |(getBit0(BitPZ2)<<2) + |(getBit0(BitPZ2)<<2) #endif #ifdef BitPZ3 - |(getBit0(BitPZ3)<<3) + |(getBit0(BitPZ3)<<3) #endif #ifdef BitPZ4 - |(getBit0(BitPZ4)<<4) + |(getBit0(BitPZ4)<<4) #endif #ifdef BitPZ5 - |(getBit0(BitPZ5)<<5) + |(getBit0(BitPZ5)<<5) #endif #ifdef BitPZ6 - |(getBit0(BitPZ6)<<6) + |(getBit0(BitPZ6)<<6) #endif #ifdef BitPZ7 - |(getBit0(BitPZ7)<<7) + |(getBit0(BitPZ7)<<7) #endif - |0); + |0); + } #endif - }