From 3c86eb18a5965cb491774b1fb5e7d745d9c48946 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 3 Mar 2021 00:11:50 -0600 Subject: [PATCH] misc. cleanup --- Marlin/src/HAL/STM32/tft/tft_spi.cpp | 6 +++--- Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp | 4 ++-- Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp | 2 +- Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp | 6 ++++-- Marlin/src/lcd/menu/menu_ubl.cpp | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Marlin/src/HAL/STM32/tft/tft_spi.cpp b/Marlin/src/HAL/STM32/tft/tft_spi.cpp index 3cb797d5f2..32af67d158 100644 --- a/Marlin/src/HAL/STM32/tft/tft_spi.cpp +++ b/Marlin/src/HAL/STM32/tft/tft_spi.cpp @@ -207,12 +207,12 @@ void TFT_SPI::Transmit(uint16_t Data) { while ((SPIx.Instance->SR & SPI_FLAG_BSY) == SPI_FLAG_BSY) {} if (TFT_MISO_PIN != TFT_MOSI_PIN) - __HAL_SPI_CLEAR_OVRFLAG(&SPIx); /* Clear overrun flag in 2 Lines communication mode because received is not read */ + __HAL_SPI_CLEAR_OVRFLAG(&SPIx); // Clear overrun flag in 2 Lines communication mode because received is not read } void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count) { // Wait last dma finish, to start another - while(isBusy()) { } + while (isBusy()) { /* nada */ } DMAtx.Init.MemInc = MemoryIncrease; HAL_DMA_Init(&DMAtx); @@ -225,7 +225,7 @@ void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Coun HAL_DMA_Start(&DMAtx, (uint32_t)Data, (uint32_t)&(SPIx.Instance->DR), Count); __HAL_SPI_ENABLE(&SPIx); - SET_BIT(SPIx.Instance->CR2, SPI_CR2_TXDMAEN); /* Enable Tx DMA Request */ + SET_BIT(SPIx.Instance->CR2, SPI_CR2_TXDMAEN); // Enable Tx DMA Request HAL_DMA_PollForTransfer(&DMAtx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY); Abort(); diff --git a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp index fd91138a4f..97149a407e 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp @@ -310,7 +310,7 @@ namespace Anycubic { bool ChironTFT::ReadTFTCommand() { bool command_ready = false; - while(TFTSer.available() > 0 && command_len < MAX_CMND_LEN) { + while (TFTSer.available() > 0 && command_len < MAX_CMND_LEN) { panel_command[command_len] = TFTSer.read(); if (panel_command[command_len] == '\n') { command_ready = true; @@ -338,7 +338,7 @@ namespace Anycubic { int8_t ChironTFT::Findcmndpos(const char * buff, char q) { int8_t pos = 0; - do { if (buff[pos] == q) return pos; } while(++pos < MAX_CMND_LEN); + do { if (buff[pos] == q) return pos; } while (++pos < MAX_CMND_LEN); return -1; } diff --git a/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp index bdd702b1d7..9fc56acf10 100644 --- a/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp @@ -264,7 +264,7 @@ void DGUSScreenHandler::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { void DGUSScreenHandler::SDPrintingFinished() { if (DGUSAutoTurnOff) { - while(!queue.ring_buffer.empty()) queue.advance(); + while (!queue.ring_buffer.empty()) queue.advance(); gcode.process_subcommands_now_P(PSTR("M81")); } GotoScreen(MKSLCD_SCREEN_PrintDone); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index 0a8f81ea86..d32851f761 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -66,8 +66,10 @@ uint8_t sel_id = 0; //root2.rewind(); //SERIAL_ECHOLN(list_file.curDirPath); - if (curDirLever != 0) card.cd(list_file.curDirPath); - else card.cdroot(); // while(card.cdup()); + if (curDirLever != 0) + card.cd(list_file.curDirPath); + else + card.cdroot(); const uint16_t fileCnt = card.get_num_Files(); diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 95e64a0d82..79bedb9ea5 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -476,7 +476,7 @@ void ubl_map_screen() { if (position_is_reachable(xy)) break; // Found a valid point ui.encoderPosition += step_dir; // Test the next point #endif - } while(ENABLED(IS_KINEMATIC)); + } while (ENABLED(IS_KINEMATIC)); // Determine number of points to edit #if IS_KINEMATIC