Explorar el Código

Cleanups for UBL / ultralcd.cpp

Scott Lahteine hace 7 años
padre
commit
d9da126776
Se han modificado 3 ficheros con 25 adiciones y 25 borrados
  1. 2
    2
      Marlin/ubl_G29.cpp
  2. 22
    22
      Marlin/ultralcd.cpp
  3. 1
    1
      Marlin/ultralcd_impl_HD44780.h

+ 2
- 2
Marlin/ubl_G29.cpp Ver fichero

@@ -45,7 +45,7 @@
45 45
     void lcd_mesh_edit_setup(float initial);
46 46
     float lcd_mesh_edit();
47 47
     void lcd_z_offset_edit_setup(float);
48
-    #ifdef DOGLCD
48
+    #if ENABLED(DOGLCD)
49 49
       extern void _lcd_ubl_output_map_lcd();
50 50
     #endif
51 51
     float lcd_z_offset_edit();
@@ -1575,7 +1575,7 @@
1575 1575
       SERIAL_ECHOLNPGM("Done Editing Mesh");
1576 1576
 
1577 1577
       if (ubl_lcd_map_control) {
1578
-        #ifdef DOGLCD
1578
+        #if ENABLED(DOGLCD)
1579 1579
         lcd_goto_screen(_lcd_ubl_output_map_lcd);
1580 1580
         #endif
1581 1581
       }

+ 22
- 22
Marlin/ultralcd.cpp Ver fichero

@@ -257,7 +257,7 @@ uint16_t max_display_update_time = 0;
257 257
       _skipStatic = false; \
258 258
       _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \
259 259
       _MENU_ITEM_PART_2(TYPE, LABEL, ## __VA_ARGS__); \
260
-    } while(0)
260
+    }while(0)
261 261
 
262 262
   #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0)
263 263
 
@@ -289,13 +289,13 @@ uint16_t max_display_update_time = 0;
289 289
         encoderRateMultiplierEnabled = true; \
290 290
         lastEncoderMovementMillis = 0; \
291 291
         _MENU_ITEM_PART_2(type, label, ## __VA_ARGS__); \
292
-      } while(0)
292
+      }while(0)
293 293
 
294 294
   #else // !ENCODER_RATE_MULTIPLIER
295 295
     #define ENCODER_RATE_MULTIPLY(F) NOOP
296 296
   #endif // !ENCODER_RATE_MULTIPLIER
297 297
 
298
-  #define MENU_ITEM_DUMMY() do { _thisItemNr++; } while(0)
298
+  #define MENU_ITEM_DUMMY() do { _thisItemNr++; }while(0)
299 299
   #define MENU_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__)
300 300
   #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)
301 301
   #if ENABLED(ENCODER_RATE_MULTIPLIER)
@@ -2075,19 +2075,19 @@ void kill_screen(const char* lcd_msg) {
2075 2075
       enqueue_and_echo_command(ubl_lcd_gcode);
2076 2076
     }
2077 2077
 
2078
-  #ifdef DOGLCD
2078
+  #if ENABLED(DOGLCD)
2079 2079
 
2080 2080
     /**
2081 2081
      * UBL LCD "radar" map data
2082 2082
      */
2083
-  #define MAP_UPPER_LEFT_CORNER_X 35  // These probably should be moved to the .h file  But for now,
2084
-  #define MAP_UPPER_LEFT_CORNER_Y 8  // it is easier to play with things having them here
2085
-  #define MAP_MAX_PIXELS_X        53
2086
-  #define MAP_MAX_PIXELS_Y        49
2083
+    #define MAP_UPPER_LEFT_CORNER_X 35  // These probably should be moved to the .h file  But for now,
2084
+    #define MAP_UPPER_LEFT_CORNER_Y 8   // it is easier to play with things having them here
2085
+    #define MAP_MAX_PIXELS_X        53
2086
+    #define MAP_MAX_PIXELS_Y        49
2087 2087
 
2088 2088
     void _lcd_ubl_plot_drawing_prep() {
2089
-      uint8_t i, j, x_offset, y_offset, x_map_pixels, y_map_pixels;
2090
-      uint8_t pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt, inverted_y;
2089
+      uint8_t i, j, x_offset, y_offset, x_map_pixels, y_map_pixels,
2090
+              pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt, inverted_y;
2091 2091
 
2092 2092
       /*********************************************************/
2093 2093
       /************ Scale the box pixels appropriately *********/
@@ -2098,15 +2098,15 @@ void kill_screen(const char* lcd_msg) {
2098 2098
       pixels_per_X_mesh_pnt = x_map_pixels / GRID_MAX_POINTS_X;
2099 2099
       pixels_per_Y_mesh_pnt = y_map_pixels / GRID_MAX_POINTS_Y;
2100 2100
 
2101
-      x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X-x_map_pixels-2)/2;
2102
-      y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y-y_map_pixels-2)/2;
2101
+      x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X - x_map_pixels - 2) / 2;
2102
+      y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y - y_map_pixels - 2) / 2;
2103 2103
 
