Browse Source

Fix compile warnings, serial alias

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
7e535022ab
  1. 6
      Marlin/src/core/serial.h
  2. 2
      Marlin/src/gcode/stats/M31.cpp
  3. 6
      Marlin/src/lcd/dogm/status_screen_DOGM.cpp
  4. 4
      Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp
  5. 5
      Marlin/src/libs/duration_t.h
  6. 2
      Marlin/src/module/printcounter.cpp

6
Marlin/src/core/serial.h

@ -303,14 +303,14 @@ extern uint8_t marlin_debug_flags;
void serial_echopair_PGM(PGM_P const s_P, const char *v); void serial_echopair_PGM(PGM_P const s_P, const char *v);
void serial_echopair_PGM(PGM_P const s_P, char v); void serial_echopair_PGM(PGM_P const s_P, char v);
void serial_echopair_PGM(PGM_P const s_P, int v); void serial_echopair_PGM(PGM_P const s_P, int v);
void serial_echopair_PGM(PGM_P const s_P, unsigned int v);
void serial_echopair_PGM(PGM_P const s_P, long v); void serial_echopair_PGM(PGM_P const s_P, long v);
void serial_echopair_PGM(PGM_P const s_P, unsigned long v);
void serial_echopair_PGM(PGM_P const s_P, float v); void serial_echopair_PGM(PGM_P const s_P, float v);
void serial_echopair_PGM(PGM_P const s_P, double v); void serial_echopair_PGM(PGM_P const s_P, double v);
void serial_echopair_PGM(PGM_P const s_P, unsigned int v);
void serial_echopair_PGM(PGM_P const s_P, unsigned long v);
inline void serial_echopair_PGM(PGM_P const s_P, uint8_t v) { serial_echopair_PGM(s_P, (int)v); } inline void serial_echopair_PGM(PGM_P const s_P, uint8_t v) { serial_echopair_PGM(s_P, (int)v); }
inline void serial_echopair_PGM(PGM_P const s_P, bool v) { serial_echopair_PGM(s_P, (int)v); } inline void serial_echopair_PGM(PGM_P const s_P, bool v) { serial_echopair_PGM(s_P, (int)v); }
inline void serial_echopair_PGM(PGM_P const s_P, void *v) { serial_echopair_PGM(s_P, (unsigned long)v); } inline void serial_echopair_PGM(PGM_P const s_P, void *v) { serial_echopair_PGM(s_P, (uintptr_t)v); }
void serialprintPGM(PGM_P str); void serialprintPGM(PGM_P str);
void serial_echo_start(); void serial_echo_start();

2
Marlin/src/gcode/stats/M31.cpp

@ -30,7 +30,7 @@
* M31: Get the time since the start of SD Print (or last M109) * M31: Get the time since the start of SD Print (or last M109)
*/ */
void GcodeSuite::M31() { void GcodeSuite::M31() {
char buffer[21]; char buffer[22];
duration_t(print_job_timer.duration()).toString(buffer); duration_t(print_job_timer.duration()).toString(buffer);
ui.set_status(buffer); ui.set_status(buffer);

6
Marlin/src/lcd/dogm/status_screen_DOGM.cpp

@ -774,9 +774,15 @@ void MarlinUI::draw_status_screen() {
mixer.update_mix_from_vtool(); mixer.update_mix_from_vtool();
mix_label = PSTR("Mx"); mix_label = PSTR("Mx");
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-overflow"
sprintf_P(mixer_messages, PSTR(S_FMT " %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1])); sprintf_P(mixer_messages, PSTR(S_FMT " %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1]));
lcd_put_u8str(X_LABEL_POS, XYZ_BASELINE, mixer_messages); lcd_put_u8str(X_LABEL_POS, XYZ_BASELINE, mixer_messages);
#pragma GCC diagnostic pop
#else #else
if (show_e_total) { if (show_e_total) {

4
Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp

@ -217,7 +217,7 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) {
// It is using a hex display for that: It expects BSD coded data in the format xxyyzz // It is using a hex display for that: It expects BSD coded data in the format xxyyzz
void DGUSScreenHandler::DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var) { void DGUSScreenHandler::DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var) {
printStatistics state = print_job_timer.getStats(); printStatistics state = print_job_timer.getStats();
char buf[21]; char buf[22];
duration_t elapsed = state.printTime; duration_t elapsed = state.printTime;
elapsed.toString(buf); elapsed.toString(buf);
dgusdisplay.WriteVariable(VP_PrintAccTime, buf, var.size, true); dgusdisplay.WriteVariable(VP_PrintAccTime, buf, var.size, true);
@ -225,7 +225,7 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) {
void DGUSScreenHandler::DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var) { void DGUSScreenHandler::DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var) {
printStatistics state = print_job_timer.getStats(); printStatistics state = print_job_timer.getStats();
char buf[21]; char buf[10];
sprintf_P(buf, PSTR("%u"), state.totalPrints); sprintf_P(buf, PSTR("%u"), state.totalPrints);
dgusdisplay.WriteVariable(VP_PrintsTotal, buf, var.size, true); dgusdisplay.WriteVariable(VP_PrintsTotal, buf, var.size, true);
} }

5
Marlin/src/libs/duration_t.h

@ -106,6 +106,9 @@ struct duration_t {
return this->value; return this->value;
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-overflow"
/** /**
* @brief Formats the duration as a string * @brief Formats the duration as a string
* @details String will be formated using a "full" representation of duration * @details String will be formated using a "full" representation of duration
@ -163,4 +166,6 @@ struct duration_t {
return 6; return 6;
} }
} }
#pragma GCC diagnostic pop
}; };

2
Marlin/src/module/printcounter.cpp

@ -177,7 +177,7 @@ void PrintCounter::saveStats() {
#endif #endif
void PrintCounter::showStats() { void PrintCounter::showStats() {
char buffer[21]; char buffer[22];
SERIAL_ECHOPGM(STR_STATS); SERIAL_ECHOPGM(STR_STATS);
SERIAL_ECHOLNPAIR( SERIAL_ECHOLNPAIR(

Loading…
Cancel
Save