Apply pointer formatting
This commit is contained in:
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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]);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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);
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -116,14 +116,14 @@ namespace FTDI {
|
||||
|
||||
template<bulk_write_op byte_op>
|
||||
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<bulk_write_op byte_op>
|
||||
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++));
|
||||
}
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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();
|
||||
|
@ -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;};
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -60,7 +60,7 @@ class FilesScreen : public BaseScreen, public CachedScreen<FILES_SCREEN_CACHE, F
|
||||
inline static const char *getSelectedLongFilename() {return getSelectedFilename(true);}
|
||||
static const char *getSelectedFilename(bool longName);
|
||||
|
||||
static void drawFileButton(const char* filename, uint8_t tag, bool is_dir, bool is_highlighted);
|
||||
static void drawFileButton(const char *filename, uint8_t tag, bool is_dir, bool is_highlighted);
|
||||
static void drawFileList();
|
||||
static void drawHeader();
|
||||
static void drawFooter();
|
||||
|
@ -324,7 +324,7 @@ void StatusScreen::draw_interaction_buttons(draw_mode_t what) {
|
||||
#undef GRID_COLS
|
||||
}
|
||||
|
||||
void StatusScreen::draw_status_message(draw_mode_t what, const char* message) {
|
||||
void StatusScreen::draw_status_message(draw_mode_t what, const char *message) {
|
||||
#define GRID_COLS 1
|
||||
|
||||
#if ENABLED(TOUCH_UI_PORTRAIT)
|
||||
@ -350,7 +350,7 @@ void StatusScreen::setStatusMessage(progmem_str message) {
|
||||
setStatusMessage((const char *) buff);
|
||||
}
|
||||
|
||||
void StatusScreen::setStatusMessage(const char* message) {
|
||||
void StatusScreen::setStatusMessage(const char *message) {
|
||||
if (CommandProcessor::is_processing()) {
|
||||
#if ENABLED(TOUCH_UI_DEBUG)
|
||||
SERIAL_ECHO_MSG("Cannot update status message, command processor busy");
|
||||
|
@ -167,7 +167,7 @@ void SPIFlashStorage::endWrite() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void SPIFlashStorage::savePage(uint8_t* buffer) {
|
||||
void SPIFlashStorage::savePage(uint8_t *buffer) {
|
||||
W25QXX.SPI_FLASH_BufferWrite(buffer, m_startAddress + (SPI_FLASH_PageSize * m_currentPage), SPI_FLASH_PageSize);
|
||||
// Test env
|
||||
// char fname[256];
|
||||
@ -177,7 +177,7 @@ void SPIFlashStorage::savePage(uint8_t* buffer) {
|
||||
// fclose(fp);
|
||||
}
|
||||
|
||||
void SPIFlashStorage::loadPage(uint8_t* buffer) {
|
||||
void SPIFlashStorage::loadPage(uint8_t *buffer) {
|
||||
W25QXX.SPI_FLASH_BufferRead(buffer, m_startAddress + (SPI_FLASH_PageSize * m_currentPage), SPI_FLASH_PageSize);
|
||||
// Test env
|
||||
// char fname[256];
|
||||
@ -256,7 +256,7 @@ void SPIFlashStorage::readPage() {
|
||||
#endif
|
||||
}
|
||||
|
||||
uint16_t SPIFlashStorage::inData(uint8_t* data, uint16_t size) {
|
||||
uint16_t SPIFlashStorage::inData(uint8_t *data, uint16_t size) {
|
||||
// Don't write more than we can
|
||||
NOMORE(size, pageDataFree());
|
||||
memcpy(m_pageData + m_pageDataUsed, data, size);
|
||||
@ -264,7 +264,7 @@ uint16_t SPIFlashStorage::inData(uint8_t* data, uint16_t size) {
|
||||
return size;
|
||||
}
|
||||
|
||||
void SPIFlashStorage::writeData(uint8_t* data, uint16_t size) {
|
||||
void SPIFlashStorage::writeData(uint8_t *data, uint16_t size) {
|
||||
// Flush a page if needed
|
||||
if (pageDataFree() == 0) flushPage();
|
||||
|
||||
@ -289,7 +289,7 @@ void SPIFlashStorage::beginRead(uint32_t startAddress) {
|
||||
#endif
|
||||
}
|
||||
|
||||
uint16_t SPIFlashStorage::outData(uint8_t* data, uint16_t size) {
|
||||
uint16_t SPIFlashStorage::outData(uint8_t *data, uint16_t size) {
|
||||
// Don't read more than we have
|
||||
NOMORE(size, pageDataFree());
|
||||
memcpy(data, m_pageData + m_pageDataUsed, size);
|
||||
@ -297,7 +297,7 @@ uint16_t SPIFlashStorage::outData(uint8_t* data, uint16_t size) {
|
||||
return size;
|
||||
}
|
||||
|
||||
void SPIFlashStorage::readData(uint8_t* data, uint16_t size) {
|
||||
void SPIFlashStorage::readData(uint8_t *data, uint16_t size) {
|
||||
// Read a page if needed
|
||||
if (pageDataFree() == 0) readPage();
|
||||
|
||||
|
@ -77,21 +77,21 @@ public:
|
||||
// Write operation
|
||||
static void beginWrite(uint32_t startAddress);
|
||||
static void endWrite();
|
||||
static void writeData(uint8_t* data, uint16_t size);
|
||||
static void writeData(uint8_t *data, uint16_t size);
|
||||
|
||||
// Read operation
|
||||
static void beginRead(uint32_t startAddress);
|
||||
static void readData(uint8_t* data, uint16_t size);
|
||||
static void readData(uint8_t *data, uint16_t size);
|
||||
|
||||
static uint32_t getCurrentPage() { return m_currentPage; }
|
||||
|
||||
private:
|
||||
static void flushPage();
|
||||
static void savePage(uint8_t* buffer);
|
||||
static void loadPage(uint8_t* buffer);
|
||||
static void savePage(uint8_t *buffer);
|
||||
static void loadPage(uint8_t *buffer);
|
||||
static void readPage();
|
||||
static uint16_t inData(uint8_t* data, uint16_t size);
|
||||
static uint16_t outData(uint8_t* data, uint16_t size);
|
||||
static uint16_t inData(uint8_t *data, uint16_t size);
|
||||
static uint16_t outData(uint8_t *data, uint16_t size);
|
||||
|
||||
static uint8_t m_pageData[SPI_FLASH_PageSize];
|
||||
static uint32_t m_currentPage;
|
||||
|
@ -649,7 +649,7 @@ char *creat_title_text() {
|
||||
if (gPicturePreviewStart <= 0) {
|
||||
while (1) {
|
||||
uint32_t br = card.read(public_buf, 400);
|
||||
uint32_t* p1 = (uint32_t *)strstr((char *)public_buf, ";gimage:");
|
||||
uint32_t *p1 = (uint32_t *)strstr((char *)public_buf, ";gimage:");
|
||||
if (p1) {
|
||||
gPicturePreviewStart += (uint32_t)p1 - (uint32_t)((uint32_t *)(&public_buf[0]));
|
||||
break;
|
||||
@ -1173,7 +1173,7 @@ void lv_btn_set_style_both(lv_obj_t *btn, lv_style_t *style) {
|
||||
}
|
||||
|
||||
// Create a screen
|
||||
lv_obj_t* lv_screen_create(DISP_STATE newScreenType, const char* title) {
|
||||
lv_obj_t* lv_screen_create(DISP_STATE newScreenType, const char *title) {
|
||||
lv_obj_t *scr = lv_obj_create(nullptr, nullptr);
|
||||
lv_obj_set_style(scr, &tft_style_scr);
|
||||
lv_scr_load(scr);
|
||||
@ -1348,19 +1348,19 @@ lv_obj_t* lv_screen_menu_item(lv_obj_t *par, const char *text, lv_coord_t x, lv_
|
||||
}
|
||||
|
||||
lv_obj_t* lv_screen_menu_item_1_edit(lv_obj_t *par, const char *text, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id, const int index, const char *editValue) {
|
||||
lv_obj_t* btn = lv_screen_menu_item(par, text, x, y, cb, -1, index, false);
|
||||
lv_obj_t* btnValue = lv_btn_create(par, PARA_UI_VALUE_POS_X, y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, cb, id);
|
||||
lv_obj_t* labelValue = lv_label_create_empty(btnValue);
|
||||
lv_obj_t *btn = lv_screen_menu_item(par, text, x, y, cb, -1, index, false);
|
||||
lv_obj_t *btnValue = lv_btn_create(par, PARA_UI_VALUE_POS_X, y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, cb, id);
|
||||
lv_obj_t *labelValue = lv_label_create_empty(btnValue);
|
||||
lv_label_set_text(labelValue, editValue);
|
||||
lv_obj_align(labelValue, btnValue, LV_ALIGN_CENTER, 0, 0);
|
||||
return btn;
|
||||
}
|
||||
|
||||
lv_obj_t* lv_screen_menu_item_2_edit(lv_obj_t *par, const char *text, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id, const int index, const char *editValue, const int idEdit2, const char *editValue2) {
|
||||
lv_obj_t* btn = lv_screen_menu_item(par, text, x, y, cb, -1, index, false);
|
||||
lv_obj_t *btn = lv_screen_menu_item(par, text, x, y, cb, -1, index, false);
|
||||
|
||||
lv_obj_t* btnValue = lv_btn_create(par, PARA_UI_VALUE_POS_X_2, y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, cb, idEdit2);
|
||||
lv_obj_t* labelValue = lv_label_create_empty(btnValue);
|
||||
lv_obj_t *btnValue = lv_btn_create(par, PARA_UI_VALUE_POS_X_2, y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, cb, idEdit2);
|
||||
lv_obj_t *labelValue = lv_label_create_empty(btnValue);
|
||||
lv_label_set_text(labelValue, editValue2);
|
||||
lv_obj_align(labelValue, btnValue, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
@ -1374,8 +1374,8 @@ lv_obj_t* lv_screen_menu_item_2_edit(lv_obj_t *par, const char *text, lv_coord_t
|
||||
|
||||
lv_obj_t* lv_screen_menu_item_onoff(lv_obj_t *par, const char *text, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id, const int index, const bool curValue) {
|
||||
lv_screen_menu_item(par, text, x, y, cb, -1, index, false);
|
||||
lv_obj_t* btnValue = lv_imgbtn_create(par, curValue ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, y + PARA_UI_STATE_V, cb, id);
|
||||
lv_obj_t* labelValue = lv_label_create_empty(btnValue);
|
||||
lv_obj_t *btnValue = lv_imgbtn_create(par, curValue ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, y + PARA_UI_STATE_V, cb, id);
|
||||
lv_obj_t *labelValue = lv_label_create_empty(btnValue);
|
||||
lv_label_set_text(labelValue, curValue ? machine_menu.enable : machine_menu.disable);
|
||||
lv_obj_align(labelValue, btnValue, LV_ALIGN_CENTER, 0, 0);
|
||||
return btnValue;
|
||||
|
@ -482,7 +482,7 @@ void lv_btn_use_label_style(lv_obj_t *btn);
|
||||
void lv_btn_set_style_both(lv_obj_t *btn, lv_style_t *style);
|
||||
|
||||
// Create a screen
|
||||
lv_obj_t* lv_screen_create(DISP_STATE newScreenType, const char* title = nullptr);
|
||||
lv_obj_t* lv_screen_create(DISP_STATE newScreenType, const char *title = nullptr);
|
||||
|
||||
// Create an empty label
|
||||
lv_obj_t* lv_label_create_empty(lv_obj_t *par);
|
||||
|
@ -370,7 +370,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) {
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
static void dosName2LongName(const char dosName[11], char* longName) {
|
||||
static void dosName2LongName(const char dosName[11], char *longName) {
|
||||
uint8_t j = 0;
|
||||
LOOP_L_N(i, 11) {
|
||||
if (i == 8) longName[j++] = '.';
|
||||
@ -380,7 +380,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) {
|
||||
longName[j] = '\0';
|
||||
}
|
||||
|
||||
static int8_t arrayFindStr(const char arr[][LONG_FILENAME_LENGTH], uint8_t arraySize, const char* str) {
|
||||
static int8_t arrayFindStr(const char arr[][LONG_FILENAME_LENGTH], uint8_t arraySize, const char *str) {
|
||||
for (uint8_t a = 0; a < arraySize; a++) {
|
||||
if (strcasecmp(arr[a], str) == 0)
|
||||
return a;
|
||||
|
@ -53,7 +53,7 @@
|
||||
#define WIFI_IO1_SET() WRITE(WIFI_IO1_PIN, HIGH);
|
||||
#define WIFI_IO1_RESET() WRITE(WIFI_IO1_PIN, LOW);
|
||||
|
||||
extern uint8_t Explore_Disk (char* path , uint8_t recu_level);
|
||||
extern uint8_t Explore_Disk (char *path , uint8_t recu_level);
|
||||
|
||||
extern uint8_t commands_in_queue;
|
||||
extern uint8_t sel_id;
|
||||
@ -566,7 +566,7 @@ static int cut_msg_head(uint8_t *msg, uint16_t msgLen, uint16_t cutLen) {
|
||||
return msgLen - cutLen;
|
||||
}
|
||||
|
||||
uint8_t Explore_Disk(char* path , uint8_t recu_level) {
|
||||
uint8_t Explore_Disk(char *path , uint8_t recu_level) {
|
||||
char tmp[200];
|
||||
char Fstream[200];
|
||||
|
||||
|
@ -101,14 +101,14 @@ void NextionTFT::PrintFinished() {
|
||||
SEND_TXT_END("page printfinished");
|
||||
}
|
||||
|
||||
void NextionTFT::ConfirmationRequest(const char *const msg) {
|
||||
void NextionTFT::ConfirmationRequest(const char * const msg) {
|
||||
SEND_VALasTXT("tmppage.M117", msg);
|
||||
#if NEXDEBUG(N_MARLIN)
|
||||
DEBUG_ECHOLNPAIR("ConfirmationRequest() ", msg, " printer_state:", printer_state);
|
||||
#endif
|
||||
}
|
||||
|
||||
void NextionTFT::StatusChange(const char *const msg) {
|
||||
void NextionTFT::StatusChange(const char * const msg) {
|
||||
#if NEXDEBUG(N_MARLIN)
|
||||
DEBUG_ECHOLNPAIR("StatusChange() ", msg, "\nprinter_state:", printer_state);
|
||||
#endif
|
||||
|
@ -118,7 +118,7 @@ void set_lcd_error_P(PGM_P const error, PGM_P const component=nullptr) {
|
||||
*
|
||||
* the command portion begins after the :
|
||||
*/
|
||||
void process_lcd_c_command(const char* command) {
|
||||
void process_lcd_c_command(const char *command) {
|
||||
const int target_val = command[1] ? atoi(command + 1) : -1;
|
||||
if (target_val < 0) {
|
||||
DEBUG_ECHOLNPAIR("UNKNOWN C COMMAND ", command);
|
||||
@ -153,7 +153,7 @@ void process_lcd_c_command(const char* command) {
|
||||
* time remaining (HH:MM:SS). The UI can't handle displaying a second hotend,
|
||||
* but the stock firmware always sends it, and it's always zero.
|
||||
*/
|
||||
void process_lcd_eb_command(const char* command) {
|
||||
void process_lcd_eb_command(const char *command) {
|
||||
char elapsed_buffer[10];
|
||||
static uint8_t iteration = 0;
|
||||
duration_t elapsed;
|
||||
@ -203,12 +203,12 @@ void process_lcd_eb_command(const char* command) {
|
||||
* X, Y, Z, A (extruder)
|
||||
*/
|
||||
template<typename T>
|
||||
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<ExtUI::extruder_t>(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++;
|
||||
|
@ -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);
|
||||
|
@ -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) {}
|
||||
|
@ -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)
|
||||
|
@ -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());
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user