1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-26 21:36:21 +00:00

🎨 NULL => nullptr

This commit is contained in:
Scott Lahteine 2021-07-24 15:55:45 -05:00 committed by Scott Lahteine
parent 2aad79fa15
commit e402f43c02
7 changed files with 20 additions and 20 deletions

View File

@ -290,13 +290,13 @@ static bool SDIO_ReadWriteBlock_DMA(uint32_t block, const uint8_t *src, uint8_t
bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) {
uint8_t retries = SDIO_READ_RETRIES;
while (retries--) if (SDIO_ReadWriteBlock_DMA(block, NULL, dst)) return true;
while (retries--) if (SDIO_ReadWriteBlock_DMA(block, nullptr, dst)) return true;
return false;
}
bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
uint8_t retries = SDIO_READ_RETRIES;
while (retries--) if (SDIO_ReadWriteBlock_DMA(block, src, NULL)) return true;
while (retries--) if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true;
return false;
}

View File

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

View File

@ -33,8 +33,8 @@
extern lv_group_t * g;
static lv_obj_t * scr;
static lv_obj_t *button_bind_or_not = NULL, *label_bind_or_not = NULL;
static lv_obj_t *buttonReleaseBind = NULL, *label_ReleaseBind = NULL;
static lv_obj_t *button_bind_or_not = nullptr, *label_bind_or_not = nullptr;
static lv_obj_t *buttonReleaseBind = nullptr, *label_ReleaseBind = nullptr;
static lv_obj_t * text_id;
static uint8_t unbinding_flag = 0;
@ -61,29 +61,29 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
}
void lv_draw_cloud_bind() {
lv_obj_t *buttonBack = NULL, *label_Back = NULL;
lv_obj_t *buttonBack = nullptr, *label_Back = nullptr;
scr = lv_screen_create(BIND_UI);
button_bind_or_not = lv_btn_create(scr, NULL);
button_bind_or_not = lv_btn_create(scr, nullptr);
lv_obj_set_pos(button_bind_or_not, TFT_WIDTH - 130, TFT_HEIGHT - 80 * 3);
lv_obj_set_size(button_bind_or_not, PARA_UI_VALUE_BTN_X_SIZE + 15, PARA_UI_VALUE_BTN_Y_SIZE + 15);
lv_obj_set_event_cb_mks(button_bind_or_not, event_handler, ID_CLOUD_BIND_OR_NOT, NULL, 0);
lv_obj_set_event_cb_mks(button_bind_or_not, event_handler, ID_CLOUD_BIND_OR_NOT, nullptr, 0);
lv_btn_set_style(button_bind_or_not, LV_BTN_STYLE_REL, &style_para_value);
lv_btn_set_style(button_bind_or_not, LV_BTN_STYLE_PR, &style_para_value);
label_bind_or_not = lv_label_create_empty(button_bind_or_not);
buttonReleaseBind = lv_btn_create(scr, NULL);
buttonReleaseBind = lv_btn_create(scr, nullptr);
lv_obj_set_pos(buttonReleaseBind, TFT_WIDTH - 130, TFT_HEIGHT - 80 * 2);
lv_obj_set_size(buttonReleaseBind, PARA_UI_VALUE_BTN_X_SIZE + 15, PARA_UI_VALUE_BTN_Y_SIZE + 15);
lv_obj_set_event_cb_mks(buttonReleaseBind, event_handler, ID_CLOUD_RELEASE_BIND, NULL, 0);
lv_obj_set_event_cb_mks(buttonReleaseBind, event_handler, ID_CLOUD_RELEASE_BIND, nullptr, 0);
label_ReleaseBind = lv_label_create_empty(buttonReleaseBind);
lv_label_set_text(label_ReleaseBind, cloud_menu.unbind);
lv_obj_align(label_ReleaseBind, buttonReleaseBind, LV_ALIGN_CENTER, 0, 0);
buttonBack = lv_btn_create(scr, NULL);
buttonBack = lv_btn_create(scr, nullptr);
lv_obj_set_pos(buttonBack, TFT_WIDTH - 130, TFT_HEIGHT - 80);
lv_obj_set_size(buttonBack, PARA_UI_VALUE_BTN_X_SIZE + 15, PARA_UI_VALUE_BTN_Y_SIZE + 15);
lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_CLOUD_BIND_RETURN, NULL, 0);
lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_CLOUD_BIND_RETURN, nullptr, 0);
lv_btn_set_style(buttonBack, LV_BTN_STYLE_REL, &style_para_back);
lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back);
label_Back = lv_label_create_empty(buttonBack);

View File

@ -431,7 +431,7 @@ void lv_draw_dialog(uint8_t type) {
}
else if (DIALOG_IS(TYPE_UPDATE_ESP_FIRMWARE)) {
lv_label_set_text(labelDialog, DIALOG_UPDATE_WIFI_FIRMWARE_EN);
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20);
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20);
}
#endif // MKS_WIFI_MODULE
else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT)) {
@ -469,7 +469,7 @@ void lv_draw_dialog(uint8_t type) {
#if ENABLED(MKS_WIFI_MODULE)
else if (DIALOG_IS(TYPE_UNBIND)) {
lv_label_set_text(labelDialog, common_menu.unbind_printer_tips);
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -70);
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -70);
}
#endif
#if HAS_ROTARY_ENCODER

View File

@ -119,10 +119,10 @@ void lv_draw_move_motor() {
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);
// We need to patch the title to leave some space on the right for displaying the status
lv_obj_t * title = lv_obj_get_child_back(scr, NULL);
if (title != NULL) lv_obj_set_width(title, TFT_WIDTH - 101);
lv_obj_t * title = lv_obj_get_child_back(scr, nullptr);
if (title != nullptr) lv_obj_set_width(title, TFT_WIDTH - 101);
labelP = lv_label_create(scr, TFT_WIDTH - 100, TITLE_YPOS, "Z:0.0mm");
if (labelP != NULL)
if (labelP != nullptr)
updatePosTask = lv_task_create(refresh_pos, 300, LV_TASK_PRIO_LOWEST, 0);
disp_move_dist();

View File

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

View File

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