Browse Source

General cleanup, style

Scott Lahteine 4 years ago
parent
commit
7cd72de8bc
3 changed files with 28 additions and 36 deletions
  1. 3
    12
      Marlin/src/HAL/HAL_AVR/pinsDebug.h
  2. 1
    1
      Marlin/src/HAL/HAL_LINUX/arduino.cpp
  3. 24
    23
      Marlin/src/lcd/menu/menu.h

+ 3
- 12
Marlin/src/HAL/HAL_AVR/pinsDebug.h View File

@@ -227,18 +227,9 @@ static void print_is_also_tied() { SERIAL_ECHOPGM(" is also tied to this pin");
227 227
 void com_print(uint8_t N, uint8_t Z) {
228 228
   const uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
229 229
   SERIAL_ECHOPGM("    COM");
230
-  SERIAL_CHAR(N + '0');
231
-  switch (Z) {
232
-    case 'A':
233
-      SERIAL_ECHOPAIR("A: ", ((*TCCRA & (_BV(7) | _BV(6))) >> 6));
234
-      break;
235
-    case 'B':
236
-      SERIAL_ECHOPAIR("B: ", ((*TCCRA & (_BV(5) | _BV(4))) >> 4));
237
-      break;
238
-    case 'C':
239
-      SERIAL_ECHOPAIR("C: ", ((*TCCRA & (_BV(3) | _BV(2))) >> 2));
240
-      break;
241
-  }
230
+  SERIAL_CHAR('0' + N);
231
+  SERIAL_CHAR('A' + Z);
232
+  SERIAL_ECHOPAIR(": ", int((*TCCRA >> (6 - Z * 2)) & 0x03));
242 233
 }
243 234
 
244 235
 void timer_prefix(uint8_t T, char L, uint8_t N) {  // T - timer    L - pwm  N - WGM bit layout

+ 1
- 1
Marlin/src/HAL/HAL_LINUX/arduino.cpp View File

@@ -29,7 +29,7 @@
29 29
 
30 30
 // Interrupts
31 31
 void cli() { } // Disable
32
-void sei() { }  // Enable
32
+void sei() { } // Enable
33 33
 
34 34
 // Time functions
35 35
 void _delay_ms(const int delay_ms) {

+ 24
- 23
Marlin/src/lcd/menu/menu.h View File

@@ -308,33 +308,34 @@ class MenuItem_bool {
308 308
  *     MenuItem_int3::action_edit(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
309 309
  *
310 310
  */
311
-#define _MENU_ITEM_VARIANT_P(TYPE, VARIANT, USE_MULTIPLIER, PLABEL, V...) do { \
312
-    _skipStatic = false; \
313
-    if (_menuLineNr == _thisItemNr) { \
314
-      PGM_P const plabel = PLABEL; \
315
-      if (encoderLine == _thisItemNr && ui.use_click()) { \
316
-        _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \
317
-        MenuItem_##TYPE ::action ## VARIANT(plabel, ##V); \
318
-        if (screen_changed) return; \
319
-      } \
320
-      if (ui.should_draw()) \
321
-        draw_menu_item ## VARIANT ## _ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, plabel, ##V); \
322
-    } \
323
-  ++_thisItemNr; \
311
+#define _MENU_ITEM_VARIANT_P(TYPE, VARIANT, USE_MULTIPLIER, PLABEL, V...) do {  \
312
+    _skipStatic = false;                                          \
313
+    if (_menuLineNr == _thisItemNr) {                             \
314
+      PGM_P const plabel = PLABEL;                                \
315
+      if (encoderLine == _thisItemNr && ui.use_click()) {         \
316
+        _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER);              \
317
+        MenuItem_##TYPE ::action ## VARIANT(plabel, ##V);         \
318
+        if (screen_changed) return;                               \
319
+      }                                                           \
320
+      if (ui.should_draw())                                       \
321
+        draw_menu_item ## VARIANT ## _ ## TYPE                    \
322
+          (encoderLine == _thisItemNr, _lcdLineNr, plabel, ##V);  \
323
+    }                                                             \
324
+  ++_thisItemNr;                                                  \
324 325
 }while(0)
325 326
 
326 327
 // Used to print static text with no visible cursor.
327 328
 // Parameters: label [, bool center [, bool invert [, char *value] ] ]
328
-#define STATIC_ITEM_P(PLABEL, V...) do{ \
329
-  if (_menuLineNr == _thisItemNr) { \
330
-    if (_skipStatic && encoderLine <= _thisItemNr) { \
331
-      ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
332
-      ++encoderLine; \
333
-    } \
334
-    if (ui.should_draw()) \
335
-      draw_menu_item_static(_lcdLineNr, PLABEL, ##V); \
336
-  } \
337
-  ++_thisItemNr; \
329
+#define STATIC_ITEM_P(PLABEL, V...) do{                   \
330
+  if (_menuLineNr == _thisItemNr) {                       \
331
+    if (_skipStatic && encoderLine <= _thisItemNr) {      \
332
+      ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM;  \
333
+      ++encoderLine;                                      \
334
+    }                                                     \
335
+    if (ui.should_draw())                                 \
336
+      draw_menu_item_static(_lcdLineNr, PLABEL, ##V);     \
337
+  }                                                       \
338
+  ++_thisItemNr;                                          \
338 339
 } while(0)
339 340
 
340 341
 #define MENU_ITEM_ADDON_START(X) do{ \

Loading…
Cancel
Save