1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-22 18:25:18 +00:00

💡 Misc. cleanup, comments

This commit is contained in:
Scott Lahteine 2022-01-12 09:47:22 -06:00 committed by Scott Lahteine
parent f8e177a43e
commit 2ee4a667e1
11 changed files with 29 additions and 32 deletions

View File

@ -41,7 +41,7 @@
*
* If XYZE are not given, default restore uses the smart blocking move.
*/
void GcodeSuite::G61(void) {
void GcodeSuite::G61() {
const uint8_t slot = parser.byteval('S');

View File

@ -45,7 +45,7 @@
#include <string.h>
int lcd_glyph_height(void) { return 1; }
int lcd_glyph_height() { return 1; }
typedef struct _TFTGLCD_charmap_t {
wchar_t uchar; // the unicode char
@ -1119,7 +1119,7 @@ int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) {
return 0;
}
int test_TFTGLCD_charmap_all(void) {
int test_TFTGLCD_charmap_all() {
int flg_error = 0;
if (test_TFTGLCD_charmap(g_TFTGLCD_charmap_device, COUNT(g_TFTGLCD_charmap_device), "g_TFTGLCD_charmap_device", 0) < 0) {
flg_error = 1;

View File

@ -265,7 +265,7 @@ void TFTGLCD::setContrast(uint16_t contrast) {
extern volatile int8_t encoderDiff;
// Read buttons and encoder states
uint8_t MarlinUI::read_slow_buttons(void) {
uint8_t MarlinUI::read_slow_buttons() {
if (!PanelDetected) return 0;
#if ENABLED(TFTGLCD_PANEL_SPI)
uint8_t b = 0;

View File

@ -61,7 +61,7 @@
#include "../../feature/cooler.h"
#endif
#if ENABLED(I2C_AMMETER)
#if DO_DRAW_AMMETER
#include "../../feature/ammeter.h"
#endif

View File

@ -63,7 +63,7 @@ char AnycubicTFTClass::SelectedDirectory[30];
char AnycubicTFTClass::SelectedFile[FILENAME_LENGTH];
// Serial helpers
static void sendNewLine(void) { LCD_SERIAL.write('\r'); LCD_SERIAL.write('\n'); }
static void sendNewLine() { LCD_SERIAL.write('\r'); LCD_SERIAL.write('\n'); }
static void send(const char *str) { LCD_SERIAL.print(str); }
static void send_P(PGM_P str) {
while (const char c = pgm_read_byte(str++))

View File

@ -1459,7 +1459,7 @@ void DGUSScreenHandler::LanguagePInit() {
}
}
void DGUSScreenHandler::DGUS_ExtrudeLoadInit(void) {
void DGUSScreenHandler::DGUS_ExtrudeLoadInit() {
ex_filament.ex_length = distanceFilament;
ex_filament.ex_load_unload_flag = 0;
ex_filament.ex_need_time = filamentSpeed_mm_s;
@ -1469,7 +1469,7 @@ void DGUSScreenHandler::DGUS_ExtrudeLoadInit(void) {
ex_filament.ex_tick_start = 0;
}
void DGUSScreenHandler::DGUS_RunoutInit(void) {
void DGUSScreenHandler::DGUS_RunoutInit() {
#if PIN_EXISTS(MT_DET_1)
SET_INPUT_PULLUP(MT_DET_1_PIN);
#endif
@ -1479,7 +1479,7 @@ void DGUSScreenHandler::DGUS_RunoutInit(void) {
runout_mks.runout_status = UNRUNOUT_STATUS;
}
void DGUSScreenHandler::DGUS_Runout_Idle(void) {
void DGUSScreenHandler::DGUS_Runout_Idle() {
#if ENABLED(DGUS_MKS_RUNOUT_SENSOR)
// scanf runout pin
switch (runout_mks.runout_status) {

View File

@ -94,10 +94,10 @@ public:
static void DGUS_LanguageDisplay(uint8_t var);
static void TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr);
static void GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr);
static void LanguagePInit(void);
static void DGUS_Runout_Idle(void);
static void DGUS_RunoutInit(void);
static void DGUS_ExtrudeLoadInit(void);
static void LanguagePInit();
static void DGUS_Runout_Idle();
static void DGUS_RunoutInit();
static void DGUS_ExtrudeLoadInit();
static void LCD_BLK_Adjust(DGUS_VP_Variable &var, void *val_ptr);
static void SD_FileBack(DGUS_VP_Variable &var, void *val_ptr);

View File

@ -318,7 +318,7 @@ void DGUSDisplay::ProcessRx() {
gcode.reset_stepper_timeout();
if (!vp.size) {
DEBUG_ECHOLN();
DEBUG_EOL();
vp.rx_handler(vp, nullptr);
rx_datagram_state = DGUS_IDLE;
@ -330,18 +330,15 @@ void DGUSDisplay::ProcessRx() {
memset(buffer, 0, vp.size);
for (uint8_t i = 0; i < dlen; i++) {
if (i >= vp.size) {
break;
}
if (i >= vp.size) break;
if (i + 1 < dlen && tmp[i + 3] == 0xFF && tmp[i + 4] == 0xFF) {
if (i + 1 < dlen && tmp[i + 3] == 0xFF && tmp[i + 4] == 0xFF)
break;
}
buffer[i] = tmp[i + 3];
}
DEBUG_ECHOLN();
DEBUG_EOL();
vp.rx_handler(vp, buffer);
rx_datagram_state = DGUS_IDLE;
@ -354,7 +351,7 @@ void DGUSDisplay::ProcessRx() {
break;
}
DEBUG_ECHOLN();
DEBUG_EOL();
vp.rx_handler(vp, &tmp[3]);
rx_datagram_state = DGUS_IDLE;

View File

@ -39,17 +39,17 @@ class WifiSerial {
void begin(uint32_t baud);
void begin(uint32_t baud, uint8_t config);
void end();
int available(void);
int read(void);
int available();
int read();
int write(uint8_t);
// Interrupt handlers
static int _tx_complete_irq(serial_t *obj);
static void _rx_complete_irq(serial_t *obj);
void flush(void);
bool isHalfDuplex(void) const;
void enableHalfDuplexRx(void);
void flush();
bool isHalfDuplex() const;
void enableHalfDuplexRx();
private:
void setRx(uint32_t _rx);

View File

@ -133,7 +133,7 @@ uint16_t W25QXXFlash::W25QXX_ReadID(void) {
return Temp;
}
void W25QXXFlash::SPI_FLASH_WriteEnable(void) {
void W25QXXFlash::SPI_FLASH_WriteEnable() {
// Select the FLASH: Chip Select low
SPI_FLASH_CS_L();
// Send "Write Enable" instruction
@ -151,7 +151,7 @@ void W25QXXFlash::SPI_FLASH_WriteEnable(void) {
* Output : None
* Return : None
*******************************************************************************/
void W25QXXFlash::SPI_FLASH_WaitForWriteEnd(void) {
void W25QXXFlash::SPI_FLASH_WaitForWriteEnd() {
uint8_t FLASH_Status = 0;
// Select the FLASH: Chip Select low
@ -216,7 +216,7 @@ void W25QXXFlash::SPI_FLASH_BlockErase(uint32_t BlockAddr) {
* Output : None
* Return : None
*******************************************************************************/
void W25QXXFlash::SPI_FLASH_BulkErase(void) {
void W25QXXFlash::SPI_FLASH_BulkErase() {
// Send write enable instruction
SPI_FLASH_WriteEnable();

View File

@ -61,11 +61,11 @@ public:
static void spi_flash_Send(uint8_t b);
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_WriteEnable();
static void SPI_FLASH_WaitForWriteEnd();
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_BulkErase();
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);