add atomics

newsource
Eggert Jung 3 years ago
parent e2f55b4284
commit 2ea6ec2e03

@ -1,4 +1,5 @@
#include <avr/io.h> #include <avr/io.h>
#include <util/atomic.h>
#include "io-helper.h" #include "io-helper.h"
volatile uint8_t outStates[nrOfOutputs/8]; volatile uint8_t outStates[nrOfOutputs/8];
@ -81,6 +82,7 @@ void ioHelperIoConf(void) {
} }
#ifdef DDRA #ifdef DDRA
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRA|=0 DDRA|=0
#ifdef BitPA0 #ifdef BitPA0
|(1<<0) |(1<<0)
@ -107,11 +109,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRB #ifdef DDRB
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRB|=0 DDRB|=0
#ifdef BitPB0 #ifdef BitPB0
|(1<<0) |(1<<0)
@ -138,11 +141,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRC #ifdef DDRC
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRC|=0 DDRC|=0
#ifdef BitPC0 #ifdef BitPC0
|(1<<0) |(1<<0)
@ -169,11 +173,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRD #ifdef DDRD
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRD|=0 DDRD|=0
#ifdef BitPD0 #ifdef BitPD0
|(1<<0) |(1<<0)
@ -200,11 +205,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRE #ifdef DDRE
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRE|=0 DDRE|=0
#ifdef BitPE0 #ifdef BitPE0
|(1<<0) |(1<<0)
@ -231,11 +237,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRF #ifdef DDRF
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRF|=0 DDRF|=0
#ifdef BitPF0 #ifdef BitPF0
|(1<<0) |(1<<0)
@ -262,11 +269,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRG #ifdef DDRG
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRG|=0 DDRG|=0
#ifdef BitPG0 #ifdef BitPG0
|(1<<0) |(1<<0)
@ -293,11 +301,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRH #ifdef DDRH
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRH|=0 DDRH|=0
#ifdef BitPH0 #ifdef BitPH0
|(1<<0) |(1<<0)
@ -324,11 +333,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRI #ifdef DDRI
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRI|=0 DDRI|=0
#ifdef BitPI0 #ifdef BitPI0
|(1<<0) |(1<<0)
@ -355,11 +365,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRJ #ifdef DDRJ
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRJ|=0 DDRJ|=0
#ifdef BitPJ0 #ifdef BitPJ0
|(1<<0) |(1<<0)
@ -386,11 +397,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRK #ifdef DDRK
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRK|=0 DDRK|=0
#ifdef BitPK0 #ifdef BitPK0
|(1<<0) |(1<<0)
@ -417,11 +429,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRL #ifdef DDRL
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRL|=0 DDRL|=0
#ifdef BitPL0 #ifdef BitPL0
|(1<<0) |(1<<0)
@ -448,11 +461,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRM #ifdef DDRM
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRM|=0 DDRM|=0
#ifdef BitPM0 #ifdef BitPM0
|(1<<0) |(1<<0)
@ -479,11 +493,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRN #ifdef DDRN
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRN|=0 DDRN|=0
#ifdef BitPN0 #ifdef BitPN0
|(1<<0) |(1<<0)
@ -510,11 +525,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRO #ifdef DDRO
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRO|=0 DDRO|=0
#ifdef BitPO0 #ifdef BitPO0
|(1<<0) |(1<<0)
@ -541,11 +557,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRP #ifdef DDRP
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRP|=0 DDRP|=0
#ifdef BitPP0 #ifdef BitPP0
|(1<<0) |(1<<0)
@ -572,11 +589,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRQ #ifdef DDRQ
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRQ|=0 DDRQ|=0
#ifdef BitPQ0 #ifdef BitPQ0
|(1<<0) |(1<<0)
@ -603,11 +621,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRR #ifdef DDRR
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRR|=0 DDRR|=0
#ifdef BitPR0 #ifdef BitPR0
|(1<<0) |(1<<0)
@ -634,11 +653,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRS #ifdef DDRS
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRS|=0 DDRS|=0
#ifdef BitPS0 #ifdef BitPS0
|(1<<0) |(1<<0)
@ -665,11 +685,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRT #ifdef DDRT
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRT|=0 DDRT|=0
#ifdef BitPT0 #ifdef BitPT0
|(1<<0) |(1<<0)
@ -696,11 +717,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRU #ifdef DDRU
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRU|=0 DDRU|=0
#ifdef BitPU0 #ifdef BitPU0
|(1<<0) |(1<<0)
@ -727,11 +749,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRV #ifdef DDRV
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRV|=0 DDRV|=0
#ifdef BitPV0 #ifdef BitPV0
|(1<<0) |(1<<0)
@ -758,11 +781,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRW #ifdef DDRW
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRW|=0 DDRW|=0
#ifdef BitPW0 #ifdef BitPW0
|(1<<0) |(1<<0)
@ -789,11 +813,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRX #ifdef DDRX
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRX|=0 DDRX|=0
#ifdef BitPX0 #ifdef BitPX0
|(1<<0) |(1<<0)
@ -820,11 +845,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRY #ifdef DDRY
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRY|=0 DDRY|=0
#ifdef BitPY0 #ifdef BitPY0
|(1<<0) |(1<<0)
@ -851,11 +877,12 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
#ifdef DDRZ #ifdef DDRZ
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
DDRZ|=0 DDRZ|=0
#ifdef BitPZ0 #ifdef BitPZ0
|(1<<0) |(1<<0)
@ -882,15 +909,14 @@ void ioHelperIoConf(void) {
|(1<<7) |(1<<7)
#endif #endif
|0; |0;
}
#endif #endif
} }
void ioHelperSetOuts(void) { void ioHelperSetOuts(void) {
#ifdef PORTA #ifdef PORTA
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTA|=0 PORTA|=0
#ifdef BitPA0 #ifdef BitPA0
|(getBit1(BitPA0)<<0) |(getBit1(BitPA0)<<0)
@ -917,7 +943,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPA7)<<7) |(getBit1(BitPA7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTA&=~(0 PORTA&=~(0
#ifdef BitPA0 #ifdef BitPA0
|(getBit0(BitPA0)<<0) |(getBit0(BitPA0)<<0)
@ -944,11 +972,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPA7)<<7) |(getBit0(BitPA7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTB #ifdef PORTB
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTB|=0 PORTB|=0
#ifdef BitPB0 #ifdef BitPB0
|(getBit1(BitPB0)<<0) |(getBit1(BitPB0)<<0)
@ -975,7 +1005,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPB7)<<7) |(getBit1(BitPB7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTB&=~(0 PORTB&=~(0
#ifdef BitPB0 #ifdef BitPB0
|(getBit0(BitPB0)<<0) |(getBit0(BitPB0)<<0)
@ -1002,11 +1034,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPB7)<<7) |(getBit0(BitPB7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTC #ifdef PORTC
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTC|=0 PORTC|=0
#ifdef BitPC0 #ifdef BitPC0
|(getBit1(BitPC0)<<0) |(getBit1(BitPC0)<<0)
@ -1033,7 +1067,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPC7)<<7) |(getBit1(BitPC7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTC&=~(0 PORTC&=~(0
#ifdef BitPC0 #ifdef BitPC0
|(getBit0(BitPC0)<<0) |(getBit0(BitPC0)<<0)
@ -1060,11 +1096,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPC7)<<7) |(getBit0(BitPC7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTD #ifdef PORTD
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTD|=0 PORTD|=0
#ifdef BitPD0 #ifdef BitPD0
|(getBit1(BitPD0)<<0) |(getBit1(BitPD0)<<0)
@ -1091,7 +1129,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPD7)<<7) |(getBit1(BitPD7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTD&=~(0 PORTD&=~(0
#ifdef BitPD0 #ifdef BitPD0
|(getBit0(BitPD0)<<0) |(getBit0(BitPD0)<<0)
@ -1118,11 +1158,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPD7)<<7) |(getBit0(BitPD7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTE #ifdef PORTE
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTE|=0 PORTE|=0
#ifdef BitPE0 #ifdef BitPE0
|(getBit1(BitPE0)<<0) |(getBit1(BitPE0)<<0)
@ -1149,7 +1191,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPE7)<<7) |(getBit1(BitPE7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTE&=~(0 PORTE&=~(0
#ifdef BitPE0 #ifdef BitPE0
|(getBit0(BitPE0)<<0) |(getBit0(BitPE0)<<0)
@ -1176,11 +1220,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPE7)<<7) |(getBit0(BitPE7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTF #ifdef PORTF
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTF|=0 PORTF|=0
#ifdef BitPF0 #ifdef BitPF0
|(getBit1(BitPF0)<<0) |(getBit1(BitPF0)<<0)
@ -1207,7 +1253,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPF7)<<7) |(getBit1(BitPF7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTF&=~(0 PORTF&=~(0
#ifdef BitPF0 #ifdef BitPF0
|(getBit0(BitPF0)<<0) |(getBit0(BitPF0)<<0)
@ -1234,11 +1282,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPF7)<<7) |(getBit0(BitPF7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTG #ifdef PORTG
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTG|=0 PORTG|=0
#ifdef BitPG0 #ifdef BitPG0
|(getBit1(BitPG0)<<0) |(getBit1(BitPG0)<<0)
@ -1265,7 +1315,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPG7)<<7) |(getBit1(BitPG7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTG&=~(0 PORTG&=~(0
#ifdef BitPG0 #ifdef BitPG0
|(getBit0(BitPG0)<<0) |(getBit0(BitPG0)<<0)
@ -1292,11 +1344,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPG7)<<7) |(getBit0(BitPG7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTH #ifdef PORTH
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTH|=0 PORTH|=0
#ifdef BitPH0 #ifdef BitPH0
|(getBit1(BitPH0)<<0) |(getBit1(BitPH0)<<0)
@ -1323,7 +1377,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPH7)<<7) |(getBit1(BitPH7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTH&=~(0 PORTH&=~(0
#ifdef BitPH0 #ifdef BitPH0
|(getBit0(BitPH0)<<0) |(getBit0(BitPH0)<<0)
@ -1350,11 +1406,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPH7)<<7) |(getBit0(BitPH7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTI #ifdef PORTI
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTI|=0 PORTI|=0
#ifdef BitPI0 #ifdef BitPI0
|(getBit1(BitPI0)<<0) |(getBit1(BitPI0)<<0)
@ -1381,7 +1439,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPI7)<<7) |(getBit1(BitPI7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTI&=~(0 PORTI&=~(0
#ifdef BitPI0 #ifdef BitPI0
|(getBit0(BitPI0)<<0) |(getBit0(BitPI0)<<0)
@ -1408,11 +1468,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPI7)<<7) |(getBit0(BitPI7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTJ #ifdef PORTJ
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTJ|=0 PORTJ|=0
#ifdef BitPJ0 #ifdef BitPJ0
|(getBit1(BitPJ0)<<0) |(getBit1(BitPJ0)<<0)
@ -1439,7 +1501,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPJ7)<<7) |(getBit1(BitPJ7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTJ&=~(0 PORTJ&=~(0
#ifdef BitPJ0 #ifdef BitPJ0
|(getBit0(BitPJ0)<<0) |(getBit0(BitPJ0)<<0)
@ -1466,11 +1530,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPJ7)<<7) |(getBit0(BitPJ7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTK #ifdef PORTK
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTK|=0 PORTK|=0
#ifdef BitPK0 #ifdef BitPK0
|(getBit1(BitPK0)<<0) |(getBit1(BitPK0)<<0)
@ -1497,7 +1563,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPK7)<<7) |(getBit1(BitPK7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTK&=~(0 PORTK&=~(0
#ifdef BitPK0 #ifdef BitPK0
|(getBit0(BitPK0)<<0) |(getBit0(BitPK0)<<0)
@ -1524,11 +1592,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPK7)<<7) |(getBit0(BitPK7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTL #ifdef PORTL
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTL|=0 PORTL|=0
#ifdef BitPL0 #ifdef BitPL0
|(getBit1(BitPL0)<<0) |(getBit1(BitPL0)<<0)
@ -1555,7 +1625,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPL7)<<7) |(getBit1(BitPL7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTL&=~(0 PORTL&=~(0
#ifdef BitPL0 #ifdef BitPL0
|(getBit0(BitPL0)<<0) |(getBit0(BitPL0)<<0)
@ -1582,11 +1654,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPL7)<<7) |(getBit0(BitPL7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTM #ifdef PORTM
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTM|=0 PORTM|=0
#ifdef BitPM0 #ifdef BitPM0
|(getBit1(BitPM0)<<0) |(getBit1(BitPM0)<<0)
@ -1613,7 +1687,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPM7)<<7) |(getBit1(BitPM7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTM&=~(0 PORTM&=~(0
#ifdef BitPM0 #ifdef BitPM0
|(getBit0(BitPM0)<<0) |(getBit0(BitPM0)<<0)
@ -1640,11 +1716,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPM7)<<7) |(getBit0(BitPM7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTN #ifdef PORTN
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTN|=0 PORTN|=0
#ifdef BitPN0 #ifdef BitPN0
|(getBit1(BitPN0)<<0) |(getBit1(BitPN0)<<0)
@ -1671,7 +1749,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPN7)<<7) |(getBit1(BitPN7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTN&=~(0 PORTN&=~(0
#ifdef BitPN0 #ifdef BitPN0
|(getBit0(BitPN0)<<0) |(getBit0(BitPN0)<<0)
@ -1698,11 +1778,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPN7)<<7) |(getBit0(BitPN7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTO #ifdef PORTO
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTO|=0 PORTO|=0
#ifdef BitPO0 #ifdef BitPO0
|(getBit1(BitPO0)<<0) |(getBit1(BitPO0)<<0)
@ -1729,7 +1811,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPO7)<<7) |(getBit1(BitPO7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTO&=~(0 PORTO&=~(0
#ifdef BitPO0 #ifdef BitPO0
|(getBit0(BitPO0)<<0) |(getBit0(BitPO0)<<0)
@ -1756,11 +1840,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPO7)<<7) |(getBit0(BitPO7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTP #ifdef PORTP
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTP|=0 PORTP|=0
#ifdef BitPP0 #ifdef BitPP0
|(getBit1(BitPP0)<<0) |(getBit1(BitPP0)<<0)
@ -1787,7 +1873,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPP7)<<7) |(getBit1(BitPP7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTP&=~(0 PORTP&=~(0
#ifdef BitPP0 #ifdef BitPP0
|(getBit0(BitPP0)<<0) |(getBit0(BitPP0)<<0)
@ -1814,11 +1902,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPP7)<<7) |(getBit0(BitPP7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTQ #ifdef PORTQ
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTQ|=0 PORTQ|=0
#ifdef BitPQ0 #ifdef BitPQ0
|(getBit1(BitPQ0)<<0) |(getBit1(BitPQ0)<<0)
@ -1845,7 +1935,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPQ7)<<7) |(getBit1(BitPQ7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTQ&=~(0 PORTQ&=~(0
#ifdef BitPQ0 #ifdef BitPQ0
|(getBit0(BitPQ0)<<0) |(getBit0(BitPQ0)<<0)
@ -1872,11 +1964,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPQ7)<<7) |(getBit0(BitPQ7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTR #ifdef PORTR
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTR|=0 PORTR|=0
#ifdef BitPR0 #ifdef BitPR0
|(getBit1(BitPR0)<<0) |(getBit1(BitPR0)<<0)
@ -1903,7 +1997,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPR7)<<7) |(getBit1(BitPR7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTR&=~(0 PORTR&=~(0
#ifdef BitPR0 #ifdef BitPR0
|(getBit0(BitPR0)<<0) |(getBit0(BitPR0)<<0)
@ -1930,11 +2026,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPR7)<<7) |(getBit0(BitPR7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTS #ifdef PORTS
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTS|=0 PORTS|=0
#ifdef BitPS0 #ifdef BitPS0
|(getBit1(BitPS0)<<0) |(getBit1(BitPS0)<<0)
@ -1961,7 +2059,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPS7)<<7) |(getBit1(BitPS7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTS&=~(0 PORTS&=~(0
#ifdef BitPS0 #ifdef BitPS0
|(getBit0(BitPS0)<<0) |(getBit0(BitPS0)<<0)
@ -1988,11 +2088,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPS7)<<7) |(getBit0(BitPS7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTT #ifdef PORTT
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTT|=0 PORTT|=0
#ifdef BitPT0 #ifdef BitPT0
|(getBit1(BitPT0)<<0) |(getBit1(BitPT0)<<0)
@ -2019,7 +2121,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPT7)<<7) |(getBit1(BitPT7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTT&=~(0 PORTT&=~(0
#ifdef BitPT0 #ifdef BitPT0
|(getBit0(BitPT0)<<0) |(getBit0(BitPT0)<<0)
@ -2046,11 +2150,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPT7)<<7) |(getBit0(BitPT7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTU #ifdef PORTU
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTU|=0 PORTU|=0
#ifdef BitPU0 #ifdef BitPU0
|(getBit1(BitPU0)<<0) |(getBit1(BitPU0)<<0)
@ -2077,7 +2183,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPU7)<<7) |(getBit1(BitPU7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTU&=~(0 PORTU&=~(0
#ifdef BitPU0 #ifdef BitPU0
|(getBit0(BitPU0)<<0) |(getBit0(BitPU0)<<0)
@ -2104,11 +2212,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPU7)<<7) |(getBit0(BitPU7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTV #ifdef PORTV
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTV|=0 PORTV|=0
#ifdef BitPV0 #ifdef BitPV0
|(getBit1(BitPV0)<<0) |(getBit1(BitPV0)<<0)
@ -2135,7 +2245,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPV7)<<7) |(getBit1(BitPV7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTV&=~(0 PORTV&=~(0
#ifdef BitPV0 #ifdef BitPV0
|(getBit0(BitPV0)<<0) |(getBit0(BitPV0)<<0)
@ -2162,11 +2274,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPV7)<<7) |(getBit0(BitPV7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTW #ifdef PORTW
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTW|=0 PORTW|=0
#ifdef BitPW0 #ifdef BitPW0
|(getBit1(BitPW0)<<0) |(getBit1(BitPW0)<<0)
@ -2193,7 +2307,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPW7)<<7) |(getBit1(BitPW7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTW&=~(0 PORTW&=~(0
#ifdef BitPW0 #ifdef BitPW0
|(getBit0(BitPW0)<<0) |(getBit0(BitPW0)<<0)
@ -2220,11 +2336,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPW7)<<7) |(getBit0(BitPW7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTX #ifdef PORTX
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTX|=0 PORTX|=0
#ifdef BitPX0 #ifdef BitPX0
|(getBit1(BitPX0)<<0) |(getBit1(BitPX0)<<0)
@ -2251,7 +2369,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPX7)<<7) |(getBit1(BitPX7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTX&=~(0 PORTX&=~(0
#ifdef BitPX0 #ifdef BitPX0
|(getBit0(BitPX0)<<0) |(getBit0(BitPX0)<<0)
@ -2278,11 +2398,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPX7)<<7) |(getBit0(BitPX7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTY #ifdef PORTY
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTY|=0 PORTY|=0
#ifdef BitPY0 #ifdef BitPY0
|(getBit1(BitPY0)<<0) |(getBit1(BitPY0)<<0)
@ -2309,7 +2431,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPY7)<<7) |(getBit1(BitPY7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTY&=~(0 PORTY&=~(0
#ifdef BitPY0 #ifdef BitPY0
|(getBit0(BitPY0)<<0) |(getBit0(BitPY0)<<0)
@ -2336,11 +2460,13 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPY7)<<7) |(getBit0(BitPY7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
#ifdef PORTZ #ifdef PORTZ
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTZ|=0 PORTZ|=0
#ifdef BitPZ0 #ifdef BitPZ0
|(getBit1(BitPZ0)<<0) |(getBit1(BitPZ0)<<0)
@ -2367,7 +2493,9 @@ void ioHelperSetOuts(void) {
|(getBit1(BitPZ7)<<7) |(getBit1(BitPZ7)<<7)
#endif #endif
|0; |0;
}
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
PORTZ&=~(0 PORTZ&=~(0
#ifdef BitPZ0 #ifdef BitPZ0
|(getBit0(BitPZ0)<<0) |(getBit0(BitPZ0)<<0)
@ -2394,10 +2522,10 @@ void ioHelperSetOuts(void) {
|(getBit0(BitPZ7)<<7) |(getBit0(BitPZ7)<<7)
#endif #endif
|0); |0);
}
#endif #endif
} }

Loading…
Cancel
Save