Ver código fonte

🎨 NULL => nullptr

Scott Lahteine 3 anos atrás
pai
commit
27f5e64acf

+ 2
- 2
Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp Ver arquivo

@@ -290,13 +290,13 @@ static bool SDIO_ReadWriteBlock_DMA(uint32_t block, const uint8_t *src, uint8_t
290 290
 
291 291
 bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) {
292 292
   uint8_t retries = SDIO_READ_RETRIES;
293
-  while (retries--) if (SDIO_ReadWriteBlock_DMA(block, NULL, dst)) return true;
293
+  while (retries--) if (SDIO_ReadWriteBlock_DMA(block, nullptr, dst)) return true;
294 294
   return false;
295 295
 }
296 296
 
297 297
 bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
298 298
   uint8_t retries = SDIO_READ_RETRIES;
299
-  while (retries--) if (SDIO_ReadWriteBlock_DMA(block, src, NULL)) return true;
299
+  while (retries--) if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true;
300 300
   return false;
301 301
 }
302 302
 

+ 2
- 2
Marlin/src/HAL/STM32F1/SPI.h Ver arquivo

@@ -138,8 +138,8 @@ private:
138 138
   spi_dev *spi_d;
139 139
   dma_channel spiRxDmaChannel, spiTxDmaChannel;
140 140
   dma_dev* spiDmaDev;
141
-  void (*receiveCallback)() = NULL;
142
-  void (*transmitCallback)() = NULL;
141
+  void (*receiveCallback)() = nullptr;
142
+  void (*transmitCallback)() = nullptr;
143 143
 
144 144
   friend class SPIClass;
145 145
 };

+ 9
- 9
Marlin/src/lcd/extui/mks_ui/draw_cloud_bind.cpp Ver arquivo

@@ -33,8 +33,8 @@
33 33
 
34 34
 extern lv_group_t * g;
35 35
 static lv_obj_t * scr;
36
-static lv_obj_t *button_bind_or_not = NULL, *label_bind_or_not = NULL;
37
-static lv_obj_t *buttonReleaseBind = NULL, *label_ReleaseBind = NULL;
36
+static lv_obj_t *button_bind_or_not = nullptr, *label_bind_or_not = nullptr;
37
+static lv_obj_t *buttonReleaseBind = nullptr, *label_ReleaseBind = nullptr;
38 38
 static lv_obj_t * text_id;
39 39
 
40 40
 static uint8_t unbinding_flag = 0;
@@ -61,29 +61,29 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
61 61
 }
62 62
 
63 63
 void lv_draw_cloud_bind() {
64
-  lv_obj_t *buttonBack = NULL, *label_Back = NULL;
64
+  lv_obj_t *buttonBack = nullptr, *label_Back = nullptr;
65 65
   scr = lv_screen_create(BIND_UI);
66 66
 
67
-  button_bind_or_not = lv_btn_create(scr, NULL);
67
+  button_bind_or_not = lv_btn_create(scr, nullptr);
68 68
   lv_obj_set_pos(button_bind_or_not, TFT_WIDTH - 130, TFT_HEIGHT - 80 * 3);
69 69
   lv_obj_set_size(button_bind_or_not, PARA_UI_VALUE_BTN_X_SIZE + 15, PARA_UI_VALUE_BTN_Y_SIZE + 15);
70
-  lv_obj_set_event_cb_mks(button_bind_or_not, event_handler, ID_CLOUD_BIND_OR_NOT, NULL, 0);
70
+  lv_obj_set_event_cb_mks(button_bind_or_not, event_handler, ID_CLOUD_BIND_OR_NOT, nullptr, 0);
71 71
   lv_btn_set_style(button_bind_or_not, LV_BTN_STYLE_REL, &style_para_value);
72 72
   lv_btn_set_style(button_bind_or_not, LV_BTN_STYLE_PR, &style_para_value);
73 73
   label_bind_or_not = lv_label_create_empty(button_bind_or_not);
74 74
 
75
-  buttonReleaseBind = lv_btn_create(scr, NULL);
75
+  buttonReleaseBind = lv_btn_create(scr, nullptr);
76 76
   lv_obj_set_pos(buttonReleaseBind, TFT_WIDTH - 130, TFT_HEIGHT - 80 * 2);
77 77
   lv_obj_set_size(buttonReleaseBind, PARA_UI_VALUE_BTN_X_SIZE + 15, PARA_UI_VALUE_BTN_Y_SIZE + 15);
78
-  lv_obj_set_event_cb_mks(buttonReleaseBind, event_handler, ID_CLOUD_RELEASE_BIND, NULL, 0);
78
+  lv_obj_set_event_cb_mks(buttonReleaseBind, event_handler, ID_CLOUD_RELEASE_BIND, nullptr, 0);
79 79
   label_ReleaseBind = lv_label_create_empty(buttonReleaseBind);
80 80
   lv_label_set_text(label_ReleaseBind, cloud_menu.unbind);
81 81
   lv_obj_align(label_ReleaseBind, buttonReleaseBind, LV_ALIGN_CENTER, 0, 0);
82 82
 
83
-  buttonBack = lv_btn_create(scr, NULL);
83
+  buttonBack = lv_btn_create(scr, nullptr);
84 84
   lv_obj_set_pos(buttonBack, TFT_WIDTH - 130, TFT_HEIGHT - 80);
85 85
   lv_obj_set_size(buttonBack, PARA_UI_VALUE_BTN_X_SIZE + 15, PARA_UI_VALUE_BTN_Y_SIZE + 15);
86
-  lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_CLOUD_BIND_RETURN, NULL, 0);
86
+  lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_CLOUD_BIND_RETURN, nullptr, 0);
87 87
   lv_btn_set_style(buttonBack, LV_BTN_STYLE_REL, &style_para_back);
