Browse Source

Whitespace cleanup

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
5a35595a3a
  1. 5
      Marlin/src/HAL/ESP32/WebSocketSerial.cpp
  2. 4
      Marlin/src/HAL/STM32/tft/xpt2046.cpp
  3. 4
      Marlin/src/feature/binary_stream.h
  4. 2
      Marlin/src/feature/spindle_laser.h
  5. 2
      Marlin/src/gcode/control/M993_M994.cpp
  6. 4
      Marlin/src/lcd/dwin/e3v2/rotary_encoder.cpp
  7. 4
      Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp
  8. 2
      Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h
  9. 4
      Marlin/src/lcd/tft/ili9341.h
  10. 4
      Marlin/src/lcd/tft/st7735.h
  11. 2
      Marlin/src/lcd/tft/st7789v.h
  12. 42
      Marlin/src/lcd/tft/st7796s.h
  13. 2
      Marlin/src/lcd/tft/ui_320x240.cpp
  14. 2
      Marlin/src/lcd/tft/ui_480x320.cpp

5
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;
}

4
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;

4
Marlin/src/feature/binary_stream.h

@ -441,9 +441,9 @@ public:
}
void dispatch() {
switch(static_cast<Protocol>(packet.header.protocol())) {
switch (static_cast<Protocol>(packet.header.protocol())) {
case Protocol::CONTROL:
switch(static_cast<ProtocolControl>(packet.header.type())) {
switch (static_cast<ProtocolControl>(packet.header.type())) {
case ProtocolControl::CLOSE: // revert back to ASCII mode
card.flag.binary_mode = false;
break;

2
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;

2
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);

4
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;

4
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))

2
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 {

4
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

4
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

2
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

42
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_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_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_END
};

2
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;

2
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;

Loading…
Cancel
Save