@@ -125,8 +125,8 @@ uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 };
125
125
#define SIG_DELAY () DELAY_US(1 ) // Approximate a 1µs delay on 32-bit ARM
126
126
#undef CRITICAL_SECTION_START
127
127
#undef CRITICAL_SECTION_END
128
- #define CRITICAL_SECTION_START NOOP
129
- #define CRITICAL_SECTION_END NOOP
128
+ #define CRITICAL_SECTION_START () NOOP
129
+ #define CRITICAL_SECTION_END () NOOP
130
130
#else
131
131
#define SIG_DELAY () DELAY_NS(188 ) // Delay for 0.1875µs (16MHz AVR) or 0.15µs (20MHz AVR)
132
132
#endif
@@ -163,7 +163,7 @@ inline uint32_t flipped(const uint32_t bits, const uint8_t n_bytes) {
163
163
}
164
164
165
165
void Max7219::noop () {
166
- CRITICAL_SECTION_START;
166
+ CRITICAL_SECTION_START () ;
167
167
SIG_DELAY ();
168
168
WRITE (MAX7219_DIN_PIN, LOW);
169
169
for (uint8_t i = 16 ; i--;) {
@@ -174,11 +174,11 @@ void Max7219::noop() {
174
174
WRITE (MAX7219_CLK_PIN, HIGH);
175
175
SIG_DELAY ();
176
176
}
177
- CRITICAL_SECTION_END;
177
+ CRITICAL_SECTION_END () ;
178
178
}
179
179
180
180
void Max7219::putbyte (uint8_t data) {
181
- CRITICAL_SECTION_START;
181
+ CRITICAL_SECTION_START () ;
182
182
for (uint8_t i = 8 ; i--;) {
183
183
SIG_DELAY ();
184
184
WRITE (MAX7219_CLK_PIN, LOW); // tick
@@ -189,7 +189,7 @@ void Max7219::putbyte(uint8_t data) {
189
189
SIG_DELAY ();
190
190
data <<= 1 ;
191
191
}
192
- CRITICAL_SECTION_END;
192
+ CRITICAL_SECTION_END () ;
193
193
}
194
194
195
195
void Max7219::pulse_load () {
@@ -202,12 +202,12 @@ void Max7219::pulse_load() {
202
202
203
203
void Max7219::send (const uint8_t reg, const uint8_t data) {
204
204
SIG_DELAY ();
205
- CRITICAL_SECTION_START;
205
+ CRITICAL_SECTION_START () ;
206
206
SIG_DELAY ();
207
207
putbyte (reg); // specify register
208
208
SIG_DELAY ();
209
209
putbyte (data); // put data
210
- CRITICAL_SECTION_END;
210
+ CRITICAL_SECTION_END () ;
211
211
}
212
212
213
213
// Send out a single native row of bits to just one unit
@@ -574,14 +574,14 @@ void Max7219::idle_tasks() {
574
574
#define MAX7219_USE_HEAD (defined(MAX7219_DEBUG_PLANNER_HEAD) || defined(MAX7219_DEBUG_PLANNER_QUEUE))
575
575
#define MAX7219_USE_TAIL (defined(MAX7219_DEBUG_PLANNER_TAIL) || defined(MAX7219_DEBUG_PLANNER_QUEUE))
576
576
#if MAX7219_USE_HEAD || MAX7219_USE_TAIL
577
- CRITICAL_SECTION_START;
577
+ CRITICAL_SECTION_START () ;
578
578
#if MAX7219_USE_HEAD
579
579
const uint8_t head = planner.block_buffer_head ;
580
580
#endif
581
581
#if MAX7219_USE_TAIL
582
582
const uint8_t tail = planner.block_buffer_tail ;
583
583
#endif
584
- CRITICAL_SECTION_END;
584
+ CRITICAL_SECTION_END () ;
585
585
#endif
586
586
587
587
#if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE)
0 commit comments