2104 2104
       /*********************************************************/
2105 2105
       /************ Clear the Mesh Map Box**********************/
2106 2106
       /*********************************************************/
2107 2107
 
2108 2108
       u8g.setColorIndex(1);  // First draw the bigger box in White so we have a border around the mesh map box
2109
-      u8g.drawBox(x_offset-2, y_offset-2, x_map_pixels+4, y_map_pixels+4);
2109
+      u8g.drawBox(x_offset - 2, y_offset - 2, x_map_pixels + 4, y_map_pixels + 4);
2110 2110
 
2111 2111
       u8g.setColorIndex(0);  // Now actually clear the mesh map box
2112 2112
       u8g.drawBox(x_offset, y_offset, x_map_pixels, y_map_pixels);
@@ -2118,8 +2118,8 @@ void kill_screen(const char* lcd_msg) {
2118 2118
       u8g.setColorIndex(1);
2119 2119
       for (i = 0; i < GRID_MAX_POINTS_X; i++) {
2120 2120
         for (j = 0; j < GRID_MAX_POINTS_Y; j++) {
2121
-          u8g.drawBox(x_offset+i*pixels_per_X_mesh_pnt+pixels_per_X_mesh_pnt/2,  
2122
-                      y_offset+j*pixels_per_Y_mesh_pnt+pixels_per_Y_mesh_pnt/2, 1, 1);
2121
+          u8g.drawBox(x_offset + i * pixels_per_X_mesh_pnt + pixels_per_X_mesh_pnt / 2,
2122
+                      y_offset + j * pixels_per_Y_mesh_pnt + pixels_per_Y_mesh_pnt / 2, 1, 1);
2123 2123
         }
2124 2124
       }
2125 2125
 
@@ -2127,9 +2127,9 @@ void kill_screen(const char* lcd_msg) {
2127 2127
       /************ Fill in the Specified Mesh Point ***********/
2128 2128
       /*********************************************************/
2129 2129
 
2130
-      inverted_y = GRID_MAX_POINTS_Y - y_plot - 1;    // The origin is typically in the lower right corner.  We need to 
2130
+      inverted_y = GRID_MAX_POINTS_Y - y_plot - 1;    // The origin is typically in the lower right corner.  We need to
2131 2131
                                                       // invert the Y to get it to plot in the right location.
2132
-      u8g.drawBox(x_offset+x_plot*pixels_per_X_mesh_pnt, y_offset+inverted_y*pixels_per_Y_mesh_pnt, 
2132
+      u8g.drawBox(x_offset + x_plot * pixels_per_X_mesh_pnt, y_offset + inverted_y * pixels_per_Y_mesh_pnt,
2133 2133
                     pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt);
2134 2134
 
2135 2135
       /*********************************************************/
@@ -2147,11 +2147,11 @@ void kill_screen(const char* lcd_msg) {
2147 2147
 
2148 2148
       // Print plot position
2149 2149
       u8g.setPrintPos(5, 64);
2150
-      lcd_print("(");
2150
+      lcd_print('(');
2151 2151
       u8g.print(x_plot);
2152
-      lcd_print(",");
2152
+      lcd_print(',');
2153 2153
       u8g.print(y_plot);
2154
-      lcd_print(")");
2154
+      lcd_print(')');
2155 2155
 
2156 2156
       // Show the location value
2157 2157
       u8g.setPrintPos(74, 64);
@@ -2262,7 +2262,7 @@ void kill_screen(const char* lcd_msg) {
2262 2262
     void _lcd_ubl_output_map_lcd_cmd() {
2263 2263
       if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]))
2264 2264
         enqueue_and_echo_commands_P(PSTR("G28"));
2265
-      lcd_goto_screen(_lcd_ubl_map_homing);     
2265
+      lcd_goto_screen(_lcd_ubl_map_homing);
2266 2266
     }
2267 2267
 
2268 2268
     /**
@@ -3624,7 +3624,7 @@ void kill_screen(const char* lcd_msg) {
3624 3624
         lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \
3625 3625
       } \
3626 3626
       ++_thisItemNr; \
3627
-    } while(0)
3627
+    }while(0)
3628 3628
 
3629 3629
     void lcd_advanced_pause_toocold_menu() {
3630 3630
       START_MENU();

+ 1
- 1
Marlin/ultralcd_impl_HD44780.h Ver fichero

@@ -1012,7 +1012,7 @@ static void lcd_implementation_status_screen() {
1012 1012
 
1013 1013
   #endif // SDSUPPORT
1014 1014
 
1015
-  #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_UPLEVEL_CHAR,LCD_UPLEVEL_CHAR)
1015
+  #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_UPLEVEL_CHAR, LCD_UPLEVEL_CHAR)
1016 1016
   #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
1017 1017
   #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
1018 1018
   #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')

Loading…
Cancelar
Guardar