File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -132,9 +132,9 @@ class UART : public arduino::HardwareSerial {
132
132
volatile bool _begin;
133
133
134
134
private:
135
- inline void inc (int &x,int _max) { x = ++x % _max; }
135
+ inline void inc (volatile int &x,int _max) { x = ++x % _max; }
136
136
inline int previous (int x, int _max) { return ((--x) >= 0 ) ? x : _max -1 ; }
137
-
137
+
138
138
int channel;
139
139
TxStatus_t tx_st;
140
140
void set_tx_status (TxStatus_t st) { tx_st = st; }
@@ -151,8 +151,8 @@ class UART : public arduino::HardwareSerial {
151
151
uint8_t rx_buffer[SERIAL_RX_BUFFER_SIZE];
152
152
/* tx STUFF.... */
153
153
uint8_t tx_buffer[SERIAL_TX_BUFFER_SIZE];
154
- int tx_head_index = -1 ;
155
- int tx_tail_index = -1 ;
154
+ volatile int tx_head_index = -1 ;
155
+ volatile int tx_tail_index = -1 ;
156
156
int get_tx_head_index () { return tx_head_index; }
157
157
int get_tx_tail_index () { return tx_tail_index; }
158
158
void inc_tx_head_index () { inc (tx_head_index,SERIAL_TX_BUFFER_SIZE); }
You can’t perform that action at this time.
0 commit comments