File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 85
85
#define SS_BIT 0
86
86
#define SS_PIN PINB
87
87
88
+ #define TOGGLE (p ) p ## _PORT = (p ## _PORT ^ (1 << p ## _BIT))
88
89
#define SET (p , v ) p ## _PORT = (p ## _PORT & ~(1 << p ## _BIT)) | (v << p ## _BIT)
89
90
#define VALUE (p ) (p ## _PIN & (1 << p ## _BIT))
90
91
#define OUT (p ) p ## _DDR |= (1 << p ## _BIT)
Original file line number Diff line number Diff line change @@ -419,7 +419,7 @@ void uartTask() {
419
419
}
420
420
421
421
if (RingBuffer_GetCount (&serialBuffer) < 1000 ) {
422
- SET (TX_BUSY, LOW ); // re-enable the serial port
422
+ TOGGLE (TX_BUSY); // re-enable the serial port
423
423
serialRXEnable ();
424
424
}
425
425
@@ -437,11 +437,12 @@ ISR(USART1_RX_vect) { // new serial data!
437
437
serialBuffer.In = serialBuffer.Start ;
438
438
439
439
serialBuffer.Count ++;
440
-
440
+
441
441
if (serialBuffer.Count >= 1000 ) { // are we almost out of space?
442
- SET (TX_BUSY, HIGH); // signal we can't take any more
443
442
if (serialBuffer.Count > 1020 )
444
443
serialRXDisable (); // if our flag is ignored disable the serial port so it doesn't clog things up
444
+ } else {
445
+ TOGGLE (TX_BUSY);
445
446
}
446
447
}
447
448
@@ -458,3 +459,4 @@ ISR(USART1_RX_vect) { // new serial data!
458
459
459
460
460
461
462
+
You can’t perform that action at this time.
0 commit comments