mirror of
https://github.com/quorten/macsehw.git
synced 2024-05-29 05:41:34 +00:00
Strip down to the bare minimum interrupt disables.
This will hopefully prevent potential issues of not being able to update the 1-second counter correctly.
This commit is contained in:
parent
76760be8e6
commit
bb3bc8bc62
|
@ -113,12 +113,10 @@ volatile byte writeProtect = 0;
|
||||||
|
|
||||||
void digitalWritePB(uint8_t pin, uint8_t val) {
|
void digitalWritePB(uint8_t pin, uint8_t val) {
|
||||||
uint8_t bit = _BV(pin);
|
uint8_t bit = _BV(pin);
|
||||||
cli();
|
|
||||||
if (val == 0)
|
if (val == 0)
|
||||||
PORTB &= ~bit;
|
PORTB &= ~bit;
|
||||||
else
|
else
|
||||||
PORTB |= bit;
|
PORTB |= bit;
|
||||||
sei();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup(void) {
|
void setup(void) {
|
||||||
|
@ -336,9 +334,7 @@ void loop(void) {
|
||||||
serialState = SENDING_DATA;
|
serialState = SENDING_DATA;
|
||||||
serialBitNum = 0;
|
serialBitNum = 0;
|
||||||
// Set the pin to output mode
|
// Set the pin to output mode
|
||||||
cli();
|
|
||||||
DDRB |= SERIAL_DATA_PIN;
|
DDRB |= SERIAL_DATA_PIN;
|
||||||
sei();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECEIVING_DATA:
|
case RECEIVING_DATA:
|
||||||
|
@ -415,9 +411,7 @@ void loop(void) {
|
||||||
serialState = SENDING_DATA;
|
serialState = SENDING_DATA;
|
||||||
serialBitNum = 0;
|
serialBitNum = 0;
|
||||||
// Set the pin to output mode
|
// Set the pin to output mode
|
||||||
cli();
|
|
||||||
DDRB |= SERIAL_DATA_PIN;
|
DDRB |= SERIAL_DATA_PIN;
|
||||||
sei();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECEIVING_XCMD_DATA:
|
case RECEIVING_XCMD_DATA:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user