Ver código fonte

General cleanup, style

Scott Lahteine 5 anos atrás
pai
commit
7cd72de8bc

+ 3
- 12
Marlin/src/HAL/HAL_AVR/pinsDebug.h Ver arquivo

227
 void com_print(uint8_t N, uint8_t Z) {
227
 void com_print(uint8_t N, uint8_t Z) {
228
   const uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
228
   const uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
229
   SERIAL_ECHOPGM("    COM");
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
 void timer_prefix(uint8_t T, char L, uint8_t N) {  // T - timer    L - pwm  N - WGM bit layout
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 Ver arquivo

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

+ 24
- 23
Marlin/src/lcd/menu/menu.h Ver arquivo

308
  *     MenuItem_int3::action_edit(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
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
 }while(0)
325
 }while(0)
325
 
326
 
326
 // Used to print static text with no visible cursor.
327
 // Used to print static text with no visible cursor.
327
 // Parameters: label [, bool center [, bool invert [, char *value] ] ]
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
 } while(0)
339
 } while(0)
339
 
340
 
340
 #define MENU_ITEM_ADDON_START(X) do{ \
341
 #define MENU_ITEM_ADDON_START(X) do{ \

Carregando…
Cancelar
Salvar