88 88
   lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back);
89 89
   label_Back = lv_label_create_empty(buttonBack);

+ 2
- 2
Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp Ver arquivo

@@ -431,7 +431,7 @@ void lv_draw_dialog(uint8_t type) {
431 431
     }
432 432
     else if (DIALOG_IS(TYPE_UPDATE_ESP_FIRMWARE)) {
433 433
       lv_label_set_text(labelDialog, DIALOG_UPDATE_WIFI_FIRMWARE_EN);
434
-      lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20);
434
+      lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20);
435 435
     }
436 436
   #endif // MKS_WIFI_MODULE
437 437
   else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT)) {
@@ -469,7 +469,7 @@ void lv_draw_dialog(uint8_t type) {
469 469
   #if ENABLED(MKS_WIFI_MODULE)
470 470
     else if (DIALOG_IS(TYPE_UNBIND)) {
471 471
       lv_label_set_text(labelDialog, common_menu.unbind_printer_tips);
472
-      lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -70);
472
+      lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -70);
473 473
     }
474 474
   #endif
475 475
   #if HAS_ROTARY_ENCODER

+ 3
- 3
Marlin/src/lcd/extui/mks_ui/draw_move_motor.cpp Ver arquivo

@@ -119,10 +119,10 @@ void lv_draw_move_motor() {
119 119
   lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_RETURN);
120 120
 
121 121
   // We need to patch the title to leave some space on the right for displaying the status
122
-  lv_obj_t * title = lv_obj_get_child_back(scr, NULL);
123
-  if (title != NULL) lv_obj_set_width(title, TFT_WIDTH - 101);
122
+  lv_obj_t * title = lv_obj_get_child_back(scr, nullptr);
123
+  if (title != nullptr) lv_obj_set_width(title, TFT_WIDTH - 101);
124 124
   labelP = lv_label_create(scr, TFT_WIDTH - 100, TITLE_YPOS, "Z:0.0mm");
125
-  if (labelP != NULL)
125
+  if (labelP != nullptr)
126 126
     updatePosTask = lv_task_create(refresh_pos, 300, LV_TASK_PRIO_LOWEST, 0);
127 127
 
128 128
   disp_move_dist();

+ 1
- 1
Marlin/src/lcd/tft/tft_queue.h Ver arquivo

@@ -134,7 +134,7 @@ class TFT_Queue {
134 134
   public:
135 135
     static void reset();
136 136
     static void async();
137
-    static void sync() { while (current_task != NULL) async(); }
137
+    static void sync() { while (current_task != nullptr) async(); }
138 138
 
139 139
     static void fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color);
140 140
     static void canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height);

+ 1
- 1
Marlin/src/lcd/tft/touch.h Ver arquivo

@@ -109,7 +109,7 @@ class Touch {
109 109
 
110 110
   public:
111 111
     static void init();
112
-    static void reset() { controls_count = 0; touch_time = 0; current_control = NULL; }
112
+    static void reset() { controls_count = 0; touch_time = 0; current_control = nullptr; }
113 113
     static void clear() { controls_count = 0; }
114 114
     static void idle();
115 115
     static bool is_clicked() {

Carregando…
Cancelar
Salvar