diff --git a/Marlin/src/HAL/ESP32/WebSocketSerial.cpp b/Marlin/src/HAL/ESP32/WebSocketSerial.cpp index 533f873e4f..ca7f47a1f8 100644 --- a/Marlin/src/HAL/ESP32/WebSocketSerial.cpp +++ b/Marlin/src/HAL/ESP32/WebSocketSerial.cpp @@ -86,7 +86,7 @@ int RingBuffer::read() { ring_buffer_pos_t RingBuffer::read(uint8_t *buffer) { ring_buffer_pos_t len = available(); - for(ring_buffer_pos_t i = 0; read_index != write_index; i++) { + for (ring_buffer_pos_t i = 0; read_index != write_index; i++) { buffer[i] = data[read_index]; read_index = NEXT_INDEX(read_index, size); } @@ -139,9 +139,8 @@ size_t WebSocketSerial::write(const uint8_t c) { size_t WebSocketSerial::write(const uint8_t* buffer, size_t size) { size_t written = 0; - for(size_t i = 0; i < size; i++) { + for (size_t i = 0; i < size; i++) written += write(buffer[i]); - } return written; } diff --git a/Marlin/src/HAL/STM32/tft/xpt2046.cpp b/Marlin/src/HAL/STM32/tft/xpt2046.cpp index 49e64da6a1..921e377a9f 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.cpp +++ b/Marlin/src/HAL/STM32/tft/xpt2046.cpp @@ -155,9 +155,9 @@ uint16_t XPT2046::getRawData(const XPTCoordinate coordinate) { uint16_t XPT2046::HardwareIO(uint16_t data) { __HAL_SPI_ENABLE(&SPIx); - while((SPIx.Instance->SR & SPI_FLAG_TXE) != SPI_FLAG_TXE) {} + while ((SPIx.Instance->SR & SPI_FLAG_TXE) != SPI_FLAG_TXE) {} SPIx.Instance->DR = data; - while((SPIx.Instance->SR & SPI_FLAG_RXNE) != SPI_FLAG_RXNE) {} + while ((SPIx.Instance->SR & SPI_FLAG_RXNE) != SPI_FLAG_RXNE) {} __HAL_SPI_DISABLE(&SPIx); return SPIx.Instance->DR; diff --git a/Marlin/src/feature/binary_stream.h b/Marlin/src/feature/binary_stream.h index 10dea10d47..32ebcce2f6 100644 --- a/Marlin/src/feature/binary_stream.h +++ b/Marlin/src/feature/binary_stream.h @@ -441,9 +441,9 @@ public: } void dispatch() { - switch(static_cast(packet.header.protocol())) { + switch (static_cast(packet.header.protocol())) { case Protocol::CONTROL: - switch(static_cast(packet.header.type())) { + switch (static_cast(packet.header.type())) { case ProtocolControl::CLOSE: // revert back to ASCII mode card.flag.binary_mode = false; break; diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 8240efa2dd..15ff661c73 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -224,7 +224,7 @@ public: */ // Force disengage planner power control - static inline void inline_disable() { + static inline void inline_disable() { isReady = false; unitPower = 0; planner.laser_inline.status.isPlanned = false; diff --git a/Marlin/src/gcode/control/M993_M994.cpp b/Marlin/src/gcode/control/M993_M994.cpp index ddc95238bf..ff9ff85bf5 100644 --- a/Marlin/src/gcode/control/M993_M994.cpp +++ b/Marlin/src/gcode/control/M993_M994.cpp @@ -74,7 +74,7 @@ void GcodeSuite::M994() { W25QXX.init(SPI_QUARTER_SPEED); W25QXX.SPI_FLASH_BulkErase(); SERIAL_ECHOPGM("Load SPI Flash"); - while(addr < SPI_FLASH_SIZE) { + while (addr < SPI_FLASH_SIZE) { card.read(buf, COUNT(buf)); W25QXX.SPI_FLASH_BufferWrite(buf, addr, COUNT(buf)); addr += COUNT(buf); diff --git a/Marlin/src/lcd/dwin/e3v2/rotary_encoder.cpp b/Marlin/src/lcd/dwin/e3v2/rotary_encoder.cpp index b1d905d9ad..d39c6cfbd5 100644 --- a/Marlin/src/lcd/dwin/e3v2/rotary_encoder.cpp +++ b/Marlin/src/lcd/dwin/e3v2/rotary_encoder.cpp @@ -194,7 +194,7 @@ ENCODER_DiffState Encoder_ReceiveAnalyze(void) { unsigned char temp_Counter; for (temp_Counter = 0; temp_Counter < LED_NUM; temp_Counter++) { LED_DataArray[temp_Counter] = 0; - switch(RGB_Scale) { + switch (RGB_Scale) { case RGB_SCALE_R10_G7_B5: LED_DataArray[temp_Counter] = (luminance*10/10) << 8 | (luminance*7/10) << 16 | luminance*5/10; break; case RGB_SCALE_R10_G7_B4: LED_DataArray[temp_Counter] = (luminance*10/10) << 8 | (luminance*7/10) << 16 | luminance*4/10; break; case RGB_SCALE_R10_G8_B7: LED_DataArray[temp_Counter] = (luminance*10/10) << 8 | (luminance*8/10) << 16 | luminance*7/10; break; @@ -213,7 +213,7 @@ ENCODER_DiffState Encoder_ReceiveAnalyze(void) { bool LED_R_Flag = 0, LED_G_Flag = 0, LED_B_Flag = 0; for (temp_Counter = 0; temp_Counter < LED_NUM; temp_Counter++) { - switch(RGB_Scale) { + switch (RGB_Scale) { case RGB_SCALE_R10_G7_B5: { LED_R_Data[temp_Counter] = luminance*10/10; LED_G_Data[temp_Counter] = luminance*7/10; diff --git a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp index 9b54dbdd2b..a7173b1ad2 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -27,8 +27,8 @@ #include "../../../../inc/MarlinConfig.h" #include "../../ui_api.h" -#include "../../../../MarlinCore.h" // for quickstop_stepper and disable_steppers -#include "../../../../module/motion.h" // for A20 read printing speed feedrate_percentage +#include "../../../../MarlinCore.h" // for quickstop_stepper and disable_steppers +#include "../../../../module/motion.h" // for A20 read printing speed feedrate_percentage // command sending macro's with debugging capability #define SEND_PGM(x) send_P(PSTR(x)) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h index 595565e1c7..21c3b6185a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -161,7 +161,7 @@ typedef struct { uint8_t waitEndMoves; uint16_t moveSpeed; float move_dist; - uint8_t F[4]; + uint8_t F[4]; } UI_CFG; typedef enum { diff --git a/Marlin/src/lcd/tft/ili9341.h b/Marlin/src/lcd/tft/ili9341.h index 22709e4cf7..d4a493412f 100644 --- a/Marlin/src/lcd/tft/ili9341.h +++ b/Marlin/src/lcd/tft/ili9341.h @@ -33,10 +33,10 @@ #define ILI9341_MADCTL_RGB 0x00 #define ILI9341_MADCTL_MH 0x04 // Horizontal Refresh Order -#define ILI9341_ORIENTATION_UP ILI9341_MADCTL_MY // 240x320 ; Cable on the upper side +#define ILI9341_ORIENTATION_UP ILI9341_MADCTL_MY // 240x320 ; Cable on the upper side #define ILI9341_ORIENTATION_RIGHT ILI9341_MADCTL_MV // 320x240 ; Cable on the right side #define ILI9341_ORIENTATION_LEFT ILI9341_MADCTL_MY | ILI9341_MADCTL_MX | ILI9341_MADCTL_MV // 320x240 ; Cable on the left side -#define ILI9341_ORIENTATION_DOWN ILI9341_MADCTL_MX // 240x320 ; Cable on the upper side +#define ILI9341_ORIENTATION_DOWN ILI9341_MADCTL_MX // 240x320 ; Cable on the upper side #ifndef ILI9341_COLOR_RGB #define ILI9341_COLOR_BGR diff --git a/Marlin/src/lcd/tft/st7735.h b/Marlin/src/lcd/tft/st7735.h index 30e77fbd91..62f93d5044 100644 --- a/Marlin/src/lcd/tft/st7735.h +++ b/Marlin/src/lcd/tft/st7735.h @@ -33,7 +33,7 @@ #define ST7735_MADCTL_RGB 0x00 #define ST7735_MADCTL_MH 0x04 // Horizontal Refresh Order -#define ST7735_ORIENTATION_UP 0x00 // 128x160 ; Cable on the upper side +#define ST7735_ORIENTATION_UP 0x00 // 128x160 ; Cable on the upper side #define ST7735_ORIENTATION_RIGHT ST7735_MADCTL_MV | ST7735_MADCTL_MY // 160x128 ; Cable on the right side #define ST7735_ORIENTATION_LEFT ST7735_MADCTL_MV | ST7735_MADCTL_MX // 160x128 ; Cable on the left side #define ST7735_ORIENTATION_DOWN ST7735_MADCTL_MX | ST7735_MADCTL_MY // 128x160 ; Cable on the lower side @@ -71,7 +71,7 @@ #define ST7735_IDMOFF 0x38 // Idle Mode Off #define ST7735_IDMON 0x39 // Idle Mode On #define ST7735_COLMOD 0x3A // Interface Pixel Format -#define ST7735_RDID1 0xDA // Read ID1 Value +#define ST7735_RDID1 0xDA // Read ID1 Value #define ST7735_RDID2 0xDB // Read ID2 Value #define ST7735_RDID3 0xDC // Read ID3 Value diff --git a/Marlin/src/lcd/tft/st7789v.h b/Marlin/src/lcd/tft/st7789v.h index f6e937c2c2..67da67966d 100644 --- a/Marlin/src/lcd/tft/st7789v.h +++ b/Marlin/src/lcd/tft/st7789v.h @@ -89,7 +89,7 @@ #define ST7789V_WRCABCMB 0x5E // Write CABC Minimum Brightness #define ST7789V_RDCABCMB 0x5F // Read CABC Minimum Brightness #define ST7789V_RDABCSDR 0x68 // Read Automatic Brightness Control Self-Diagnostic Result -#define ST7789V_RDID1 0xDA // Read ID1 Value +#define ST7789V_RDID1 0xDA // Read ID1 Value #define ST7789V_RDID2 0xDB // Read ID2 Value #define ST7789V_RDID3 0xDC // Read ID3 Value diff --git a/Marlin/src/lcd/tft/st7796s.h b/Marlin/src/lcd/tft/st7796s.h index 7ddbcfae84..806977732c 100644 --- a/Marlin/src/lcd/tft/st7796s.h +++ b/Marlin/src/lcd/tft/st7796s.h @@ -133,8 +133,8 @@ static const uint16_t st7796s_init[] = { ESC_REG(ST7796S_DOCA), 0x0040, 0x008A, 0x0000, 0x0000, 0x0029, 0x0019, 0x00A5, 0x0033, /* Gamma Correction. */ - ESC_REG(ST7796S_PGC), 0x00F0, 0x0004, 0x0008, 0x0009, 0x0008, 0x0015, 0x002F, 0x0042, 0x0046, 0x0028, 0x0015, 0x0016, 0x0029, 0x002D, - ESC_REG(ST7796S_NGC), 0x00F0, 0x0004, 0x0009, 0x0009, 0x0008, 0x0015, 0x002E, 0x0046, 0x0046, 0x0028, 0x0015, 0x0015, 0x0029, 0x002D, + ESC_REG(ST7796S_PGC), 0x00F0, 0x0004, 0x0008, 0x0009, 0x0008, 0x0015, 0x002F, 0x0042, 0x0046, 0x0028, 0x0015, 0x0016, 0x0029, 0x002D, + ESC_REG(ST7796S_NGC), 0x00F0, 0x0004, 0x0009, 0x0009, 0x0008, 0x0015, 0x002E, 0x0046, 0x0046, 0x0028, 0x0015, 0x0015, 0x0029, 0x002D, ESC_REG(ST7796S_NORON), ESC_REG(ST7796S_WRCTRLD), 0x0024, @@ -146,30 +146,30 @@ static const uint16_t st7796s_init[] = { static const uint16_t lerdge_st7796s_init[] = { DATASIZE_8BIT, - ESC_REG(ST7796S_CSCON), 0x00C3, // enable command 2 part I - ESC_REG(ST7796S_CSCON), 0x0096, // enable command 2 part II + ESC_REG(ST7796S_CSCON), 0x00C3, // enable command 2 part I + ESC_REG(ST7796S_CSCON), 0x0096, // enable command 2 part II - ESC_REG(ST7796S_MADCTL), ST7796S_MADCTL_DATA, + ESC_REG(ST7796S_MADCTL), ST7796S_MADCTL_DATA, ESC_REG(ST7796S_COLMOD), 0x0055, - ESC_REG(ST7796S_DIC), 0x0001, // 1-dot inversion - ESC_REG(ST7796S_EM), 0x00C6, + ESC_REG(ST7796S_DIC), 0x0001, // 1-dot inversion + ESC_REG(ST7796S_EM), 0x00C6, - ESC_REG(ST7796S_PWR2), 0x0015, - ESC_REG(ST7796S_PWR3), 0x00AF, - ESC_REG(0xC3), 0x0009, // Register not documented in datasheet - ESC_REG(ST7796S_VCMPCTL), 0x0022, - ESC_REG(ST7796S_VCMOST), 0x0000, - ESC_REG(ST7796S_DOCA), 0x0040, 0x008A, 0x0000, 0x0000, 0x0029, 0x0019, 0x00A5, 0x0033, + ESC_REG(ST7796S_PWR2), 0x0015, + ESC_REG(ST7796S_PWR3), 0x00AF, + ESC_REG(0xC3), 0x0009, // Register not documented in datasheet + ESC_REG(ST7796S_VCMPCTL), 0x0022, + ESC_REG(ST7796S_VCMOST), 0x0000, + ESC_REG(ST7796S_DOCA), 0x0040, 0x008A, 0x0000, 0x0000, 0x0029, 0x0019, 0x00A5, 0x0033, /* Gamma Correction. */ - ESC_REG(ST7796S_PGC), 0x00F0, 0x0004, 0x0008, 0x0009, 0x0008, 0x0015, 0x002F, 0x0042, 0x0046, 0x0028, 0x0015, 0x0016, 0x0029, 0x002D, - ESC_REG(ST7796S_NGC), 0x00F0, 0x0004, 0x0009, 0x0009, 0x0008, 0x0015, 0x002E, 0x0046, 0x0046, 0x0028, 0x0015, 0x0015, 0x0029, 0x002D, + ESC_REG(ST7796S_PGC), 0x00F0, 0x0004, 0x0008, 0x0009, 0x0008, 0x0015, 0x002F, 0x0042, 0x0046, 0x0028, 0x0015, 0x0016, 0x0029, 0x002D, + ESC_REG(ST7796S_NGC), 0x00F0, 0x0004, 0x0009, 0x0009, 0x0008, 0x0015, 0x002E, 0x0046, 0x0046, 0x0028, 0x0015, 0x0015, 0x0029, 0x002D, - ESC_REG(ST7796S_INVON), // Display inversion ON - ESC_REG(ST7796S_WRCTRLD), 0x0024, - ESC_REG(ST7796S_CSCON), 0x003C, // disable command 2 part I - ESC_REG(ST7796S_CSCON), 0x0069, // disable command 2 part II - ESC_REG(ST7796S_DISPON), + ESC_REG(ST7796S_INVON), // Display inversion ON + ESC_REG(ST7796S_WRCTRLD), 0x0024, + ESC_REG(ST7796S_CSCON), 0x003C, // disable command 2 part I + ESC_REG(ST7796S_CSCON), 0x0069, // disable command 2 part II + ESC_REG(ST7796S_DISPON), ESC_END }; diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 2f4c90e170..de8498c5ff 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -603,7 +603,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const touch.clear(); if (calibration_stage < CALIBRATION_SUCCESS) { - switch(calibration_stage) { + switch (calibration_stage) { case CALIBRATION_POINT_1: tft_string.set("Top Left"); break; case CALIBRATION_POINT_2: y = TFT_HEIGHT - 21; tft_string.set("Bottom Left"); break; case CALIBRATION_POINT_3: x = TFT_WIDTH - 21; tft_string.set("Top Right"); break; diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index d6409c1dca..b5b332910b 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -608,7 +608,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const touch.clear(); if (calibration_stage < CALIBRATION_SUCCESS) { - switch(calibration_stage) { + switch (calibration_stage) { case CALIBRATION_POINT_1: tft_string.set("Top Left"); break; case CALIBRATION_POINT_2: y = TFT_HEIGHT - 21; tft_string.set("Bottom Left"); break; case CALIBRATION_POINT_3: x = TFT_WIDTH - 21; tft_string.set("Top Right"); break;