From 2059c6e4d06f12905256584682d95fe80dea075e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 29 Mar 2021 20:36:37 -0500 Subject: [PATCH] Apply pointer formatting --- Marlin/src/HAL/AVR/HAL_SPI.cpp | 8 +- Marlin/src/HAL/DUE/HAL_SPI.cpp | 30 ++++---- Marlin/src/HAL/DUE/eeprom_flash.cpp | 14 ++-- Marlin/src/HAL/DUE/usb/udi_cdc.h | 4 +- Marlin/src/HAL/DUE/usb/usb_task.c | 2 +- Marlin/src/HAL/ESP32/HAL_SPI.cpp | 4 +- Marlin/src/HAL/ESP32/WebSocketSerial.cpp | 2 +- Marlin/src/HAL/ESP32/WebSocketSerial.h | 4 +- Marlin/src/HAL/LPC1768/HAL_SPI.cpp | 10 +-- .../u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp | 2 +- Marlin/src/HAL/SAMD51/HAL_SPI.cpp | 4 +- Marlin/src/HAL/STM32/HAL_SPI.cpp | 4 +- Marlin/src/HAL/STM32/MarlinSerial.h | 2 +- Marlin/src/HAL/STM32F1/HAL_SPI.cpp | 6 +- Marlin/src/HAL/STM32F1/eeprom_flash.cpp | 4 +- Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp | 4 +- Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp | 4 +- Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp | 4 +- Marlin/src/HAL/shared/HAL_MinSerial.h | 2 +- Marlin/src/HAL/shared/HAL_SPI.h | 6 +- Marlin/src/HAL/shared/backtrace/backtrace.cpp | 2 +- Marlin/src/HAL/shared/eeprom_api.h | 6 +- Marlin/src/HAL/shared/eeprom_if_spi.cpp | 2 +- Marlin/src/core/macros.h | 4 +- Marlin/src/core/serial_base.h | 6 +- Marlin/src/feature/binary_stream.h | 10 +-- Marlin/src/feature/meatpack.cpp | 2 +- Marlin/src/feature/meatpack.h | 2 +- Marlin/src/feature/mmu/mmu2.cpp | 14 ++-- Marlin/src/feature/mmu/mmu2.h | 10 +-- Marlin/src/feature/runout.h | 10 +-- Marlin/src/gcode/queue.cpp | 6 +- Marlin/src/gcode/queue.h | 6 +- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 4 +- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 4 +- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 4 +- .../dogm/u8g_dev_tft_upscale_from_128x64.cpp | 6 +- .../dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp | 4 +- .../lcd/extui/lib/dgus/DGUSScreenHandler.cpp | 4 +- .../extui/lib/dgus/fysetc/DGUSScreenHandler.h | 6 +- .../lib/dgus/hiprecy/DGUSScreenHandler.h | 6 +- .../extui/lib/dgus/mks/DGUSScreenHandler.cpp | 4 +- .../extui/lib/dgus/mks/DGUSScreenHandler.h | 10 +-- .../extui/lib/dgus/origin/DGUSScreenHandler.h | 6 +- .../archim2-flash/media_file_reader.cpp | 2 +- .../archim2-flash/media_file_reader.h | 2 +- .../ftdi_eve_lib/basic/spi.cpp | 4 +- .../ftdi_eve_lib/basic/spi.h | 4 +- .../ftdi_eve_lib/extended/sound_list.h | 2 +- .../ftdi_eve_lib/extended/sound_player.cpp | 2 +- .../ftdi_eve_lib/extended/sound_player.h | 2 +- .../ftdi_eve_lib/extended/text_ellipsis.cpp | 2 +- .../lib/ftdi_eve_touch_ui/marlin_events.cpp | 2 +- .../screens/bio_printing_dialog_box.cpp | 4 +- .../confirm_user_request_alert_box.cpp | 2 +- .../screens/files_screen.cpp | 2 +- .../ftdi_eve_touch_ui/screens/files_screen.h | 2 +- .../screens/status_screen.cpp | 4 +- .../lcd/extui/lib/mks_ui/SPIFlashStorage.cpp | 12 +-- .../lcd/extui/lib/mks_ui/SPIFlashStorage.h | 12 +-- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 20 ++--- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 2 +- .../src/lcd/extui/lib/mks_ui/pic_manager.cpp | 4 +- .../src/lcd/extui/lib/mks_ui/wifi_module.cpp | 4 +- .../src/lcd/extui/lib/nextion/nextion_tft.cpp | 4 +- Marlin/src/lcd/extui/malyan_lcd.cpp | 14 ++-- Marlin/src/lcd/lcdprint.h | 2 +- Marlin/src/lcd/marlinui.h | 4 +- Marlin/src/lcd/menu/menu.h | 6 +- Marlin/src/lcd/tft/ui_320x240.cpp | 2 +- Marlin/src/lcd/tft/ui_480x320.cpp | 4 +- Marlin/src/lcd/tft/ui_common.cpp | 2 +- Marlin/src/libs/W25Qxx.cpp | 10 +-- Marlin/src/libs/W25Qxx.h | 10 +-- Marlin/src/libs/softspi.h | 4 +- Marlin/src/module/planner.cpp | 10 +-- Marlin/src/module/planner.h | 6 +- Marlin/src/module/stepper.cpp | 4 +- Marlin/src/module/stepper.h | 4 +- Marlin/src/module/stepper/trinamic.cpp | 6 +- Marlin/src/sd/Sd2Card.cpp | 22 +++--- Marlin/src/sd/Sd2Card.h | 16 ++-- Marlin/src/sd/SdBaseFile.cpp | 74 +++++++++---------- Marlin/src/sd/SdBaseFile.h | 38 +++++----- Marlin/src/sd/SdFatStructs.h | 8 +- Marlin/src/sd/SdFile.cpp | 4 +- Marlin/src/sd/SdFile.h | 4 +- Marlin/src/sd/SdVolume.cpp | 10 +-- Marlin/src/sd/SdVolume.h | 12 +-- Marlin/src/sd/cardreader.h | 2 +- .../sd/usb_flashdrive/Sd2Card_FlashDrive.cpp | 4 +- .../sd/usb_flashdrive/Sd2Card_FlashDrive.h | 8 +- Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp | 14 ++-- .../src/sd/usb_flashdrive/lib-uhs2/UsbCore.h | 20 ++--- .../sd/usb_flashdrive/lib-uhs2/usbhost.cpp | 4 +- .../src/sd/usb_flashdrive/lib-uhs2/usbhost.h | 4 +- .../lib-uhs3/UHS_host/UHS_host_INLINE.h | 12 +-- .../lib-uhs3/UHS_host/UHS_usbhost.h | 14 ++-- .../USB_HOST_SHIELD/USB_HOST_SHIELD.h | 6 +- .../USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h | 6 +- .../variants/MARLIN_F4x7Vx/hal_conf_extra.h | 2 +- buildroot/share/fonts/genpages.c | 4 +- 102 files changed, 364 insertions(+), 364 deletions(-) diff --git a/Marlin/src/HAL/AVR/HAL_SPI.cpp b/Marlin/src/HAL/AVR/HAL_SPI.cpp index 3e5572e55..1a1b98b3d 100644 --- a/Marlin/src/HAL/AVR/HAL_SPI.cpp +++ b/Marlin/src/HAL/AVR/HAL_SPI.cpp @@ -88,7 +88,7 @@ void spiBegin() { } /** SPI read data */ - void spiRead(uint8_t* buf, uint16_t nbyte) { + void spiRead(uint8_t *buf, uint16_t nbyte) { if (nbyte-- == 0) return; SPDR = 0xFF; for (uint16_t i = 0; i < nbyte; i++) { @@ -107,7 +107,7 @@ void spiBegin() { } /** SPI send block */ - void spiSendBlock(uint8_t token, const uint8_t* buf) { + void spiSendBlock(uint8_t token, const uint8_t *buf) { SPDR = token; for (uint16_t i = 0; i < 512; i += 2) { while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } @@ -215,7 +215,7 @@ void spiBegin() { } // Soft SPI read data - void spiRead(uint8_t* buf, uint16_t nbyte) { + void spiRead(uint8_t *buf, uint16_t nbyte) { for (uint16_t i = 0; i < nbyte; i++) buf[i] = spiRec(); } @@ -242,7 +242,7 @@ void spiBegin() { } // Soft SPI send block - void spiSendBlock(uint8_t token, const uint8_t* buf) { + void spiSendBlock(uint8_t token, const uint8_t *buf) { spiSend(token); for (uint16_t i = 0; i < 512; i++) spiSend(buf[i]); diff --git a/Marlin/src/HAL/DUE/HAL_SPI.cpp b/Marlin/src/HAL/DUE/HAL_SPI.cpp index 6cb2912c1..f42e8a980 100644 --- a/Marlin/src/HAL/DUE/HAL_SPI.cpp +++ b/Marlin/src/HAL/DUE/HAL_SPI.cpp @@ -56,8 +56,8 @@ #pragma GCC optimize (3) typedef uint8_t (*pfnSpiTransfer)(uint8_t b); - typedef void (*pfnSpiRxBlock)(uint8_t* buf, uint32_t nbyte); - typedef void (*pfnSpiTxBlock)(const uint8_t* buf, uint32_t nbyte); + typedef void (*pfnSpiRxBlock)(uint8_t *buf, uint32_t nbyte); + typedef void (*pfnSpiTxBlock)(const uint8_t *buf, uint32_t nbyte); /* ---------------- Macros to be able to access definitions from asm */ #define _PORT(IO) DIO ## IO ## _WPORT @@ -270,7 +270,7 @@ static pfnSpiTransfer spiTransferTx = (pfnSpiTransfer)spiTransferX; // Block transfers run at ~8 .. ~10Mhz - Tx version (Rx data discarded) - static void spiTxBlock0(const uint8_t* ptr, uint32_t todo) { + static void spiTxBlock0(const uint8_t *ptr, uint32_t todo) { uint32_t MOSI_PORT_PLUS30 = ((uint32_t) PORT(SD_MOSI_PIN)) + 0x30; /* SODR of port */ uint32_t MOSI_MASK = PIN_MASK(SD_MOSI_PIN); uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SD_SCK_PIN)) + 0x30; /* SODR of port */ @@ -349,7 +349,7 @@ ); } - static void spiRxBlock0(uint8_t* ptr, uint32_t todo) { + static void spiRxBlock0(uint8_t *ptr, uint32_t todo) { uint32_t bin = 0; uint32_t work = 0; uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(SD_MISO_PIN))+0x3C, PIN_SHIFT(SD_MISO_PIN)); /* PDSR of port in bitband area */ @@ -425,13 +425,13 @@ ); } - static void spiTxBlockX(const uint8_t* buf, uint32_t todo) { + static void spiTxBlockX(const uint8_t *buf, uint32_t todo) { do { (void)spiTransferTx(*buf++); } while (--todo); } - static void spiRxBlockX(uint8_t* buf, uint32_t todo) { + static void spiRxBlockX(uint8_t *buf, uint32_t todo) { do { *buf++ = spiTransferRx(0xFF); } while (--todo); @@ -463,7 +463,7 @@ return b; } - void spiRead(uint8_t* buf, uint16_t nbyte) { + void spiRead(uint8_t *buf, uint16_t nbyte) { if (nbyte) { _SS_WRITE(LOW); WRITE(SD_MOSI_PIN, HIGH); // Output 1s 1 @@ -478,7 +478,7 @@ _SS_WRITE(HIGH); } - void spiSendBlock(uint8_t token, const uint8_t* buf) { + void spiSendBlock(uint8_t token, const uint8_t *buf) { _SS_WRITE(LOW); (void)spiTransferTx(token); spiTxBlock(buf, 512); @@ -645,7 +645,7 @@ } // Read from SPI into buffer - void spiRead(uint8_t* buf, uint16_t nbyte) { + void spiRead(uint8_t *buf, uint16_t nbyte) { if (!nbyte) return; --nbyte; for (int i = 0; i < nbyte; i++) { @@ -668,7 +668,7 @@ //DELAY_US(1U); } - void spiSend(const uint8_t* buf, size_t nbyte) { + void spiSend(const uint8_t *buf, size_t nbyte) { if (!nbyte) return; --nbyte; for (size_t i = 0; i < nbyte; i++) { @@ -689,7 +689,7 @@ FLUSH_RX(); } - void spiSend(uint32_t chan, const uint8_t* buf, size_t nbyte) { + void spiSend(uint32_t chan, const uint8_t *buf, size_t nbyte) { if (!nbyte) return; --nbyte; for (size_t i = 0; i < nbyte; i++) { @@ -702,7 +702,7 @@ } // Write from buffer to SPI - void spiSendBlock(uint8_t token, const uint8_t* buf) { + void spiSendBlock(uint8_t token, const uint8_t *buf) { SPI0->SPI_TDR = (uint32_t)token | SPI_PCS(SPI_CHAN); WHILE_TX(0); //WHILE_RX(0); @@ -801,19 +801,19 @@ uint8_t spiRec() { return (uint8_t)spiTransfer(0xFF); } - void spiRead(uint8_t* buf, uint16_t nbyte) { + void spiRead(uint8_t *buf, uint16_t nbyte) { for (int i = 0; i < nbyte; i++) buf[i] = spiTransfer(0xFF); } void spiSend(uint8_t data) { spiTransfer(data); } - void spiSend(const uint8_t* buf, size_t nbyte) { + void spiSend(const uint8_t *buf, size_t nbyte) { for (uint16_t i = 0; i < nbyte; i++) spiTransfer(buf[i]); } - void spiSendBlock(uint8_t token, const uint8_t* buf) { + void spiSendBlock(uint8_t token, const uint8_t *buf) { spiTransfer(token); for (uint16_t i = 0; i < 512; i++) spiTransfer(buf[i]); diff --git a/Marlin/src/HAL/DUE/eeprom_flash.cpp b/Marlin/src/HAL/DUE/eeprom_flash.cpp index 738f44acc..14c843576 100644 --- a/Marlin/src/HAL/DUE/eeprom_flash.cpp +++ b/Marlin/src/HAL/DUE/eeprom_flash.cpp @@ -139,7 +139,7 @@ static void ee_Dump(const int page, const void* data) { #ifdef EE_EMU_DEBUG - const uint8_t* c = (const uint8_t*) data; + const uint8_t *c = (const uint8_t*) data; char buffer[80]; sprintf_P(buffer, PSTR("Page: %d (0x%04x)\n"), page, page); @@ -293,8 +293,8 @@ static bool ee_PageWrite(uint16_t page, const void* data) { ee_Dump(-page, data); // Calculate count of changed bits - uint32_t* p1 = (uint32_t*)addrflash; - uint32_t* p2 = (uint32_t*)data; + uint32_t *p1 = (uint32_t*)addrflash; + uint32_t *p2 = (uint32_t*)data; int count = 0; for (i =0; i> 2; i++) { if (p1[i] != p2[i]) { @@ -470,7 +470,7 @@ static uint8_t ee_Read(uint32_t address, bool excludeRAMBuffer=false) { for (int page = curPage - 1; page >= 0; --page) { // Get a pointer to the flash page - uint8_t* pflash = (uint8_t*)getFlashStorage(page + curGroup * PagesPerGroup); + uint8_t *pflash = (uint8_t*)getFlashStorage(page + curGroup * PagesPerGroup); uint16_t i = 0; while (i <= (PageSize - 4)) { /* (PageSize - 4) because otherwise, there is not enough room for data and headers */ @@ -550,7 +550,7 @@ static uint32_t ee_GetAddrRange(uint32_t address, bool excludeRAMBuffer=false) { for (int page = curPage - 1; page >= 0; --page) { // Get a pointer to the flash page - uint8_t* pflash = (uint8_t*)getFlashStorage(page + curGroup * PagesPerGroup); + uint8_t *pflash = (uint8_t*)getFlashStorage(page + curGroup * PagesPerGroup); uint16_t i = 0; while (i <= (PageSize - 4)) { /* (PageSize - 4) because otherwise, there is not enough room for data and headers */ @@ -589,7 +589,7 @@ static uint32_t ee_GetAddrRange(uint32_t address, bool excludeRAMBuffer=false) { } static bool ee_IsPageClean(int page) { - uint32_t* pflash = (uint32_t*) getFlashStorage(page); + uint32_t *pflash = (uint32_t*) getFlashStorage(page); for (uint16_t i = 0; i < (PageSize >> 2); ++i) if (*pflash++ != 0xFFFFFFFF) return false; return true; @@ -599,7 +599,7 @@ static bool ee_Flush(uint32_t overrideAddress = 0xFFFFFFFF, uint8_t overrideData // Check if RAM buffer has something to be written bool isEmpty = true; - uint32_t* p = (uint32_t*) &buffer[0]; + uint32_t *p = (uint32_t*) &buffer[0]; for (uint16_t j = 0; j < (PageSize >> 2); j++) { if (*p++ != 0xFFFFFFFF) { isEmpty = false; diff --git a/Marlin/src/HAL/DUE/usb/udi_cdc.h b/Marlin/src/HAL/DUE/usb/udi_cdc.h index 0ecf7bb00..b61845011 100644 --- a/Marlin/src/HAL/DUE/usb/udi_cdc.h +++ b/Marlin/src/HAL/DUE/usb/udi_cdc.h @@ -675,11 +675,11 @@ iram_size_t udi_cdc_multi_write_buf(uint8_t port, const void* buf, iram_size_t s * - \code // Waits and gets a value on CDC line int udi_cdc_getc(void); // Reads a RAM buffer on CDC line - iram_size_t udi_cdc_read_buf(int* buf, iram_size_t size); + iram_size_t udi_cdc_read_buf(int *buf, iram_size_t size); // Puts a byte on CDC line int udi_cdc_putc(int value); // Writes a RAM buffer on CDC line - iram_size_t udi_cdc_write_buf(const int* buf, iram_size_t size); \endcode + iram_size_t udi_cdc_write_buf(const int *buf, iram_size_t size); \endcode * * \section udi_cdc_use_cases Advanced use cases * For more advanced use of the UDI CDC module, see the following use cases: diff --git a/Marlin/src/HAL/DUE/usb/usb_task.c b/Marlin/src/HAL/DUE/usb/usb_task.c index 66bdb265d..acb1d5b93 100644 --- a/Marlin/src/HAL/DUE/usb/usb_task.c +++ b/Marlin/src/HAL/DUE/usb/usb_task.c @@ -264,7 +264,7 @@ bool usb_task_extra_string(void) { ** Handle device requests that the ASF stack doesn't */ bool usb_task_other_requests(void) { - uint8_t* ptr = 0; + uint8_t *ptr = 0; uint16_t size = 0; if (Udd_setup_type() == USB_REQ_TYPE_VENDOR) { diff --git a/Marlin/src/HAL/ESP32/HAL_SPI.cpp b/Marlin/src/HAL/ESP32/HAL_SPI.cpp index 8ee837ba1..8743ac5be 100644 --- a/Marlin/src/HAL/ESP32/HAL_SPI.cpp +++ b/Marlin/src/HAL/ESP32/HAL_SPI.cpp @@ -85,7 +85,7 @@ uint8_t spiRec() { return returnByte; } -void spiRead(uint8_t* buf, uint16_t nbyte) { +void spiRead(uint8_t *buf, uint16_t nbyte) { SPI.beginTransaction(spiConfig); SPI.transferBytes(0, buf, nbyte); SPI.endTransaction(); @@ -97,7 +97,7 @@ void spiSend(uint8_t b) { SPI.endTransaction(); } -void spiSendBlock(uint8_t token, const uint8_t* buf) { +void spiSendBlock(uint8_t token, const uint8_t *buf) { SPI.beginTransaction(spiConfig); SPI.transfer(token); SPI.writeBytes(const_cast(buf), 512); diff --git a/Marlin/src/HAL/ESP32/WebSocketSerial.cpp b/Marlin/src/HAL/ESP32/WebSocketSerial.cpp index 8825742d3..96769f261 100644 --- a/Marlin/src/HAL/ESP32/WebSocketSerial.cpp +++ b/Marlin/src/HAL/ESP32/WebSocketSerial.cpp @@ -137,7 +137,7 @@ size_t WebSocketSerial::write(const uint8_t c) { return ret; } -size_t WebSocketSerial::write(const uint8_t* buffer, size_t size) { +size_t WebSocketSerial::write(const uint8_t *buffer, size_t size) { size_t written = 0; for (size_t i = 0; i < size; i++) written += write(buffer[i]); diff --git a/Marlin/src/HAL/ESP32/WebSocketSerial.h b/Marlin/src/HAL/ESP32/WebSocketSerial.h index 924d36f15..574f7b10f 100644 --- a/Marlin/src/HAL/ESP32/WebSocketSerial.h +++ b/Marlin/src/HAL/ESP32/WebSocketSerial.h @@ -54,7 +54,7 @@ public: ring_buffer_pos_t read(uint8_t *buffer); void flush(); ring_buffer_pos_t write(const uint8_t c); - ring_buffer_pos_t write(const uint8_t* buffer, ring_buffer_pos_t size); + ring_buffer_pos_t write(const uint8_t *buffer, ring_buffer_pos_t size); }; class WebSocketSerial: public Stream { @@ -70,7 +70,7 @@ public: int read(); void flush(); size_t write(const uint8_t c); - size_t write(const uint8_t* buffer, size_t size); + size_t write(const uint8_t *buffer, size_t size); #if ENABLED(SERIAL_STATS_DROPPED_RX) FORCE_INLINE uint32_t dropped() { return 0; } diff --git a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp index dbc89a33f..99db15f6e 100644 --- a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp +++ b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp @@ -93,12 +93,12 @@ void spiSend(uint8_t b) { (void)spiTransfer(b); } - void spiSend(const uint8_t* buf, size_t nbyte) { + void spiSend(const uint8_t *buf, size_t nbyte) { for (uint16_t i = 0; i < nbyte; i++) (void)spiTransfer(buf[i]); } - void spiSendBlock(uint8_t token, const uint8_t* buf) { + void spiSendBlock(uint8_t token, const uint8_t *buf) { (void)spiTransfer(token); for (uint16_t i = 0; i < 512; i++) (void)spiTransfer(buf[i]); @@ -135,13 +135,13 @@ void spiSend(uint8_t b) { doio(b); } - void spiSend(const uint8_t* buf, size_t nbyte) { + void spiSend(const uint8_t *buf, size_t nbyte) { for (uint16_t i = 0; i < nbyte; i++) doio(buf[i]); } void spiSend(uint32_t chan, byte b) {} - void spiSend(uint32_t chan, const uint8_t* buf, size_t nbyte) {} + void spiSend(uint32_t chan, const uint8_t *buf, size_t nbyte) {} // Read single byte from SPI uint8_t spiRec() { return doio(0xFF); } @@ -156,7 +156,7 @@ uint8_t spiTransfer(uint8_t b) { return doio(b); } // Write from buffer to SPI - void spiSendBlock(uint8_t token, const uint8_t* buf) { + void spiSendBlock(uint8_t token, const uint8_t *buf) { (void)spiTransfer(token); for (uint16_t i = 0; i < 512; i++) (void)spiTransfer(buf[i]); diff --git a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp index 592e27f6c..0b0626de7 100644 --- a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp @@ -66,7 +66,7 @@ void spiBegin(); void spiInit(uint8_t spiRate); void spiSend(uint8_t b); -void spiSend(const uint8_t* buf, size_t n); +void spiSend(const uint8_t *buf, size_t n); static uint8_t rs_last_state = 255; diff --git a/Marlin/src/HAL/SAMD51/HAL_SPI.cpp b/Marlin/src/HAL/SAMD51/HAL_SPI.cpp index c3acd3823..77f4d5ecd 100644 --- a/Marlin/src/HAL/SAMD51/HAL_SPI.cpp +++ b/Marlin/src/HAL/SAMD51/HAL_SPI.cpp @@ -103,7 +103,7 @@ * @param nbyte Number of bytes to receive. * @return Nothing */ - void spiRead(uint8_t* buf, uint16_t nbyte) { + void spiRead(uint8_t *buf, uint16_t nbyte) { if (nbyte == 0) return; memset(buf, 0xFF, nbyte); sdSPI.beginTransaction(spiConfig); @@ -132,7 +132,7 @@ * * @details Uses DMA */ - void spiSendBlock(uint8_t token, const uint8_t* buf) { + void spiSendBlock(uint8_t token, const uint8_t *buf) { sdSPI.beginTransaction(spiConfig); sdSPI.transfer(token); sdSPI.transfer((uint8_t*)buf, nullptr, 512); diff --git a/Marlin/src/HAL/STM32/HAL_SPI.cpp b/Marlin/src/HAL/STM32/HAL_SPI.cpp index c9f23e6fa..80347e115 100644 --- a/Marlin/src/HAL/STM32/HAL_SPI.cpp +++ b/Marlin/src/HAL/STM32/HAL_SPI.cpp @@ -193,7 +193,7 @@ static SPISettings spiConfig; * * @details Uses DMA */ - void spiRead(uint8_t* buf, uint16_t nbyte) { + void spiRead(uint8_t *buf, uint16_t nbyte) { if (nbyte == 0) return; memset(buf, 0xFF, nbyte); SPI.transfer(buf, nbyte); @@ -218,7 +218,7 @@ static SPISettings spiConfig; * * @details Use DMA */ - void spiSendBlock(uint8_t token, const uint8_t* buf) { + void spiSendBlock(uint8_t token, const uint8_t *buf) { uint8_t rxBuf[512]; SPI.transfer(token); SPI.transfer((uint8_t*)buf, &rxBuf, 512); diff --git a/Marlin/src/HAL/STM32/MarlinSerial.h b/Marlin/src/HAL/STM32/MarlinSerial.h index 7b0529cfd..d9e845701 100644 --- a/Marlin/src/HAL/STM32/MarlinSerial.h +++ b/Marlin/src/HAL/STM32/MarlinSerial.h @@ -36,7 +36,7 @@ struct MarlinSerial : public HardwareSerial { void begin(unsigned long baud, uint8_t config); inline void begin(unsigned long baud) { begin(baud, SERIAL_8N1); } - void _rx_complete_irq(serial_t* obj); + void _rx_complete_irq(serial_t *obj); protected: usart_rx_callback_t _rx_callback; diff --git a/Marlin/src/HAL/STM32F1/HAL_SPI.cpp b/Marlin/src/HAL/STM32F1/HAL_SPI.cpp index 7e876f765..abb348d74 100644 --- a/Marlin/src/HAL/STM32F1/HAL_SPI.cpp +++ b/Marlin/src/HAL/STM32F1/HAL_SPI.cpp @@ -123,7 +123,7 @@ uint8_t spiRec() { * * @details Uses DMA */ -void spiRead(uint8_t* buf, uint16_t nbyte) { +void spiRead(uint8_t *buf, uint16_t nbyte) { SPI.dmaTransfer(0, const_cast(buf), nbyte); } @@ -146,7 +146,7 @@ void spiSend(uint8_t b) { * * @details Use DMA */ -void spiSendBlock(uint8_t token, const uint8_t* buf) { +void spiSendBlock(uint8_t token, const uint8_t *buf) { SPI.send(token); SPI.dmaSend(const_cast(buf), 512); } @@ -160,7 +160,7 @@ uint8_t spiRec(uint32_t chan) { return SPI.transfer(0xFF); } void spiSend(uint32_t chan, byte b) { SPI.send(b); } // Write buffer to specified SPI channel -void spiSend(uint32_t chan, const uint8_t* buf, size_t n) { +void spiSend(uint32_t chan, const uint8_t *buf, size_t n) { for (size_t p = 0; p < n; p++) spiSend(chan, buf[p]); } diff --git a/Marlin/src/HAL/STM32F1/eeprom_flash.cpp b/Marlin/src/HAL/STM32F1/eeprom_flash.cpp index dfcaaaf29..e7d9dd29e 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_flash.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_flash.cpp @@ -48,8 +48,8 @@ static uint8_t ram_eeprom[MARLIN_EEPROM_SIZE] __attribute__((aligned(4))) = {0}; static bool eeprom_dirty = false; bool PersistentStore::access_start() { - const uint32_t* source = reinterpret_cast(EEPROM_PAGE0_BASE); - uint32_t* destination = reinterpret_cast(ram_eeprom); + const uint32_t *source = reinterpret_cast(EEPROM_PAGE0_BASE); + uint32_t *destination = reinterpret_cast(ram_eeprom); static_assert(0 == (MARLIN_EEPROM_SIZE) % 4, "MARLIN_EEPROM_SIZE is corrupted. (Must be a multiple of 4.)"); // Ensure copying as uint32_t is safe constexpr size_t eeprom_size_u32 = (MARLIN_EEPROM_SIZE) / 4; diff --git a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp index dce236ef6..21330eaac 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp @@ -82,7 +82,7 @@ uint8_t spiRec() { } // SPI read data -void spiRead(uint8_t* buf, uint16_t nbyte) { +void spiRead(uint8_t *buf, uint16_t nbyte) { SPI.beginTransaction(spiConfig); SPI.transfer(buf, nbyte); SPI.endTransaction(); @@ -107,7 +107,7 @@ void spiSend(uint8_t b) { } // SPI send block -void spiSendBlock(uint8_t token, const uint8_t* buf) { +void spiSendBlock(uint8_t token, const uint8_t *buf) { SPI.beginTransaction(spiConfig); SPDR = token; for (uint16_t i = 0; i < 512; i += 2) { diff --git a/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp index 84852cd35..5b22668fc 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp @@ -80,7 +80,7 @@ uint8_t spiRec() { //return SPDR; } -void spiRead(uint8_t* buf, uint16_t nbyte) { +void spiRead(uint8_t *buf, uint16_t nbyte) { SPI.beginTransaction(spiConfig); SPI.transfer(buf, nbyte); SPI.endTransaction(); @@ -103,7 +103,7 @@ void spiSend(uint8_t b) { //while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } } -void spiSendBlock(uint8_t token, const uint8_t* buf) { +void spiSendBlock(uint8_t token, const uint8_t *buf) { SPI.beginTransaction(spiConfig); SPDR = token; for (uint16_t i = 0; i < 512; i += 2) { diff --git a/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp index 8c9304902..e4335ff74 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp @@ -97,7 +97,7 @@ uint8_t spiRec() { //return SPDR; } -void spiRead(uint8_t* buf, uint16_t nbyte) { +void spiRead(uint8_t *buf, uint16_t nbyte) { SPI.beginTransaction(spiConfig); SPI.transfer(buf, nbyte); SPI.endTransaction(); @@ -120,7 +120,7 @@ void spiSend(uint8_t b) { //while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } } -void spiSendBlock(uint8_t token, const uint8_t* buf) { +void spiSendBlock(uint8_t token, const uint8_t *buf) { SPI.beginTransaction(spiConfig); SPDR = token; for (uint16_t i = 0; i < 512; i += 2) { diff --git a/Marlin/src/HAL/shared/HAL_MinSerial.h b/Marlin/src/HAL/shared/HAL_MinSerial.h index 04643c1ab..3089b8aa0 100644 --- a/Marlin/src/HAL/shared/HAL_MinSerial.h +++ b/Marlin/src/HAL/shared/HAL_MinSerial.h @@ -42,7 +42,7 @@ struct MinSerial { HAL_min_serial_out(ch); } // Send String through UART - static void TX(const char* s) { while (*s) TX(*s++); } + static void TX(const char *s) { while (*s) TX(*s++); } // Send a digit through UART static void TXDigit(uint32_t d) { if (d < 10) TX((char)(d+'0')); diff --git a/Marlin/src/HAL/shared/HAL_SPI.h b/Marlin/src/HAL/shared/HAL_SPI.h index 59af55480..6611f9ec4 100644 --- a/Marlin/src/HAL/shared/HAL_SPI.h +++ b/Marlin/src/HAL/shared/HAL_SPI.h @@ -71,10 +71,10 @@ void spiSend(uint8_t b); uint8_t spiRec(); // Read from SPI into buffer -void spiRead(uint8_t* buf, uint16_t nbyte); +void spiRead(uint8_t *buf, uint16_t nbyte); // Write token and then write from 512 byte buffer to SPI (for SD card) -void spiSendBlock(uint8_t token, const uint8_t* buf); +void spiSendBlock(uint8_t token, const uint8_t *buf); // Begin SPI transaction, set clock, bit order, data mode void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode); @@ -87,7 +87,7 @@ void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode); void spiSend(uint32_t chan, byte b); // Write buffer to specified SPI channel -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); +void spiSend(uint32_t chan, const uint8_t *buf, size_t n); // Read single byte from specified SPI channel uint8_t spiRec(uint32_t chan); diff --git a/Marlin/src/HAL/shared/backtrace/backtrace.cpp b/Marlin/src/HAL/shared/backtrace/backtrace.cpp index 8320f4750..e4ae502a8 100644 --- a/Marlin/src/HAL/shared/backtrace/backtrace.cpp +++ b/Marlin/src/HAL/shared/backtrace/backtrace.cpp @@ -44,7 +44,7 @@ static bool UnwReportOut(void* ctx, const UnwReport* bte) { } #ifdef UNW_DEBUG - void UnwPrintf(const char* format, ...) { + void UnwPrintf(const char *format, ...) { char dest[256]; va_list argptr; va_start(argptr, format); diff --git a/Marlin/src/HAL/shared/eeprom_api.h b/Marlin/src/HAL/shared/eeprom_api.h index 6445f7a4a..1f3863993 100644 --- a/Marlin/src/HAL/shared/eeprom_api.h +++ b/Marlin/src/HAL/shared/eeprom_api.h @@ -45,11 +45,11 @@ public: // Read one or more bytes of data and update the CRC // Return 'true' on read error - static bool read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing=true); + static bool read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing=true); // Write one or more bytes of data // Return 'true' on write error - static inline bool write_data(const int pos, const uint8_t* value, const size_t size=sizeof(uint8_t)) { + static inline bool write_data(const int pos, const uint8_t *value, const size_t size=sizeof(uint8_t)) { int data_pos = pos; uint16_t crc = 0; return write_data(data_pos, value, size, &crc); @@ -61,7 +61,7 @@ public: // Read one or more bytes of data // Return 'true' on read error - static inline bool read_data(const int pos, uint8_t* value, const size_t size=1) { + static inline bool read_data(const int pos, uint8_t *value, const size_t size=1) { int data_pos = pos; uint16_t crc = 0; return read_data(data_pos, value, size, &crc); diff --git a/Marlin/src/HAL/shared/eeprom_if_spi.cpp b/Marlin/src/HAL/shared/eeprom_if_spi.cpp index e162f6fed..6aa6e0909 100644 --- a/Marlin/src/HAL/shared/eeprom_if_spi.cpp +++ b/Marlin/src/HAL/shared/eeprom_if_spi.cpp @@ -55,7 +55,7 @@ static void _eeprom_begin(uint8_t * const pos, const uint8_t cmd) { // Leave the Bus in-use } -uint8_t eeprom_read_byte(uint8_t* pos) { +uint8_t eeprom_read_byte(uint8_t *pos) { _eeprom_begin(pos, CMD_READ); // Set read location and begin transmission const uint8_t v = spiRec(SPI_CHAN_EEPROM1); // After READ a value sits on the Bus diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index d7043ba52..f90099378 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -362,13 +362,13 @@ return *str == '/' ? true : (*str ? containsSlash(str + 1) : false); } // Find the last position of the slash - constexpr const char* findLastSlashPos(const char* str) { + constexpr const char* findLastSlashPos(const char *str) { return *str == '/' ? (str + 1) : findLastSlashPos(str - 1); } // Compile-time evaluation of the last part of a file path // Typically used to shorten the path to file in compiled strings // CompileTimeString::baseName(__FILE__) returns "macros.h" and not /path/to/Marlin/src/core/macros.h - constexpr const char* baseName(const char* str) { + constexpr const char* baseName(const char *str) { return containsSlash(str) ? findLastSlashPos(findStringEnd(str)) : str; } } diff --git a/Marlin/src/core/serial_base.h b/Marlin/src/core/serial_base.h index f8fe3a181..78721c6f1 100644 --- a/Marlin/src/core/serial_base.h +++ b/Marlin/src/core/serial_base.h @@ -108,9 +108,9 @@ struct SerialBase { void flushTX() { CALL_IF_EXISTS(void, static_cast(this), flushTX); } // Glue code here - FORCE_INLINE void write(const char* str) { while (*str) write(*str++); } - FORCE_INLINE void write(const uint8_t* buffer, size_t size) { while (size--) write(*buffer++); } - FORCE_INLINE void print(const char* str) { write(str); } + FORCE_INLINE void write(const char *str) { while (*str) write(*str++); } + FORCE_INLINE void write(const uint8_t *buffer, size_t size) { while (size--) write(*buffer++); } + FORCE_INLINE void print(const char *str) { write(str); } // No default argument to avoid ambiguity NO_INLINE void print(char c, PrintBase base) { printNumber((signed long)c, (uint8_t)base); } NO_INLINE void print(unsigned char c, PrintBase base) { printNumber((unsigned long)c, (uint8_t)base); } diff --git a/Marlin/src/feature/binary_stream.h b/Marlin/src/feature/binary_stream.h index b5d68196a..9eb151b27 100644 --- a/Marlin/src/feature/binary_stream.h +++ b/Marlin/src/feature/binary_stream.h @@ -51,10 +51,10 @@ class SDFileTransferProtocol { private: struct Packet { struct [[gnu::packed]] Open { - static bool validate(char* buffer, size_t length) { + static bool validate(char *buffer, size_t length) { return (length > sizeof(Open) && buffer[length - 1] == '\0'); } - static Open& decode(char* buffer) { + static Open& decode(char *buffer) { data = &buffer[2]; return *reinterpret_cast(buffer); } @@ -67,7 +67,7 @@ private: }; }; - static bool file_open(char* filename) { + static bool file_open(char *filename) { if (!dummy_transfer) { card.mount(); card.openFileWrite(filename); @@ -79,7 +79,7 @@ private: return true; } - static bool file_write(char* buffer, const size_t length) { + static bool file_write(char *buffer, const size_t length) { #if ENABLED(BINARY_STREAM_COMPRESSION) if (compression) { size_t total_processed = 0, processed_count = 0; @@ -150,7 +150,7 @@ public: } } - static void process(uint8_t packet_type, char* buffer, const uint16_t length) { + static void process(uint8_t packet_type, char *buffer, const uint16_t length) { transfer_timeout = millis() + TIMEOUT; switch (static_cast(packet_type)) { case FileTransfer::QUERY: diff --git a/Marlin/src/feature/meatpack.cpp b/Marlin/src/feature/meatpack.cpp index 0742f8235..6803a0de7 100644 --- a/Marlin/src/feature/meatpack.cpp +++ b/Marlin/src/feature/meatpack.cpp @@ -205,7 +205,7 @@ void MeatPack::handle_rx_char(const uint8_t c, const serial_index_t serial_ind) handle_rx_char_inner(c); // Other characters are passed on for MeatPack decoding } -uint8_t MeatPack::get_result_char(char* const __restrict out) { +uint8_t MeatPack::get_result_char(char * const __restrict out) { uint8_t res = 0; if (char_out_count) { res = char_out_count; diff --git a/Marlin/src/feature/meatpack.h b/Marlin/src/feature/meatpack.h index 80f4570e0..2c4c4686d 100644 --- a/Marlin/src/feature/meatpack.h +++ b/Marlin/src/feature/meatpack.h @@ -109,7 +109,7 @@ public: * @param out [in] Output pointer for unpacked/processed data. * @return Number of characters returned. Range from 0 to 2. */ - uint8_t get_result_char(char* const __restrict out); + uint8_t get_result_char(char * const __restrict out); void reset_state(); void report_state(); diff --git a/Marlin/src/feature/mmu/mmu2.cpp b/Marlin/src/feature/mmu/mmu2.cpp index d4238400c..c1c34f8ee 100644 --- a/Marlin/src/feature/mmu/mmu2.cpp +++ b/Marlin/src/feature/mmu/mmu2.cpp @@ -362,7 +362,7 @@ bool MMU2::rx_start() { /** * Check if the data received ends with the given string. */ -bool MMU2::rx_str_P(const char* str) { +bool MMU2::rx_str_P(const char *str) { uint8_t i = strlen(rx_buffer); while (MMU2_SERIAL.available()) { @@ -394,7 +394,7 @@ bool MMU2::rx_str_P(const char* str) { /** * Transfer data to MMU, no argument */ -void MMU2::tx_str_P(const char* str) { +void MMU2::tx_str_P(const char *str) { clear_rx_buffer(); uint8_t len = strlen_P(str); LOOP_L_N(i, len) MMU2_SERIAL.write(pgm_read_byte(str++)); @@ -404,7 +404,7 @@ void MMU2::tx_str_P(const char* str) { /** * Transfer data to MMU, single argument */ -void MMU2::tx_printf_P(const char* format, int argument = -1) { +void MMU2::tx_printf_P(const char *format, int argument = -1) { clear_rx_buffer(); uint8_t len = sprintf_P(tx_buffer, format, argument); LOOP_L_N(i, len) MMU2_SERIAL.write(tx_buffer[i]); @@ -414,7 +414,7 @@ void MMU2::tx_printf_P(const char* format, int argument = -1) { /** * Transfer data to MMU, two arguments */ -void MMU2::tx_printf_P(const char* format, int argument1, int argument2) { +void MMU2::tx_printf_P(const char *format, int argument1, int argument2) { clear_rx_buffer(); uint8_t len = sprintf_P(tx_buffer, format, argument1, argument2); LOOP_L_N(i, len) MMU2_SERIAL.write(tx_buffer[i]); @@ -511,7 +511,7 @@ static void mmu2_not_responding() { * Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load. * Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated. */ - void MMU2::tool_change(const char* special) { + void MMU2::tool_change(const char *special) { if (!enabled) return; set_runout_valid(false); @@ -598,7 +598,7 @@ static void mmu2_not_responding() { * Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load. * Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated. */ - void MMU2::tool_change(const char* special) { + void MMU2::tool_change(const char *special) { if (!enabled) return; set_runout_valid(false); @@ -692,7 +692,7 @@ static void mmu2_not_responding() { * Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load. * Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated. */ - void MMU2::tool_change(const char* special) { + void MMU2::tool_change(const char *special) { if (!enabled) return; set_runout_valid(false); diff --git a/Marlin/src/feature/mmu/mmu2.h b/Marlin/src/feature/mmu/mmu2.h index 4326989a7..079a6ef79 100644 --- a/Marlin/src/feature/mmu/mmu2.h +++ b/Marlin/src/feature/mmu/mmu2.h @@ -45,7 +45,7 @@ public: static void reset(); static void mmu_loop(); static void tool_change(const uint8_t index); - static void tool_change(const char* special); + static void tool_change(const char *special); static uint8_t get_current_tool(); static void set_filament_type(const uint8_t index, const uint8_t type); @@ -56,10 +56,10 @@ public: static bool eject_filament(const uint8_t index, const bool recover); private: - static bool rx_str_P(const char* str); - static void tx_str_P(const char* str); - static void tx_printf_P(const char* format, const int argument); - static void tx_printf_P(const char* format, const int argument1, const int argument2); + static bool rx_str_P(const char *str); + static void tx_str_P(const char *str); + static void tx_printf_P(const char *format, const int argument); + static void tx_printf_P(const char *format, const int argument1, const int argument2); static void clear_rx_buffer(); static bool rx_ok(); diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index 34ae67899..0c35ef665 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -106,7 +106,7 @@ class TFilamentMonitor : public FilamentMonitorBase { // Handle a block completion. RunoutResponseDelayed uses this to // add up the length of filament moved while the filament is out. - static inline void block_completed(const block_t* const b) { + static inline void block_completed(const block_t * const b) { if (enabled) { response.block_completed(b); sensor.block_completed(b); @@ -273,7 +273,7 @@ class FilamentSensorBase { } public: - static inline void block_completed(const block_t* const b) { + static inline void block_completed(const block_t * const b) { // If the sensor wheel has moved since the last call to // this method reset the runout counter for the extruder. if (TEST(motion_detected, b->extruder)) @@ -307,7 +307,7 @@ class FilamentSensorBase { } public: - static inline void block_completed(const block_t* const) {} + static inline void block_completed(const block_t * const) {} static inline void run() { LOOP_L_N(s, NUM_RUNOUT_SENSORS) { @@ -368,7 +368,7 @@ class FilamentSensorBase { runout_mm_countdown[extruder] = runout_distance_mm; } - static inline void block_completed(const block_t* const b) { + static inline void block_completed(const block_t * const b) { if (b->steps.x || b->steps.y || b->steps.z || did_pause_print) { // Allow pause purge move to re-trigger runout state // Only trigger on extrusion with XYZ movement to allow filament change and retract/recover. const uint8_t e = b->extruder; @@ -403,7 +403,7 @@ class FilamentSensorBase { return runout_flags; } - static inline void block_completed(const block_t* const) { } + static inline void block_completed(const block_t * const) { } static inline void filament_present(const uint8_t extruder) { runout_count[extruder] = runout_threshold; diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 7845b01ad..a79909917 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -99,7 +99,7 @@ void GCodeQueue::RingBuffer::commit_command(bool skip_ok * Return true if the command was successfully added. * Return false for a full buffer, or if the 'command' is a comment. */ -bool GCodeQueue::RingBuffer::enqueue(const char* cmd, bool skip_ok/*=true*/ +bool GCodeQueue::RingBuffer::enqueue(const char *cmd, bool skip_ok/*=true*/ #if HAS_MULTI_SERIAL , serial_index_t serial_ind/*=-1*/ #endif @@ -118,7 +118,7 @@ bool GCodeQueue::RingBuffer::enqueue(const char* cmd, bool skip_ok/*=true*/ * Enqueue with Serial Echo * Return true if the command was consumed */ -bool GCodeQueue::enqueue_one(const char* cmd) { +bool GCodeQueue::enqueue_one(const char *cmd) { //SERIAL_ECHOLNPAIR("enqueue_one(\"", cmd, "\")"); if (*cmd == 0 || ISEOL(*cmd)) return true; @@ -187,7 +187,7 @@ bool GCodeQueue::process_injected_command() { * Enqueue and return only when commands are actually enqueued. * Never call this from a G-code handler! */ -void GCodeQueue::enqueue_one_now(const char* cmd) { while (!enqueue_one(cmd)) idle(); } +void GCodeQueue::enqueue_one_now(const char *cmd) { while (!enqueue_one(cmd)) idle(); } /** * Attempt to enqueue a single G-code command diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 4d3ccb364..5df4a0104 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -85,7 +85,7 @@ public: #endif ); - bool enqueue(const char* cmd, bool skip_ok = true + bool enqueue(const char *cmd, bool skip_ok = true #if HAS_MULTI_SERIAL , serial_index_t serial_ind = serial_index_t() #endif @@ -143,7 +143,7 @@ public: /** * Enqueue and return only when commands are actually enqueued */ - static void enqueue_one_now(const char* cmd); + static void enqueue_one_now(const char *cmd); /** * Attempt to enqueue a single G-code command @@ -219,7 +219,7 @@ private: * Enqueue with Serial Echo * Return true on success */ - static bool enqueue_one(const char* cmd); + static bool enqueue_one(const char *cmd); static void gcode_line_error(PGM_P const err, const serial_index_t serial_ind); diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 683c1c088..e18ed7273 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -1076,7 +1076,7 @@ void MarlinUI::draw_status_screen() { } // Draw a menu item with a (potentially) editable value - void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const inStr, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const inStr, const bool pgm) { const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 0; lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2 - vlen); @@ -1088,7 +1088,7 @@ void MarlinUI::draw_status_screen() { } // Low-level draw_edit_screen can be used to draw an edit screen from anyplace - void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { + void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); uint8_t n = lcd_put_u8str_ind_P(0, 1, pstr, itemIndex, itemString, LCD_WIDTH - 1); if (value) { diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index e645a7661..6976bfed2 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -835,7 +835,7 @@ void MarlinUI::draw_status_screen() { } // Draw a menu item with a (potentially) editable value - void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const data, const bool pgm) { if (!PanelDetected) return; const uint8_t vlen = data ? (pgm ? utf8_strlen_P(data) : utf8_strlen(data)) : 0; lcd.setCursor(0, row); @@ -851,7 +851,7 @@ void MarlinUI::draw_status_screen() { // Low-level draw_edit_screen can be used to draw an edit screen from anyplace // This line moves to the last line of the screen for UBL plot screen on the panel side - void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { + void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) { if (!PanelDetected) return; ui.encoder_direction_normal(); const uint8_t y = TERN0(AUTO_BED_LEVELING_UBL, ui.external_control) ? LCD_HEIGHT - 1 : MIDDLE_Y; diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index a3b14d860..c2d2cf43a 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -385,7 +385,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } // Draw a menu item with an editable value - void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const inStr, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const inStr, const bool pgm) { if (mark_as_selected(row, sel)) { const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen((char*)inStr)), pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), inStr) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), (char*)inStr)); @@ -400,7 +400,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } } - void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { + void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); const u8g_uint_t labellen = utf8_strlen_P(pstr), vallen = utf8_strlen(value); diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp index 7f88df7bc..3842611fd 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp @@ -311,7 +311,7 @@ static void setWindow(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_t Ymin, // Used to fill RGB565 (16bits) background inline void memset2(const void *ptr, uint16_t fill, size_t cnt) { - uint16_t* wptr = (uint16_t*)ptr; + uint16_t *wptr = (uint16_t*)ptr; for (size_t i = 0; i < cnt; i += 2) { *wptr = fill; wptr++; } } @@ -346,7 +346,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u #if HAS_LCD_IO static uint16_t bufferA[WIDTH * sq(GRAPHICAL_TFT_UPSCALE)], bufferB[WIDTH * sq(GRAPHICAL_TFT_UPSCALE)]; - uint16_t* buffer = &bufferA[0]; + uint16_t *buffer = &bufferA[0]; #else uint16_t buffer[WIDTH * GRAPHICAL_TFT_UPSCALE]; // 16-bit RGB 565 pixel line buffer #endif @@ -404,7 +404,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u tftio.WriteSequence(buffer, COUNT(bufferA)); #else - uint8_t* bufptr = (uint8_t*) buffer; + uint8_t *bufptr = (uint8_t*) buffer; for (uint8_t i = GRAPHICAL_TFT_UPSCALE; i--;) { LOOP_S_L_N(n, 0, GRAPHICAL_TFT_UPSCALE * 2) { u8g_WriteSequence(u8g, dev, WIDTH, &bufptr[WIDTH * n]); diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp index 8542424d7..1e19bf85e 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp @@ -148,8 +148,8 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo case U8G_DEV_MSG_STOP: break; case U8G_DEV_MSG_PAGE_NEXT: { - uint8_t* ptr; - u8g_pb_t* pb = (u8g_pb_t*)(dev->dev_mem); + uint8_t *ptr; + u8g_pb_t *pb = (u8g_pb_t*)(dev->dev_mem); y = pb->p.page_y0; ptr = (uint8_t*)pb->buf; diff --git a/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp index a585ef670..b4e876ce4 100644 --- a/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp @@ -62,7 +62,7 @@ void (*DGUSScreenHandler::confirm_action_cb)() = nullptr; filament_data_t filament_data; #endif -void DGUSScreenHandler::sendinfoscreen(const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool l4inflash) { +void DGUSScreenHandler::sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool l4inflash) { DGUS_VP_Variable ramcopy; if (populate_VPVar(VP_MSGSTR1, &ramcopy)) { ramcopy.memadr = (void*) line1; @@ -82,7 +82,7 @@ void DGUSScreenHandler::sendinfoscreen(const char* line1, const char* line2, con } } -void DGUSScreenHandler::HandleUserConfirmationPopUp(uint16_t VP, const char* line1, const char* line2, const char* line3, const char* line4, bool l1, bool l2, bool l3, bool l4) { +void DGUSScreenHandler::HandleUserConfirmationPopUp(uint16_t VP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1, bool l2, bool l3, bool l4) { if (current_screen == DGUSLCD_SCREEN_CONFIRM) // Already showing a pop up, so we need to cancel that first. PopToOldScreen(); diff --git a/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSScreenHandler.h b/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSScreenHandler.h index 28ab952e5..24965597a 100644 --- a/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSScreenHandler.h @@ -37,12 +37,12 @@ public: // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifing whether the strings are in RAM or FLASH. - static void sendinfoscreen(const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); // "M117" Message -- msg is a RAM ptr. - static void setstatusmessage(const char* msg); + static void setstatusmessage(const char *msg); // The same for messages from Flash static void setstatusmessagePGM(PGM_P const msg); // Callback for VP "Display wants to change screen on idle printer" diff --git a/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSScreenHandler.h b/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSScreenHandler.h index 28ab952e5..24965597a 100644 --- a/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSScreenHandler.h @@ -37,12 +37,12 @@ public: // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifing whether the strings are in RAM or FLASH. - static void sendinfoscreen(const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); // "M117" Message -- msg is a RAM ptr. - static void setstatusmessage(const char* msg); + static void setstatusmessage(const char *msg); // The same for messages from Flash static void setstatusmessagePGM(PGM_P const msg); // Callback for VP "Display wants to change screen on idle printer" diff --git a/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp index 0efb70b68..d956ec4c5 100644 --- a/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp @@ -61,14 +61,14 @@ uint8_t DGUSLanguageSwitch = 0; // Switch language for MKS DGUS uint32_t swap32(const uint32_t value) { return (value & 0x000000FFU) << 24U | (value & 0x0000FF00U) << 8U | (value & 0x00FF0000U) >> 8U | (value & 0xFF000000U) >> 24U; } #if 0 -void DGUSScreenHandler::sendinfoscreen_ch_mks(const uint16_t* line1, const uint16_t* line2, const uint16_t* line3, const uint16_t* line4) { +void DGUSScreenHandler::sendinfoscreen_ch_mks(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4) { dgusdisplay.WriteVariable(VP_MSGSTR1, line1, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR2, line2, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR3, line3, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR4, line4, 32, true); } -void DGUSScreenHandler::sendinfoscreen_en_mks(const char* line1, const char* line2, const char* line3, const char* line4) { +void DGUSScreenHandler::sendinfoscreen_en_mks(const char *line1, const char *line2, const char *line3, const char *line4) { dgusdisplay.WriteVariable(VP_MSGSTR1, line1, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR2, line2, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR3, line3, 32, true); diff --git a/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.h b/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.h index bfec3c457..dc656326a 100644 --- a/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.h @@ -37,18 +37,18 @@ public: // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifing whether the strings are in RAM or FLASH. - static void sendinfoscreen(const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); #if 0 - static void sendinfoscreen_ch_mks(const uint16_t* line1, const uint16_t* line2, const uint16_t* line3, const uint16_t* line4); - static void sendinfoscreen_en_mks(const char* line1, const char* line2, const char* line3, const char* line4) ; + static void sendinfoscreen_ch_mks(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4); + static void sendinfoscreen_en_mks(const char *line1, const char *line2, const char *line3, const char *line4) ; static void sendinfoscreen_mks(const void* line1, const void* line2, const void* line3, const void* line4,uint16_t language); #endif // "M117" Message -- msg is a RAM ptr. - static void setstatusmessage(const char* msg); + static void setstatusmessage(const char *msg); // The same for messages from Flash static void setstatusmessagePGM(PGM_P const msg); // Callback for VP "Display wants to change screen on idle printer" diff --git a/Marlin/src/lcd/extui/lib/dgus/origin/DGUSScreenHandler.h b/Marlin/src/lcd/extui/lib/dgus/origin/DGUSScreenHandler.h index 28ab952e5..24965597a 100644 --- a/Marlin/src/lcd/extui/lib/dgus/origin/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/lib/dgus/origin/DGUSScreenHandler.h @@ -37,12 +37,12 @@ public: // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifing whether the strings are in RAM or FLASH. - static void sendinfoscreen(const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); // "M117" Message -- msg is a RAM ptr. - static void setstatusmessage(const char* msg); + static void setstatusmessage(const char *msg); // The same for messages from Flash static void setstatusmessagePGM(PGM_P const msg); // Callback for VP "Display wants to change screen on idle printer" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp index 9868492d8..ab6057970 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp @@ -26,7 +26,7 @@ #include "media_file_reader.h" #if ENABLED(SDSUPPORT) - bool MediaFileReader::open(const char* filename) { + bool MediaFileReader::open(const char *filename) { card.init(SD_SPI_SPEED, SDSS); volume.init(&card); root.openRoot(&volume); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h index be393a952..d9edea838 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h @@ -38,7 +38,7 @@ class MediaFileReader { #endif public: - bool open(const char* filename); + bool open(const char *filename); int16_t read(void *buff, size_t bytes); uint32_t size(); void rewind(); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp index 006cbe872..30f778e9f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp @@ -103,12 +103,12 @@ namespace FTDI { #endif void SPI::spi_read_bulk(void *data, uint16_t len) { - uint8_t* p = (uint8_t *)data; + uint8_t *p = (uint8_t *)data; while (len--) *p++ = spi_recv(); } bool SPI::spi_verify_bulk(const void *data, uint16_t len) { - const uint8_t* p = (const uint8_t *)data; + const uint8_t *p = (const uint8_t *)data; while (len--) if (*p++ != spi_recv()) return false; return true; } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h index e3a23d768..7adf7e9c5 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h @@ -116,14 +116,14 @@ namespace FTDI { template void spi_write_bulk(const void *data, uint16_t len, uint8_t padding) { - const uint8_t* p = (const uint8_t *)data; + const uint8_t *p = (const uint8_t *)data; while (len--) spi_send(byte_op(p++)); while (padding--) spi_send(0); } template void spi_write_bulk(const void *data, uint16_t len) { - const uint8_t* p = (const uint8_t *)data; + const uint8_t *p = (const uint8_t *)data; while (len--) spi_send(byte_op(p++)); } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h index 20df15a91..2ddab1b81 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h @@ -24,7 +24,7 @@ class SoundList { private: static PROGMEM const struct list_t { - const char *const PROGMEM name; + const char * const PROGMEM name; const FTDI::SoundPlayer::sound_t* data; } list[]; public: diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp index f48448eb8..47bf79e46 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp @@ -62,7 +62,7 @@ namespace FTDI { timer.start(); } - void SoundPlayer::play(const sound_t* seq, play_mode_t mode) { + void SoundPlayer::play(const sound_t *seq, play_mode_t mode) { sequence = seq; wait = 250; // Adding this delay causes the note to not be clipped, not sure why. timer.start(); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h index fcfe70bd7..3ba39b8c5 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h @@ -55,7 +55,7 @@ namespace FTDI { static void play(effect_t effect, note_t note = NOTE_C4); static bool is_sound_playing(); - void play(const sound_t* seq, play_mode_t mode = PLAY_SYNCHRONOUS); + void play(const sound_t *seq, play_mode_t mode = PLAY_SYNCHRONOUS); void play_tone(const uint16_t frequency_hz, const uint16_t duration_ms); bool has_more_notes() {return sequence != 0;}; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp index 5fc89f1fa..6a58dd2e4 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp @@ -47,7 +47,7 @@ namespace FTDI { break; } #else - for (char* c = str; *c; c++) { + for (char *c = str; *c; c++) { lineWidth += fm.get_char_width(*c); if (lineWidth + ellipsisWidth < w) breakPoint = c; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp index 902ede025..d8abfcd29 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp @@ -71,7 +71,7 @@ namespace ExtUI { AlertDialogBox::showError(F("Unable to read media.")); } - void onStatusChanged(const char* lcd_msg) { + void onStatusChanged(const char *lcd_msg) { StatusScreen::setStatusMessage(lcd_msg); } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp index 7f81d49a2..a812f0f3d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp @@ -34,7 +34,7 @@ using namespace Theme; #define GRID_COLS 2 #define GRID_ROWS 9 -void BioPrintingDialogBox::draw_status_message(draw_mode_t what, const char* message) { +void BioPrintingDialogBox::draw_status_message(draw_mode_t what, const char *message) { if (what & BACKGROUND) { CommandProcessor cmd; cmd.cmd(COLOR_RGB(bg_text_enabled)) @@ -113,7 +113,7 @@ void BioPrintingDialogBox::setStatusMessage(progmem_str message) { setStatusMessage(buff); } -void BioPrintingDialogBox::setStatusMessage(const char* message) { +void BioPrintingDialogBox::setStatusMessage(const char *message) { CommandProcessor cmd; cmd.cmd(CMD_DLSTART) .cmd(CLEAR_COLOR_RGB(bg_color)) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp index e3892217a..d51401505 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp @@ -56,7 +56,7 @@ void ConfirmUserRequestAlertBox::onIdle() { } } -void ConfirmUserRequestAlertBox::show(const char* msg) { +void ConfirmUserRequestAlertBox::show(const char *msg) { drawMessage(msg); storeBackground(); screen_data.AlertDialogBox.isError = false; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp index c8febfd7d..f9057ae88 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp @@ -76,7 +76,7 @@ uint16_t FilesScreen::getFileForTag(uint8_t tag) { #define GRID_ROWS (files_per_page + header_h + footer_h) #endif -void FilesScreen::drawFileButton(const char* filename, uint8_t tag, bool is_dir, bool is_highlighted) { +void FilesScreen::drawFileButton(const char *filename, uint8_t tag, bool is_dir, bool is_highlighted) { const uint8_t line = getLineForTag(tag)+1; CommandProcessor cmd; cmd.tag(tag); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.h index a4fb37cc1..06ae88a45 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.h @@ -60,7 +60,7 @@ class FilesScreen : public BaseScreen, public CachedScreen -void j_move_axis(const char* command, const T axis) { +void j_move_axis(const char *command, const T axis) { const float dist = atof(command + 1) / 10.0; ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(axis) + dist, axis); }; -void process_lcd_j_command(const char* command) { +void process_lcd_j_command(const char *command) { switch (command[0]) { case 'E': break; case 'A': j_move_axis(command, ExtUI::extruder_t::E0); break; @@ -241,7 +241,7 @@ void process_lcd_j_command(const char* command) { * T:-2537.4 E:0 * Note only the curly brace stuff matters. */ -void process_lcd_p_command(const char* command) { +void process_lcd_p_command(const char *command) { switch (command[0]) { case 'P': @@ -301,7 +301,7 @@ void process_lcd_p_command(const char* command) { * {FILE:fcupdate.flg} * {SYS:OK} */ -void process_lcd_s_command(const char* command) { +void process_lcd_s_command(const char *command) { switch (command[0]) { case 'I': { // temperature information @@ -348,7 +348,7 @@ void process_lcd_s_command(const char* command) { * Currently {E:0} is not handled. Its function is unknown, * but it occurs during the temp window after a sys build. */ -void process_lcd_command(const char* command) { +void process_lcd_command(const char *command) { const char *current = command; byte command_code = *current++; diff --git a/Marlin/src/lcd/lcdprint.h b/Marlin/src/lcd/lcdprint.h index 90ffa14ad..fe856535b 100644 --- a/Marlin/src/lcd/lcdprint.h +++ b/Marlin/src/lcd/lcdprint.h @@ -161,7 +161,7 @@ inline lcd_uint_t lcd_put_u8str_ind_P(const lcd_uint_t col, const lcd_uint_t row return lcd_put_u8str_ind_P(pstr, ind, inStr, maxlen); } -inline int lcd_put_u8str(const char* str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); } +inline int lcd_put_u8str(const char *str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); } inline int lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, PGM_P const str) { lcd_moveto(col, row); return lcd_put_u8str(str); diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index f85771f56..57e6fc26e 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -292,7 +292,7 @@ public: static bool has_status(); static void reset_status(const bool no_welcome=false); - static void set_status(const char* const message, const bool persist=false); + static void set_status(const char * const message, const bool persist=false); static void set_status_P(PGM_P const message, const int8_t level=0); static void status_printf_P(const uint8_t level, PGM_P const fmt, ...); static void set_alert_status_P(PGM_P const message); @@ -300,7 +300,7 @@ public: #else static constexpr bool has_status() { return false; } static inline void reset_status(const bool=false) {} - static void set_status(const char* message, const bool=false); + static void set_status(const char *message, const bool=false); static void set_status_P(PGM_P message, const int8_t=0); static void status_printf_P(const uint8_t, PGM_P message, ...); static inline void set_alert_status_P(PGM_P const) {} diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index de11ee3a5..cbef9b50c 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -172,14 +172,14 @@ class MenuEditItemBase : public MenuItemBase { public: // Implemented for HD44780 and DOGM // Draw the current item at specified row with edit data - static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const inStr, const bool pgm=false); + static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const inStr, const bool pgm=false); // Implemented for HD44780 and DOGM // This low-level method is good to draw from anywhere - static void draw_edit_screen(PGM_P const pstr, const char* const value); + static void draw_edit_screen(PGM_P const pstr, const char * const value); // This method is for the current menu item - static inline void draw_edit_screen(const char* const value) { draw_edit_screen(editLabel, value); } + static inline void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); } }; #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 37a44f51b..793ee6084 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -326,7 +326,7 @@ void MarlinUI::draw_status_screen() { } // Low-level draw_edit_screen can be used to draw an edit screen from anyplace -void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { +void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); TERN_(TOUCH_SCREEN, touch.clear()); diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 81e4603ea..a8979d0ca 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -326,7 +326,7 @@ void MarlinUI::draw_status_screen() { } // Low-level draw_edit_screen can be used to draw an edit screen from anyplace -void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { +void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); TERN_(TOUCH_SCREEN, touch.clear()); @@ -779,7 +779,7 @@ static void disable_steppers() { queue.inject_P(PSTR("M84")); } -static void drawBtn(int x, int y, const char* label, intptr_t data, MarlinImage img, uint16_t bgColor, bool enabled = true) { +static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage img, uint16_t bgColor, bool enabled = true) { uint16_t width = Images[imgBtn52Rounded].width; uint16_t height = Images[imgBtn52Rounded].height; diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp index 842fc3909..7c053e7be 100644 --- a/Marlin/src/lcd/tft/ui_common.cpp +++ b/Marlin/src/lcd/tft/ui_common.cpp @@ -131,7 +131,7 @@ void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, co } // Draw a menu item with a (potentially) editable value -void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm) { +void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const data, const bool pgm) { menu_item(row, sel); tft_string.set(pstr, itemIndex, itemString); diff --git a/Marlin/src/libs/W25Qxx.cpp b/Marlin/src/libs/W25Qxx.cpp index 0eb40a144..fd7804cb2 100644 --- a/Marlin/src/libs/W25Qxx.cpp +++ b/Marlin/src/libs/W25Qxx.cpp @@ -106,7 +106,7 @@ uint8_t W25QXXFlash::spi_flash_read_write_byte(uint8_t data) { * * @details Uses DMA */ -void W25QXXFlash::spi_flash_Read(uint8_t* buf, uint16_t nbyte) { +void W25QXXFlash::spi_flash_Read(uint8_t *buf, uint16_t nbyte) { mySPI.dmaTransfer(0, const_cast(buf), nbyte); } @@ -127,7 +127,7 @@ void W25QXXFlash::spi_flash_Send(uint8_t b) { mySPI.transfer(b); } * * @details Use DMA */ -void W25QXXFlash::spi_flash_SendBlock(uint8_t token, const uint8_t* buf) { +void W25QXXFlash::spi_flash_SendBlock(uint8_t token, const uint8_t *buf) { mySPI.transfer(token); mySPI.dmaSend(const_cast(buf), 512); } @@ -257,7 +257,7 @@ void W25QXXFlash::SPI_FLASH_BulkErase(void) { * Output : None * Return : None *******************************************************************************/ -void W25QXXFlash::SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite) { +void W25QXXFlash::SPI_FLASH_PageWrite(uint8_t *pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite) { // Enable the write access to the FLASH SPI_FLASH_WriteEnable(); @@ -300,7 +300,7 @@ void W25QXXFlash::SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint * Output : None * Return : None *******************************************************************************/ -void W25QXXFlash::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite) { +void W25QXXFlash::SPI_FLASH_BufferWrite(uint8_t *pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite) { uint8_t NumOfPage = 0, NumOfSingle = 0, Addr = 0, count = 0, temp = 0; Addr = WriteAddr % SPI_FLASH_PageSize; @@ -364,7 +364,7 @@ void W25QXXFlash::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, ui * Output : None * Return : None *******************************************************************************/ -void W25QXXFlash::SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) { +void W25QXXFlash::SPI_FLASH_BufferRead(uint8_t *pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) { // Select the FLASH: Chip Select low W25QXX_CS_L; diff --git a/Marlin/src/libs/W25Qxx.h b/Marlin/src/libs/W25Qxx.h index eddae6b1f..1133af2e7 100644 --- a/Marlin/src/libs/W25Qxx.h +++ b/Marlin/src/libs/W25Qxx.h @@ -57,18 +57,18 @@ public: void init(uint8_t spiRate); static uint8_t spi_flash_Rec(); static uint8_t spi_flash_read_write_byte(uint8_t data); - static void spi_flash_Read(uint8_t* buf, uint16_t nbyte); + static void spi_flash_Read(uint8_t *buf, uint16_t nbyte); static void spi_flash_Send(uint8_t b); - static void spi_flash_SendBlock(uint8_t token, const uint8_t* buf); + static void spi_flash_SendBlock(uint8_t token, const uint8_t *buf); static uint16_t W25QXX_ReadID(void); static void SPI_FLASH_WriteEnable(void); static void SPI_FLASH_WaitForWriteEnd(void); static void SPI_FLASH_SectorErase(uint32_t SectorAddr); static void SPI_FLASH_BlockErase(uint32_t BlockAddr); static void SPI_FLASH_BulkErase(void); - static void SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); - static void SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); - static void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead); + static void SPI_FLASH_PageWrite(uint8_t *pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); + static void SPI_FLASH_BufferWrite(uint8_t *pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); + static void SPI_FLASH_BufferRead(uint8_t *pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead); }; extern W25QXXFlash W25QXX; diff --git a/Marlin/src/libs/softspi.h b/Marlin/src/libs/softspi.h index 5d48f9fd8..fb02de865 100644 --- a/Marlin/src/libs/softspi.h +++ b/Marlin/src/libs/softspi.h @@ -715,7 +715,7 @@ class SoftSPI { FORCE_INLINE bool MODE_CPHA(uint8_t mode) { return bool(mode & 1); } FORCE_INLINE bool MODE_CPOL(uint8_t mode) { return bool(mode & 2); } - FORCE_INLINE void receiveBit(uint8_t bit, uint8_t* data) { + FORCE_INLINE void receiveBit(uint8_t bit, uint8_t *data) { if (MODE_CPHA(Mode)) fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); nop; nop; @@ -734,7 +734,7 @@ class SoftSPI { if (!MODE_CPHA(Mode)) fastDigitalWrite(SckPin, MODE_CPOL(Mode)); } - FORCE_INLINE void transferBit(uint8_t bit, uint8_t* rxData, uint8_t txData) { + FORCE_INLINE void transferBit(uint8_t bit, uint8_t *rxData, uint8_t txData) { if (MODE_CPHA(Mode)) fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); fastDigitalWrite(MosiPin, txData & _BV(bit)); fastDigitalWrite(SckPin, diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index b20d1e273..832d6e316 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -381,7 +381,7 @@ void Planner::init() { r9 = (d >> 8) & 0xFF, r10 = (d >> 16) & 0xFF, r2,r3,r4,r5,r6,r7,r11,r12,r13,r14,r15,r16,r17,r18; - const uint8_t* ptab = inv_tab; + const uint8_t *ptab = inv_tab; __asm__ __volatile__( // %8:%7:%6 = interval @@ -775,7 +775,7 @@ block_t* Planner::get_current_block() { * is not and will not use the block while we modify it, so it is safe to * alter its values. */ -void Planner::calculate_trapezoid_for_block(block_t* const block, const float &entry_factor, const float &exit_factor) { +void Planner::calculate_trapezoid_for_block(block_t * const block, const float &entry_factor, const float &exit_factor) { uint32_t initial_rate = CEIL(block->nominal_rate * entry_factor), final_rate = CEIL(block->nominal_rate * exit_factor); // (steps per second) @@ -942,7 +942,7 @@ void Planner::calculate_trapezoid_for_block(block_t* const block, const float &e */ // The kernel called by recalculate() when scanning the plan from last to first entry. -void Planner::reverse_pass_kernel(block_t* const current, const block_t * const next) { +void Planner::reverse_pass_kernel(block_t * const current, const block_t * const next) { if (current) { // If entry speed is already at the maximum entry speed, and there was no change of speed // in the next block, there is no need to recheck. Block is cruising and there is no need to @@ -1039,7 +1039,7 @@ void Planner::reverse_pass() { } // The kernel called by recalculate() when scanning the plan from first to last entry. -void Planner::forward_pass_kernel(const block_t* const previous, block_t* const current, const uint8_t block_index) { +void Planner::forward_pass_kernel(const block_t * const previous, block_t * const current, const uint8_t block_index) { if (previous) { // If the previous block is an acceleration block, too short to complete the full speed // change, adjust the entry speed accordingly. Entry speeds have already been reset, @@ -1440,7 +1440,7 @@ void Planner::check_axes_activity() { float high = 0.0; for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { - block_t* block = &block_buffer[b]; + block_t *block = &block_buffer[b]; if (block->steps.x || block->steps.y || block->steps.z) { const float se = (float)block->steps.e / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec; NOLESS(high, se); diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index da9e202cd..768bf29e2 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -993,10 +993,10 @@ class Planner { } #endif - static void calculate_trapezoid_for_block(block_t* const block, const float &entry_factor, const float &exit_factor); + static void calculate_trapezoid_for_block(block_t * const block, const float &entry_factor, const float &exit_factor); - static void reverse_pass_kernel(block_t* const current, const block_t * const next); - static void forward_pass_kernel(const block_t * const previous, block_t* const current, uint8_t block_index); + static void reverse_pass_kernel(block_t * const current, const block_t * const next); + static void forward_pass_kernel(const block_t * const previous, block_t * const current, uint8_t block_index); static void reverse_pass(); static void forward_pass(); diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 49eca7047..8c377bf7b 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2362,7 +2362,7 @@ uint32_t Stepper::block_phase_isr() { // Check if the given block is busy or not - Must not be called from ISR contexts // The current_block could change in the middle of the read by an Stepper ISR, so // we must explicitly prevent that! -bool Stepper::is_block_busy(const block_t* const block) { +bool Stepper::is_block_busy(const block_t * const block) { #ifdef __AVR__ // A SW memory barrier, to ensure GCC does not overoptimize loops #define sw_barrier() asm volatile("": : :"memory"); @@ -2372,7 +2372,7 @@ bool Stepper::is_block_busy(const block_t* const block) { // This works because stepper ISRs happen at a slower rate than // successive reads of a variable, so 2 consecutive reads with // the same value means no interrupt updated it. - block_t* vold, *vnew = current_block; + block_t *vold, *vnew = current_block; sw_barrier(); do { vold = vnew; diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 639a1b265..ca1781fb9 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -423,7 +423,7 @@ class Stepper { #endif // Check if the given block is busy or not - Must not be called from ISR contexts - static bool is_block_busy(const block_t* const block); + static bool is_block_busy(const block_t * const block); // Get the position of a stepper, in steps static int32_t position(const AxisEnum axis); @@ -529,7 +529,7 @@ class Stepper { static void _set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e); FORCE_INLINE static void _set_position(const abce_long_t &spos) { _set_position(spos.a, spos.b, spos.c, spos.e); } - FORCE_INLINE static uint32_t calc_timer_interval(uint32_t step_rate, uint8_t* loops) { + FORCE_INLINE static uint32_t calc_timer_interval(uint32_t step_rate, uint8_t *loops) { uint32_t timer; // Scale the frequency, as requested by the caller diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp index c33581d13..de3d45e4b 100644 --- a/Marlin/src/module/stepper/trinamic.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -830,11 +830,11 @@ void reset_trinamic_drivers() { } constexpr bool sc_hw_done(size_t start, size_t end) { return start == end; } - constexpr bool sc_hw_skip(const char* port_name) { return !(*port_name); } - constexpr bool sc_hw_match(const char* port_name, uint32_t address, size_t start, size_t end) { + constexpr bool sc_hw_skip(const char *port_name) { return !(*port_name); } + constexpr bool sc_hw_match(const char *port_name, uint32_t address, size_t start, size_t end) { return !sc_hw_done(start, end) && !sc_hw_skip(port_name) && (address == sanity_tmc_hw_details[start].address && str_eq_ce(port_name, sanity_tmc_hw_details[start].port)); } - constexpr int count_tmc_hw_serial_matches(const char* port_name, uint32_t address, size_t start, size_t end) { + constexpr int count_tmc_hw_serial_matches(const char *port_name, uint32_t address, size_t start, size_t end) { return sc_hw_done(start, end) ? 0 : ((sc_hw_skip(port_name) ? 0 : (sc_hw_match(port_name, address, start, end) ? 1 : 0)) + count_tmc_hw_serial_matches(port_name, address, start + 1, end)); } diff --git a/Marlin/src/sd/Sd2Card.cpp b/Marlin/src/sd/Sd2Card.cpp index 491c0692c..b914b2963 100644 --- a/Marlin/src/sd/Sd2Card.cpp +++ b/Marlin/src/sd/Sd2Card.cpp @@ -63,7 +63,7 @@ 0x0E,0x07,0x1C,0x15,0x2A,0x23,0x38,0x31,0x46,0x4F,0x54,0x5D,0x62,0x6B,0x70,0x79 }; - static uint8_t CRC7(const uint8_t* data, uint8_t n) { + static uint8_t CRC7(const uint8_t *data, uint8_t n) { uint8_t crc = 0; while (n > 0) { crc = pgm_read_byte(&crctab7[ (crc << 1) ^ *data++ ]); @@ -72,7 +72,7 @@ return (crc << 1) | 1; } #else - static uint8_t CRC7(const uint8_t* data, uint8_t n) { + static uint8_t CRC7(const uint8_t *data, uint8_t n) { uint8_t crc = 0; LOOP_L_N(i, n) { uint8_t d = data[i]; @@ -338,7 +338,7 @@ bool Sd2Card::init(const uint8_t sckRateID, const pin_t chipSelectPin) { * \param[out] dst Pointer to the location that will receive the data. * \return true for success, false for failure. */ -bool Sd2Card::readBlock(uint32_t blockNumber, uint8_t* dst) { +bool Sd2Card::readBlock(uint32_t blockNumber, uint8_t *dst) { #if IS_TEENSY_35_36 || IS_TEENSY_40_41 return 0 == SDHC_CardReadBlock(dst, blockNumber); #endif @@ -378,7 +378,7 @@ bool Sd2Card::readBlock(uint32_t blockNumber, uint8_t* dst) { * * \return true for success, false for failure. */ -bool Sd2Card::readData(uint8_t* dst) { +bool Sd2Card::readData(uint8_t *dst) { chipSelect(); return readData(dst, 512); } @@ -421,7 +421,7 @@ bool Sd2Card::readData(uint8_t* dst) { }; // faster CRC-CCITT // uses the x^16,x^12,x^5,x^1 polynomial. - static uint16_t CRC_CCITT(const uint8_t* data, size_t n) { + static uint16_t CRC_CCITT(const uint8_t *data, size_t n) { uint16_t crc = 0; for (size_t i = 0; i < n; i++) { crc = pgm_read_word(&crctab16[(crc >> 8 ^ data[i]) & 0xFF]) ^ (crc << 8); @@ -431,7 +431,7 @@ bool Sd2Card::readData(uint8_t* dst) { #else // slower CRC-CCITT // uses the x^16,x^12,x^5,x^1 polynomial. - static uint16_t CRC_CCITT(const uint8_t* data, size_t n) { + static uint16_t CRC_CCITT(const uint8_t *data, size_t n) { uint16_t crc = 0; for (size_t i = 0; i < n; i++) { crc = (uint8_t)(crc >> 8) | (crc << 8); @@ -445,7 +445,7 @@ bool Sd2Card::readData(uint8_t* dst) { #endif #endif // SD_CHECK_AND_RETRY -bool Sd2Card::readData(uint8_t* dst, const uint16_t count) { +bool Sd2Card::readData(uint8_t *dst, const uint16_t count) { bool success = false; const millis_t read_timeout = millis() + SD_READ_TIMEOUT; @@ -478,7 +478,7 @@ bool Sd2Card::readData(uint8_t* dst, const uint16_t count) { /** read CID or CSR register */ bool Sd2Card::readRegister(const uint8_t cmd, void* buf) { - uint8_t* dst = reinterpret_cast(buf); + uint8_t *dst = reinterpret_cast(buf); if (cardCommand(cmd, 0)) { error(SD_CARD_ERROR_READ_REG); chipDeselect(); @@ -555,7 +555,7 @@ bool Sd2Card::waitNotBusy(const millis_t timeout_ms) { * \param[in] src Pointer to the location of the data to be written. * \return true for success, false for failure. */ -bool Sd2Card::writeBlock(uint32_t blockNumber, const uint8_t* src) { +bool Sd2Card::writeBlock(uint32_t blockNumber, const uint8_t *src) { if (ENABLED(SDCARD_READONLY)) return false; #if IS_TEENSY_35_36 || IS_TEENSY_40_41 @@ -586,7 +586,7 @@ bool Sd2Card::writeBlock(uint32_t blockNumber, const uint8_t* src) { * \param[in] src Pointer to the location of the data to be written. * \return true for success, false for failure. */ -bool Sd2Card::writeData(const uint8_t* src) { +bool Sd2Card::writeData(const uint8_t *src) { if (ENABLED(SDCARD_READONLY)) return false; bool success = true; @@ -601,7 +601,7 @@ bool Sd2Card::writeData(const uint8_t* src) { } // Send one block of data for write block or write multiple blocks -bool Sd2Card::writeData(const uint8_t token, const uint8_t* src) { +bool Sd2Card::writeData(const uint8_t token, const uint8_t *src) { if (ENABLED(SDCARD_READONLY)) return false; const uint16_t crc = TERN(SD_CHECK_AND_RETRY, CRC_CCITT(src, 512), 0xFFFF); diff --git a/Marlin/src/sd/Sd2Card.h b/Marlin/src/sd/Sd2Card.h index 6900502e0..d82cb10a1 100644 --- a/Marlin/src/sd/Sd2Card.h +++ b/Marlin/src/sd/Sd2Card.h @@ -124,7 +124,7 @@ public: */ bool init(const uint8_t sckRateID, const pin_t chipSelectPin); - bool readBlock(uint32_t block, uint8_t* dst); + bool readBlock(uint32_t block, uint8_t *dst); /** * Read a card's CID register. The CID contains card identification @@ -135,7 +135,7 @@ public: * * \return true for success or false for failure. */ - bool readCID(cid_t* cid) { return readRegister(CMD10, cid); } + bool readCID(cid_t *cid) { return readRegister(CMD10, cid); } /** * Read a card's CSD register. The CSD contains Card-Specific Data that @@ -145,9 +145,9 @@ public: * * \return true for success or false for failure. */ - inline bool readCSD(csd_t* csd) { return readRegister(CMD9, csd); } + inline bool readCSD(csd_t *csd) { return readRegister(CMD9, csd); } - bool readData(uint8_t* dst); + bool readData(uint8_t *dst); bool readStart(uint32_t blockNumber); bool readStop(); bool setSckRate(const uint8_t sckRateID); @@ -157,8 +157,8 @@ public: * \return 0 - SD V1, 1 - SD V2, or 3 - SDHC. */ int type() const {return type_;} - bool writeBlock(uint32_t blockNumber, const uint8_t* src); - bool writeData(const uint8_t* src); + bool writeBlock(uint32_t blockNumber, const uint8_t *src); + bool writeData(const uint8_t *src); bool writeStart(uint32_t blockNumber, const uint32_t eraseCount); bool writeStop(); @@ -176,11 +176,11 @@ private: } uint8_t cardCommand(const uint8_t cmd, const uint32_t arg); - bool readData(uint8_t* dst, const uint16_t count); + bool readData(uint8_t *dst, const uint16_t count); bool readRegister(const uint8_t cmd, void* buf); void chipDeselect(); void chipSelect(); inline void type(const uint8_t value) { type_ = value; } bool waitNotBusy(const millis_t timeout_ms); - bool writeData(const uint8_t token, const uint8_t* src); + bool writeData(const uint8_t token, const uint8_t *src); }; diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 3cd88318f..120668baa 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -43,7 +43,7 @@ SdBaseFile* SdBaseFile::cwd_ = 0; // Pointer to Current Working Directory // callback function for date/time -void (*SdBaseFile::dateTime_)(uint16_t* date, uint16_t* time) = 0; +void (*SdBaseFile::dateTime_)(uint16_t *date, uint16_t *time) = 0; // add a cluster to a file bool SdBaseFile::addCluster() { @@ -118,7 +118,7 @@ bool SdBaseFile::close() { * Reasons for failure include file is not contiguous, file has zero length * or an I/O error occurred. */ -bool SdBaseFile::contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock) { +bool SdBaseFile::contiguousRange(uint32_t *bgnBlock, uint32_t *endBlock) { // error if no blocks if (firstCluster_ == 0) return false; @@ -155,7 +155,7 @@ bool SdBaseFile::contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock) { * a file is already open, the file already exists, the root * directory is full or an I/O error. */ -bool SdBaseFile::createContiguous(SdBaseFile* dirFile, const char* path, uint32_t size) { +bool SdBaseFile::createContiguous(SdBaseFile* dirFile, const char *path, uint32_t size) { if (ENABLED(SDCARD_READONLY)) return false; uint32_t count; @@ -186,8 +186,8 @@ bool SdBaseFile::createContiguous(SdBaseFile* dirFile, const char* path, uint32_ * * \return true for success, false for failure. */ -bool SdBaseFile::dirEntry(dir_t* dir) { - dir_t* p; +bool SdBaseFile::dirEntry(dir_t *dir) { + dir_t *p; // make sure fields on SD are correct if (!sync()) return false; @@ -207,7 +207,7 @@ bool SdBaseFile::dirEntry(dir_t* dir) { * \param[in] dir The directory structure containing the name. * \param[out] name A 13 byte char array for the formatted name. */ -void SdBaseFile::dirName(const dir_t& dir, char* name) { +void SdBaseFile::dirName(const dir_t& dir, char *name) { uint8_t j = 0; LOOP_L_N(i, 11) { if (dir.name[i] == ' ')continue; @@ -229,7 +229,7 @@ void SdBaseFile::dirName(const dir_t& dir, char* name) { * * \return true if the file exists else false. */ -bool SdBaseFile::exists(const char* name) { +bool SdBaseFile::exists(const char *name) { SdBaseFile file; return file.open(this, name, O_READ); } @@ -254,7 +254,7 @@ bool SdBaseFile::exists(const char* name) { * \return For success fgets() returns the length of the string in \a str. * If no data is read, fgets() returns zero for EOF or -1 if an error occurred. **/ -int16_t SdBaseFile::fgets(char* str, int16_t num, char* delim) { +int16_t SdBaseFile::fgets(char *str, int16_t num, char *delim) { char ch; int16_t n = 0; int16_t r = -1; @@ -293,7 +293,7 @@ bool SdBaseFile::getDosName(char * const name) { return true; } // cache entry - dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); + dir_t *p = cacheDirEntry(SdVolume::CACHE_FOR_READ); if (!p) return false; // format name @@ -301,7 +301,7 @@ bool SdBaseFile::getDosName(char * const name) { return true; } -void SdBaseFile::getpos(filepos_t* pos) { +void SdBaseFile::getpos(filepos_t *pos) { pos->position = curPosition_; pos->cluster = curCluster_; } @@ -386,7 +386,7 @@ int8_t SdBaseFile::lsPrintNext(uint8_t flags, uint8_t indent) { } // Format directory name field from a 8.3 name string -bool SdBaseFile::make83Name(const char* str, uint8_t* name, const char** ptr) { +bool SdBaseFile::make83Name(const char *str, uint8_t *name, const char** ptr) { uint8_t n = 7, // Max index until a dot is found i = 11; while (i) name[--i] = ' '; // Set whole FILENAME.EXT to spaces @@ -423,7 +423,7 @@ bool SdBaseFile::make83Name(const char* str, uint8_t* name, const char** ptr) { * Reasons for failure include this file is already open, \a parent is not a * directory, \a path is invalid or already exists in \a parent. */ -bool SdBaseFile::mkdir(SdBaseFile* parent, const char* path, bool pFlag) { +bool SdBaseFile::mkdir(SdBaseFile* parent, const char *path, bool pFlag) { if (ENABLED(SDCARD_READONLY)) return false; uint8_t dname[11]; @@ -460,7 +460,7 @@ bool SdBaseFile::mkdir(SdBaseFile* parent, const uint8_t dname[11]) { uint32_t block; dir_t d; - dir_t* p; + dir_t *p; if (!parent->isDir()) return false; @@ -523,7 +523,7 @@ bool SdBaseFile::mkdir(SdBaseFile* parent, const uint8_t dname[11]) { * * \return true for success, false for failure. */ -bool SdBaseFile::open(const char* path, uint8_t oflag) { +bool SdBaseFile::open(const char *path, uint8_t oflag) { return open(cwd_, path, oflag); } @@ -577,7 +577,7 @@ bool SdBaseFile::open(const char* path, uint8_t oflag) { * a directory, \a path is invalid, the file does not exist * or can't be opened in the access mode specified by oflag. */ -bool SdBaseFile::open(SdBaseFile* dirFile, const char* path, uint8_t oflag) { +bool SdBaseFile::open(SdBaseFile* dirFile, const char *path, uint8_t oflag) { uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile, *sub = &dir1; @@ -608,7 +608,7 @@ bool SdBaseFile::open(SdBaseFile* dirFile, const char* path, uint8_t oflag) { bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false, fileFound = false; uint8_t index; - dir_t* p; + dir_t *p; vol_ = dirFile->vol_; @@ -697,7 +697,7 @@ bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t ofla * \return true for success or false for failure. */ bool SdBaseFile::open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag) { - dir_t* p; + dir_t *p; vol_ = dirFile->vol_; @@ -725,7 +725,7 @@ bool SdBaseFile::open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag) { // open a cached directory entry. Assumes vol_ is initialized bool SdBaseFile::openCachedEntry(uint8_t dirIndex, uint8_t oflag) { - dir_t* p; + dir_t *p; #if ENABLED(SDCARD_READONLY) if (oflag & (O_WRITE | O_CREAT | O_TRUNC)) goto FAIL; @@ -785,7 +785,7 @@ bool SdBaseFile::openCachedEntry(uint8_t dirIndex, uint8_t oflag) { * \return true for success or false for failure. */ bool SdBaseFile::openNext(SdBaseFile* dirFile, uint8_t oflag) { - dir_t* p; + dir_t *p; uint8_t index; if (!dirFile) return false; @@ -827,7 +827,7 @@ bool SdBaseFile::openNext(SdBaseFile* dirFile, uint8_t oflag) { */ bool SdBaseFile::openParent(SdBaseFile* dir) { dir_t entry; - dir_t* p; + dir_t *p; SdBaseFile file; uint32_t c; uint32_t cluster; @@ -1009,7 +1009,7 @@ int16_t SdBaseFile::read() { * or an I/O error occurred. */ int16_t SdBaseFile::read(void* buf, uint16_t nbyte) { - uint8_t* dst = reinterpret_cast(buf); + uint8_t *dst = reinterpret_cast(buf); uint16_t offset, toRead; uint32_t block; // raw device block number @@ -1049,7 +1049,7 @@ int16_t SdBaseFile::read(void* buf, uint16_t nbyte) { else { // read block to cache and copy data to caller if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_READ)) return -1; - uint8_t* src = vol_->cache()->data + offset; + uint8_t *src = vol_->cache()->data + offset; memcpy(dst, src, n); } dst += n; @@ -1070,7 +1070,7 @@ int16_t SdBaseFile::read(void* buf, uint16_t nbyte) { * readDir() called before a directory has been opened, this is not * a directory file or an I/O error occurred. */ -int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { +int8_t SdBaseFile::readDir(dir_t *dir, char *longFilename) { int16_t n; // if not a directory file or miss-positioned return an error if (!isDir() || (0x1F & curPosition_)) return -1; @@ -1096,7 +1096,7 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { // Fill the long filename if we have a long filename entry. // Long filename entries are stored before the short filename. if (longFilename && DIR_IS_LONG_NAME(dir)) { - vfat_t* VFAT = (vfat_t*)dir; + vfat_t *VFAT = (vfat_t*)dir; // Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0 if (VFAT->firstClusterLow == 0) { const uint8_t seq = VFAT->sequenceNumber & 0x1F; @@ -1199,7 +1199,7 @@ dir_t* SdBaseFile::readDirCache() { bool SdBaseFile::remove() { if (ENABLED(SDCARD_READONLY)) return false; - dir_t* d; + dir_t *d; // free any clusters - will fail if read-only or directory if (!truncate(0)) return false; @@ -1235,7 +1235,7 @@ bool SdBaseFile::remove() { * \a dirFile is not a directory, \a path is not found * or an I/O error occurred. */ -bool SdBaseFile::remove(SdBaseFile* dirFile, const char* path) { +bool SdBaseFile::remove(SdBaseFile* dirFile, const char *path) { if (ENABLED(SDCARD_READONLY)) return false; SdBaseFile file; @@ -1252,13 +1252,13 @@ bool SdBaseFile::remove(SdBaseFile* dirFile, const char* path) { * Reasons for failure include \a dirFile is not open or is not a directory * file, newPath is invalid or already exists, or an I/O error occurs. */ -bool SdBaseFile::rename(SdBaseFile* dirFile, const char* newPath) { +bool SdBaseFile::rename(SdBaseFile* dirFile, const char *newPath) { if (ENABLED(SDCARD_READONLY)) return false; dir_t entry; uint32_t dirCluster = 0; SdBaseFile file; - dir_t* d; + dir_t *d; // must be an open file or subdirectory if (!(isFile() || isSubDir())) return false; @@ -1356,7 +1356,7 @@ bool SdBaseFile::rmdir() { // make sure directory is empty while (curPosition_ < fileSize_) { - dir_t* p = readDirCache(); + dir_t *p = readDirCache(); if (!p) return false; // done if past last used entry if (p->name[0] == DIR_NAME_FREE) break; @@ -1396,7 +1396,7 @@ bool SdBaseFile::rmRfStar() { // remember position index = curPosition_ / 32; - dir_t* p = readDirCache(); + dir_t *p = readDirCache(); if (!p) return false; // done if past last entry @@ -1438,7 +1438,7 @@ bool SdBaseFile::rmRfStar() { * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive * OR of open flags. see SdBaseFile::open(SdBaseFile*, const char*, uint8_t). */ -SdBaseFile::SdBaseFile(const char* path, uint8_t oflag) { +SdBaseFile::SdBaseFile(const char *path, uint8_t oflag) { type_ = FAT_FILE_TYPE_CLOSED; writeError = false; open(path, oflag); @@ -1481,7 +1481,7 @@ bool SdBaseFile::seekSet(const uint32_t pos) { return true; } -void SdBaseFile::setpos(filepos_t* pos) { +void SdBaseFile::setpos(filepos_t *pos) { curPosition_ = pos->position; curCluster_ = pos->cluster; } @@ -1499,7 +1499,7 @@ bool SdBaseFile::sync() { if (ENABLED(SDCARD_READONLY) || !isOpen()) goto FAIL; if (flags_ & F_FILE_DIR_DIRTY) { - dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); + dir_t *d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto FAIL; @@ -1537,7 +1537,7 @@ bool SdBaseFile::sync() { * \return true for success, false for failure. */ bool SdBaseFile::timestamp(SdBaseFile* file) { - dir_t* d; + dir_t *d; dir_t dir; // get timestamps @@ -1599,7 +1599,7 @@ bool SdBaseFile::timestamp(uint8_t flags, uint16_t year, uint8_t month, if (ENABLED(SDCARD_READONLY)) return false; uint16_t dirDate, dirTime; - dir_t* d; + dir_t *d; if (!isOpen() || year < 1980 @@ -1716,7 +1716,7 @@ int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) { #endif // convert void* to uint8_t* - must be before goto statements - const uint8_t* src = reinterpret_cast(buf); + const uint8_t *src = reinterpret_cast(buf); // number of bytes left to write - must be before goto statements uint16_t nToWrite = nbyte; @@ -1782,7 +1782,7 @@ int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) { // rewrite part of block if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto FAIL; } - uint8_t* dst = vol_->cache()->data + blockOffset; + uint8_t *dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; diff --git a/Marlin/src/sd/SdBaseFile.h b/Marlin/src/sd/SdBaseFile.h index 2f7dfb9f3..1e2bc5d09 100644 --- a/Marlin/src/sd/SdBaseFile.h +++ b/Marlin/src/sd/SdBaseFile.h @@ -163,7 +163,7 @@ uint16_t const FAT_DEFAULT_TIME = (1 << 11); class SdBaseFile { public: SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} - SdBaseFile(const char* path, uint8_t oflag); + SdBaseFile(const char *path, uint8_t oflag); ~SdBaseFile() { if (isOpen()) close(); } /** @@ -179,18 +179,18 @@ class SdBaseFile { * get position for streams * \param[out] pos struct to receive position */ - void getpos(filepos_t* pos); + void getpos(filepos_t *pos); /** * set position for streams * \param[out] pos struct with value for new position */ - void setpos(filepos_t* pos); + void setpos(filepos_t *pos); bool close(); - bool contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock); + bool contiguousRange(uint32_t *bgnBlock, uint32_t *endBlock); bool createContiguous(SdBaseFile* dirFile, - const char* path, uint32_t size); + const char *path, uint32_t size); /** * \return The current cluster number for a file or directory. */ @@ -213,7 +213,7 @@ class SdBaseFile { * function is of the form: * * \code - * void dateTime(uint16_t* date, uint16_t* time) { + * void dateTime(uint16_t *date, uint16_t *time) { * uint16_t year; * uint8_t month, day, hour, minute, second; * @@ -235,7 +235,7 @@ class SdBaseFile { * See the timestamp() function. */ static void dateTimeCallback( - void (*dateTime)(uint16_t* date, uint16_t* time)) { + void (*dateTime)(uint16_t *date, uint16_t *time)) { dateTime_ = dateTime; } @@ -243,10 +243,10 @@ class SdBaseFile { * Cancel the date/time callback function. */ static void dateTimeCallbackCancel() { dateTime_ = 0; } - bool dirEntry(dir_t* dir); - static void dirName(const dir_t& dir, char* name); - bool exists(const char* name); - int16_t fgets(char* str, int16_t num, char* delim = 0); + bool dirEntry(dir_t *dir); + static void dirName(const dir_t& dir, char *name); + bool exists(const char *name); + int16_t fgets(char *str, int16_t num, char *delim = 0); /** * \return The total number of bytes in a file or directory. @@ -286,10 +286,10 @@ class SdBaseFile { bool getDosName(char * const name); void ls(uint8_t flags = 0, uint8_t indent = 0); - bool mkdir(SdBaseFile* dir, const char* path, bool pFlag = true); + bool mkdir(SdBaseFile* dir, const char *path, bool pFlag = true); bool open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag); - bool open(SdBaseFile* dirFile, const char* path, uint8_t oflag); - bool open(const char* path, uint8_t oflag = O_READ); + bool open(SdBaseFile* dirFile, const char *path, uint8_t oflag); + bool open(const char *path, uint8_t oflag = O_READ); bool openNext(SdBaseFile* dirFile, uint8_t oflag); bool openRoot(SdVolume* vol); int peek(); @@ -298,15 +298,15 @@ class SdBaseFile { bool printName(); int16_t read(); int16_t read(void* buf, uint16_t nbyte); - int8_t readDir(dir_t* dir, char* longFilename); - static bool remove(SdBaseFile* dirFile, const char* path); + int8_t readDir(dir_t *dir, char *longFilename); + static bool remove(SdBaseFile* dirFile, const char *path); bool remove(); /** * Set the file's current position to zero. */ void rewind() { seekSet(0); } - bool rename(SdBaseFile* dirFile, const char* newPath); + bool rename(SdBaseFile* dirFile, const char *newPath); bool rmdir(); bool rmRfStar(); @@ -348,7 +348,7 @@ class SdBaseFile { static SdBaseFile* cwd_; // global pointer to cwd dir // data time callback function - static void (*dateTime_)(uint16_t* date, uint16_t* time); + static void (*dateTime_)(uint16_t *date, uint16_t *time); // bits defined in flags_ static uint8_t const F_OFLAG = (O_ACCMODE | O_APPEND | O_SYNC), // should be 0x0F @@ -376,7 +376,7 @@ class SdBaseFile { bool addDirCluster(); dir_t* cacheDirEntry(uint8_t action); int8_t lsPrintNext(uint8_t flags, uint8_t indent); - static bool make83Name(const char* str, uint8_t* name, const char** ptr); + static bool make83Name(const char *str, uint8_t *name, const char** ptr); bool mkdir(SdBaseFile* parent, const uint8_t dname[11]); bool open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag); bool openCachedEntry(uint8_t cacheIndex, uint8_t oflags); diff --git a/Marlin/src/sd/SdFatStructs.h b/Marlin/src/sd/SdFatStructs.h index ac81f1d64..03bbc1c19 100644 --- a/Marlin/src/sd/SdFatStructs.h +++ b/Marlin/src/sd/SdFatStructs.h @@ -571,7 +571,7 @@ uint8_t const DIR_NAME_0xE5 = 0x05, // escape for name[0] = 0xE5 * * \return true if the entry is for part of a long name else false. */ -static inline uint8_t DIR_IS_LONG_NAME(const dir_t* dir) { +static inline uint8_t DIR_IS_LONG_NAME(const dir_t *dir) { return (dir->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME; } @@ -584,7 +584,7 @@ uint8_t const DIR_ATT_FILE_TYPE_MASK = (DIR_ATT_VOLUME_ID | DIR_ATT_DIRECTORY); * * \return true if the entry is for a normal file else false. */ -static inline uint8_t DIR_IS_FILE(const dir_t* dir) { +static inline uint8_t DIR_IS_FILE(const dir_t *dir) { return (dir->attributes & DIR_ATT_FILE_TYPE_MASK) == 0; } @@ -594,7 +594,7 @@ static inline uint8_t DIR_IS_FILE(const dir_t* dir) { * * \return true if the entry is for a subdirectory else false. */ -static inline uint8_t DIR_IS_SUBDIR(const dir_t* dir) { +static inline uint8_t DIR_IS_SUBDIR(const dir_t *dir) { return (dir->attributes & DIR_ATT_FILE_TYPE_MASK) == DIR_ATT_DIRECTORY; } @@ -604,6 +604,6 @@ static inline uint8_t DIR_IS_SUBDIR(const dir_t* dir) { * * \return true if the entry is for a normal file or subdirectory else false. */ -static inline uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t* dir) { +static inline uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t *dir) { return (dir->attributes & DIR_ATT_VOLUME_ID) == 0; } diff --git a/Marlin/src/sd/SdFile.cpp b/Marlin/src/sd/SdFile.cpp index cba67e2bb..cc86ce819 100644 --- a/Marlin/src/sd/SdFile.cpp +++ b/Marlin/src/sd/SdFile.cpp @@ -43,7 +43,7 @@ * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive * OR of open flags. see SdBaseFile::open(SdBaseFile*, const char*, uint8_t). */ -SdFile::SdFile(const char* path, uint8_t oflag) : SdBaseFile(path, oflag) { } +SdFile::SdFile(const char *path, uint8_t oflag) : SdBaseFile(path, oflag) { } /** * Write data to an open file. @@ -78,7 +78,7 @@ int16_t SdFile::write(const void* buf, uint16_t nbyte) { return SdBaseFile::writ * \param[in] str Pointer to the string. * Use writeError to check for errors. */ -void SdFile::write(const char* str) { SdBaseFile::write(str, strlen(str)); } +void SdFile::write(const char *str) { SdBaseFile::write(str, strlen(str)); } /** * Write a PROGMEM string to a file. diff --git a/Marlin/src/sd/SdFile.h b/Marlin/src/sd/SdFile.h index 17256b47c..69fe05b49 100644 --- a/Marlin/src/sd/SdFile.h +++ b/Marlin/src/sd/SdFile.h @@ -42,7 +42,7 @@ class SdFile : public SdBaseFile { public: SdFile() {} - SdFile(const char* name, uint8_t oflag); + SdFile(const char *name, uint8_t oflag); #if ARDUINO >= 100 size_t write(uint8_t b); #else @@ -50,7 +50,7 @@ class SdFile : public SdBaseFile { #endif int16_t write(const void* buf, uint16_t nbyte); - void write(const char* str); + void write(const char *str); void write_P(PGM_P str); void writeln_P(PGM_P str); }; diff --git a/Marlin/src/sd/SdVolume.cpp b/Marlin/src/sd/SdVolume.cpp index e262c8867..7fcebd640 100644 --- a/Marlin/src/sd/SdVolume.cpp +++ b/Marlin/src/sd/SdVolume.cpp @@ -47,7 +47,7 @@ #endif // USE_MULTIPLE_CARDS // find a contiguous group of clusters -bool SdVolume::allocContiguous(uint32_t count, uint32_t* curCluster) { +bool SdVolume::allocContiguous(uint32_t count, uint32_t *curCluster) { if (ENABLED(SDCARD_READONLY)) return false; // start of group @@ -149,7 +149,7 @@ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { } // return the size in bytes of a cluster chain -bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { +bool SdVolume::chainSize(uint32_t cluster, uint32_t *size) { uint32_t s = 0; do { if (!fatGet(cluster, &cluster)) return false; @@ -160,7 +160,7 @@ bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { } // Fetch a FAT entry -bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { +bool SdVolume::fatGet(uint32_t cluster, uint32_t *value) { uint32_t lba; if (cluster > (clusterCount_ + 1)) return false; if (FAT12_SUPPORT && fatType_ == 12) { @@ -328,7 +328,7 @@ int32_t SdVolume::freeClusterCount() { */ bool SdVolume::init(Sd2Card* dev, uint8_t part) { uint32_t totalBlocks, volumeStartBlock = 0; - fat32_boot_t* fbs; + fat32_boot_t *fbs; sdCard_ = dev; fatType_ = 0; @@ -342,7 +342,7 @@ bool SdVolume::init(Sd2Card* dev, uint8_t part) { if (part) { if (part > 4) return false; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) return false; - part_t* p = &cacheBuffer_.mbr.part[part - 1]; + part_t *p = &cacheBuffer_.mbr.part[part - 1]; if ((p->boot & 0x7F) != 0 || p->totalSectors < 100 || p->firstSector == 0) return false; // not a valid partition volumeStartBlock = p->firstSector; diff --git a/Marlin/src/sd/SdVolume.h b/Marlin/src/sd/SdVolume.h index 2d57c681c..812208745 100644 --- a/Marlin/src/sd/SdVolume.h +++ b/Marlin/src/sd/SdVolume.h @@ -124,7 +124,7 @@ class SdVolume { * \param[out] v value of entry * \return true for success or false for failure */ - bool dbgFat(uint32_t n, uint32_t* v) { return fatGet(n, v); } + bool dbgFat(uint32_t n, uint32_t *v) { return fatGet(n, v); } private: // Allow SdBaseFile access to SdVolume private data. @@ -161,7 +161,7 @@ class SdVolume { uint16_t rootDirEntryCount_; // number of entries in FAT16 root dir uint32_t rootDirStart_; // root start block for FAT16, cluster for FAT32 - bool allocContiguous(uint32_t count, uint32_t* curCluster); + bool allocContiguous(uint32_t count, uint32_t *curCluster); uint8_t blockOfCluster(uint32_t position) const { return (position >> 9) & (blocksPerCluster_ - 1); } uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_); } uint32_t blockNumber(uint32_t cluster, uint32_t position) const { return clusterStartBlock(cluster) + blockOfCluster(position); } @@ -183,8 +183,8 @@ class SdVolume { cacheBlockNumber_ = blockNumber; } void cacheSetDirty() { cacheDirty_ |= CACHE_FOR_WRITE; } - bool chainSize(uint32_t beginCluster, uint32_t* size); - bool fatGet(uint32_t cluster, uint32_t* value); + bool chainSize(uint32_t beginCluster, uint32_t *size); + bool fatGet(uint32_t cluster, uint32_t *value); bool fatPut(uint32_t cluster, uint32_t value); bool fatPutEOC(uint32_t cluster) { return fatPut(cluster, 0x0FFFFFFF); } bool freeChain(uint32_t cluster); @@ -193,6 +193,6 @@ class SdVolume { if (fatType_ == 16) return cluster >= FAT16EOC_MIN; return cluster >= FAT32EOC_MIN; } - bool readBlock(uint32_t block, uint8_t* dst) { return sdCard_->readBlock(block, dst); } - bool writeBlock(uint32_t block, const uint8_t* dst) { return sdCard_->writeBlock(block, dst); } + bool readBlock(uint32_t block, uint8_t *dst) { return sdCard_->readBlock(block, dst); } + bool writeBlock(uint32_t block, const uint8_t *dst) { return sdCard_->writeBlock(block, dst); } }; diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 4399d9a4b..1f917f857 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -122,7 +122,7 @@ public: // Select a file static void selectFileByIndex(const uint16_t nr); - static void selectFileByName(const char* const match); + static void selectFileByName(const char * const match); // Print job static void openAndPrintFile(const char *name); // (working directory) diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp index 6dc706312..dc9efcb67 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp @@ -295,7 +295,7 @@ uint32_t Sd2Card::cardSize() { return lun0_capacity; } -bool Sd2Card::readBlock(uint32_t block, uint8_t* dst) { +bool Sd2Card::readBlock(uint32_t block, uint8_t *dst) { if (!isInserted()) return false; #if USB_DEBUG >= 3 if (block >= lun0_capacity) { @@ -309,7 +309,7 @@ bool Sd2Card::readBlock(uint32_t block, uint8_t* dst) { return bulk.Read(0, block, 512, 1, dst) == 0; } -bool Sd2Card::writeBlock(uint32_t block, const uint8_t* src) { +bool Sd2Card::writeBlock(uint32_t block, const uint8_t *src) { if (!isInserted()) return false; #if USB_DEBUG >= 3 if (block >= lun0_capacity) { diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h index 578912136..320678d09 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h @@ -60,15 +60,15 @@ class Sd2Card { static void idle(); inline bool readStart(const uint32_t block) { pos = block; return isReady(); } - inline bool readData(uint8_t* dst) { return readBlock(pos++, dst); } + inline bool readData(uint8_t *dst) { return readBlock(pos++, dst); } inline bool readStop() const { return true; } inline bool writeStart(const uint32_t block, const uint32_t) { pos = block; return isReady(); } - inline bool writeData(uint8_t* src) { return writeBlock(pos++, src); } + inline bool writeData(uint8_t *src) { return writeBlock(pos++, src); } inline bool writeStop() const { return true; } - bool readBlock(uint32_t block, uint8_t* dst); - bool writeBlock(uint32_t blockNumber, const uint8_t* src); + bool readBlock(uint32_t block, uint8_t *dst); + bool writeBlock(uint32_t blockNumber, const uint8_t *src); bool readCSD(csd_t*) { return true; } diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp index f26e82b9c..75421f448 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp @@ -133,7 +133,7 @@ uint8_t USB::SetAddress(uint8_t addr, uint8_t ep, EpInfo **ppep, uint16_t *nak_l /* 00 = success */ /* 01-0f = non-zero HRSLT */ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, - uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t* dataptr, USBReadParser *p) { + uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p) { bool direction = false; // Request direction, IN or OUT uint8_t rcode; SETUP_PKT setup_pkt; @@ -201,7 +201,7 @@ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bReque * Keep sending INs and writes data to memory area pointed by 'data' * rcode 0 if no errors. rcode 01-0f is relayed from dispatchPkt(). Rcode f0 means RCVDAVIRQ error, fe = USB xfer timeout */ -uint8_t USB::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data, uint8_t bInterval /*= 0*/) { +uint8_t USB::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data, uint8_t bInterval /*= 0*/) { EpInfo *pep = nullptr; uint16_t nak_limit = 0; @@ -215,7 +215,7 @@ uint8_t USB::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* return InTransfer(pep, nak_limit, nbytesptr, data, bInterval); } -uint8_t USB::InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t* data, uint8_t bInterval /*= 0*/) { +uint8_t USB::InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t *data, uint8_t bInterval /*= 0*/) { uint8_t rcode = 0; uint8_t pktsize; @@ -286,7 +286,7 @@ uint8_t USB::InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, ui * Handles NAK bug per Maxim Application Note 4000 for single buffer transfer * rcode 0 if no errors. rcode 01-0f is relayed from HRSL */ -uint8_t USB::outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data) { +uint8_t USB::outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data) { EpInfo *pep = nullptr; uint16_t nak_limit = 0; @@ -743,12 +743,12 @@ uint8_t USB::ReleaseDevice(uint8_t addr) { } // Get device descriptor -uint8_t USB::getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr) { +uint8_t USB::getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr) { return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes, nbytes, dataptr, nullptr); } // Get configuration descriptor -uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) { +uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr) { return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, nbytes, dataptr, nullptr); } @@ -774,7 +774,7 @@ uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser } // Get string descriptor -uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t ns, uint8_t index, uint16_t langid, uint8_t* dataptr) { +uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t ns, uint8_t index, uint16_t langid, uint8_t *dataptr) { return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, ns, ns, dataptr, nullptr); } diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h index d94958dd5..5c76ffb75 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h @@ -250,19 +250,19 @@ public: uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo* eprecord_ptr); /* Control requests */ - uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr); - uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr); + uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr); + uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr); uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser *p); - uint8_t getStrDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t* dataptr); + uint8_t getStrDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t *dataptr); uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr); uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value); /**/ - uint8_t ctrlData(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr, bool direction); + uint8_t ctrlData(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr, bool direction); uint8_t ctrlStatus(uint8_t ep, bool direction, uint16_t nak_limit); - uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data, uint8_t bInterval = 0); - uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data); + uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data, uint8_t bInterval = 0); + uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data); uint8_t dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit); void Task(); @@ -272,7 +272,7 @@ public: uint8_t ReleaseDevice(uint8_t addr); uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, - uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t* dataptr, USBReadParser *p); + uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p); private: void init(); @@ -285,17 +285,17 @@ private: #if 0 //defined(USB_METHODS_INLINE) //get device descriptor -inline uint8_t USB::getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr) { +inline uint8_t USB::getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr) { return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes, dataptr)); } //get configuration descriptor -inline uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) { +inline uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr) { return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, dataptr)); } //get string descriptor -inline uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t nuint8_ts, uint8_t index, uint16_t langid, uint8_t* dataptr) { +inline uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t nuint8_ts, uint8_t index, uint16_t langid, uint8_t *dataptr) { return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, nuint8_ts, dataptr)); } //set address diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp index 190a0f1a9..4ee206bc3 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp @@ -51,7 +51,7 @@ void MAX3421e::regWr(uint8_t reg, uint8_t data) { // multiple-byte write // return a pointer to memory position after last written -uint8_t* MAX3421e::bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p) { +uint8_t* MAX3421e::bytesWr(uint8_t reg, uint8_t nbytes, uint8_t *data_p) { cs(); spiSend(reg | 0x02); while (nbytes--) spiSend(*data_p++); @@ -79,7 +79,7 @@ uint8_t MAX3421e::regRd(uint8_t reg) { // multiple-byte register read // return a pointer to a memory position after last read -uint8_t* MAX3421e::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p) { +uint8_t* MAX3421e::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t *data_p) { cs(); spiSend(reg); while (nbytes--) *data_p++ = spiRec(); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h index 5c3b852d5..cbdd28185 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h @@ -37,10 +37,10 @@ class MAX3421e { bool start(); void regWr(uint8_t reg, uint8_t data); - uint8_t* bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p); + uint8_t* bytesWr(uint8_t reg, uint8_t nbytes, uint8_t *data_p); void gpioWr(uint8_t data); uint8_t regRd(uint8_t reg); - uint8_t* bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p); + uint8_t* bytesRd(uint8_t reg, uint8_t nbytes, uint8_t *data_p); uint8_t gpioRd(); bool reset(); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h index 4ab1a6b8f..3f758e771 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h @@ -594,7 +594,7 @@ void UHS_USB_HOST_BASE::ReleaseDevice(uint8_t addr) { * @param dataptr pointer to the data to return * @return status of the request, zero is success. */ -uint8_t UHS_USB_HOST_BASE::getDevDescr(uint8_t addr, uint16_t nbytes, uint8_t* dataptr) { +uint8_t UHS_USB_HOST_BASE::getDevDescr(uint8_t addr, uint16_t nbytes, uint8_t *dataptr) { return ( ctrlReq(addr, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes), nbytes, dataptr)); } @@ -607,7 +607,7 @@ uint8_t UHS_USB_HOST_BASE::getDevDescr(uint8_t addr, uint16_t nbytes, uint8_t* d * @param dataptr ointer to the data to return * @return status of the request, zero is success. */ -uint8_t UHS_USB_HOST_BASE::getConfDescr(uint8_t addr, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) { +uint8_t UHS_USB_HOST_BASE::getConfDescr(uint8_t addr, uint16_t nbytes, uint8_t conf, uint8_t *dataptr) { return ( ctrlReq(addr, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes), nbytes, dataptr)); } @@ -621,7 +621,7 @@ uint8_t UHS_USB_HOST_BASE::getConfDescr(uint8_t addr, uint16_t nbytes, uint8_t c * @param dataptr pointer to the data to return * @return status of the request, zero is success. */ -uint8_t UHS_USB_HOST_BASE::getStrDescr(uint8_t addr, uint16_t ns, uint8_t index, uint16_t langid, uint8_t* dataptr) { +uint8_t UHS_USB_HOST_BASE::getStrDescr(uint8_t addr, uint16_t ns, uint8_t index, uint16_t langid, uint8_t *dataptr) { return ( ctrlReq(addr, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, ns), ns, dataptr)); } @@ -668,7 +668,7 @@ uint8_t UHS_USB_HOST_BASE::setConf(uint8_t addr, uint8_t conf_value) { * @param data pointer to buffer to hold transfer * @return zero for success or error code */ -uint8_t UHS_USB_HOST_BASE::outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data) { +uint8_t UHS_USB_HOST_BASE::outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data) { UHS_EpInfo *pep = NULL; uint16_t nak_limit = 0; HOST_DEBUG("outTransfer: addr: 0x%2.2x ep: 0x%2.2x nbytes: 0x%4.4x data: 0x%p\r\n", addr, ep, nbytes, data); @@ -689,7 +689,7 @@ uint8_t UHS_USB_HOST_BASE::outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes * @param data pointer to buffer to hold transfer * @return zero for success or error code */ -uint8_t UHS_USB_HOST_BASE::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data) { +uint8_t UHS_USB_HOST_BASE::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data) { UHS_EpInfo *pep = NULL; uint16_t nak_limit = 0; @@ -980,7 +980,7 @@ uint8_t UHS_USB_HOST_BASE::eat(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, return rcode; } -uint8_t UHS_USB_HOST_BASE::ctrlReq(uint8_t addr, uint64_t Request, uint16_t nbytes, uint8_t* dataptr) { +uint8_t UHS_USB_HOST_BASE::ctrlReq(uint8_t addr, uint64_t Request, uint16_t nbytes, uint8_t *dataptr) { //bool direction = bmReqType & 0x80; //request direction, IN or OUT uint8_t rcode = 0; diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h index b289a896e..b81dbf2a2 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h @@ -103,7 +103,7 @@ public: return (current_state == usb_task_state); }; - virtual UHS_EpInfo * UHS_NI ctrlReqOpen(NOTUSED(uint8_t addr), NOTUSED(uint64_t Request), NOTUSED(uint8_t* dataptr)) { + virtual UHS_EpInfo * UHS_NI ctrlReqOpen(NOTUSED(uint8_t addr), NOTUSED(uint64_t Request), NOTUSED(uint8_t *dataptr)) { return NULL; }; @@ -213,17 +213,17 @@ public: uint8_t UHS_NI EPClearHalt(uint8_t addr, uint8_t ep); - uint8_t UHS_NI ctrlReq(uint8_t addr, uint64_t Request, uint16_t nbytes, uint8_t* dataptr); + uint8_t UHS_NI ctrlReq(uint8_t addr, uint64_t Request, uint16_t nbytes, uint8_t *dataptr); - uint8_t UHS_NI getDevDescr(uint8_t addr, uint16_t nbytes, uint8_t* dataptr); + uint8_t UHS_NI getDevDescr(uint8_t addr, uint16_t nbytes, uint8_t *dataptr); - uint8_t UHS_NI getConfDescr(uint8_t addr, uint16_t nbytes, uint8_t conf, uint8_t* dataptr); + uint8_t UHS_NI getConfDescr(uint8_t addr, uint16_t nbytes, uint8_t conf, uint8_t *dataptr); uint8_t UHS_NI setAddr(uint8_t oldaddr, uint8_t newaddr); uint8_t UHS_NI setConf(uint8_t addr, uint8_t conf_value); - uint8_t UHS_NI getStrDescr(uint8_t addr, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t* dataptr); + uint8_t UHS_NI getStrDescr(uint8_t addr, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t *dataptr); void UHS_NI ReleaseDevice(uint8_t addr); @@ -262,8 +262,8 @@ public: uint8_t enumerateInterface(ENUMERATION_INFO *ei); uint8_t getNextInterface(ENUMERATION_INFO *ei, UHS_EpInfo *pep, uint8_t data[], uint16_t *left, uint16_t *read, uint8_t *offset); uint8_t initDescrStream(ENUMERATION_INFO *ei, USB_FD_CONFIGURATION_DESCRIPTOR *ucd, UHS_EpInfo *pep, uint8_t *data, uint16_t *left, uint16_t *read, uint8_t *offset); - uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data); - uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data); + uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data); + uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data); uint8_t doSoftReset(uint8_t parent, uint8_t port, uint8_t address); uint8_t getone(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint8_t *dataptr, uint8_t *offset); uint8_t eat(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint8_t *dataptr, uint8_t *offset, uint16_t *yum); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h index 56d640097..7d17d626c 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h @@ -388,7 +388,7 @@ public: return (!condet); }; - virtual UHS_EpInfo *ctrlReqOpen(uint8_t addr, uint64_t Request, uint8_t* dataptr); + virtual UHS_EpInfo *ctrlReqOpen(uint8_t addr, uint64_t Request, uint8_t *dataptr); virtual void UHS_NI vbusPower(VBUS_t state) { regWr(rPINCTL, (bmFDUPSPI | bmIRQ_SENSE) | (uint8_t)(state)); @@ -483,8 +483,8 @@ public: void gpioWr(uint8_t data); uint8_t regRd(uint8_t reg); uint8_t gpioRd(); - uint8_t* bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p); - uint8_t* bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p); + uint8_t* bytesWr(uint8_t reg, uint8_t nbytes, uint8_t *data_p); + uint8_t* bytesRd(uint8_t reg, uint8_t nbytes, uint8_t *data_p); // ARM/NVIC specific, used to emulate reentrant ISR. #ifdef SWI_IRQ_NUM diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h index 7fe48652f..6cfc0152d 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h @@ -76,7 +76,7 @@ void UHS_NI MAX3421E_HOST::regWr(uint8_t reg, uint8_t data) { /* multiple-byte write */ /* returns a pointer to memory position after last written */ -uint8_t* UHS_NI MAX3421E_HOST::bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p) { +uint8_t* UHS_NI MAX3421E_HOST::bytesWr(uint8_t reg, uint8_t nbytes, uint8_t *data_p) { SPIclass.beginTransaction(MAX3421E_SPI_Settings); MARLIN_UHS_WRITE_SS(LOW); SPIclass.transfer(reg | 0x02); @@ -117,7 +117,7 @@ uint8_t UHS_NI MAX3421E_HOST::regRd(uint8_t reg) { /* multiple-byte register read */ /* returns a pointer to a memory position after last read */ -uint8_t* UHS_NI MAX3421E_HOST::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p) { +uint8_t* UHS_NI MAX3421E_HOST::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t *data_p) { SPIclass.beginTransaction(MAX3421E_SPI_Settings); MARLIN_UHS_WRITE_SS(LOW); SPIclass.transfer(reg); @@ -472,7 +472,7 @@ uint8_t UHS_NI MAX3421E_HOST::SetAddress(uint8_t addr, uint8_t ep, UHS_EpInfo ** * @param data pointer to data buffer * @return 0 on success */ -uint8_t UHS_NI MAX3421E_HOST::InTransfer(UHS_EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t* data) { +uint8_t UHS_NI MAX3421E_HOST::InTransfer(UHS_EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t *data) { uint8_t rcode = 0; uint8_t pktsize; diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h index abac2b08b..a8500c595 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h @@ -479,7 +479,7 @@ */ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) /* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); + void assert_failed(uint8_t *file, uint32_t line); #else #define assert_param(expr) ((void)0U) #endif /* USE_FULL_ASSERT */ diff --git a/buildroot/share/fonts/genpages.c b/buildroot/share/fonts/genpages.c index c855ceac5..dea5b05c5 100644 --- a/buildroot/share/fonts/genpages.c +++ b/buildroot/share/fonts/genpages.c @@ -142,12 +142,12 @@ uint8_t* get_utf8_value(uint8_t *pstart, wchar_t *pval) { return p; } -void usage(char* progname) { +void usage(char *progname) { fprintf(stderr, "usage: %s\n", progname); fprintf(stderr, " read data from stdin\n"); } -void utf8_parse(const char* msg, unsigned int len) { +void utf8_parse(const char *msg, unsigned int len) { uint8_t *pend = NULL; uint8_t *p; uint8_t *pre;