Reduce string storage, use masking 'seen'

This commit is contained in:
Scott Lahteine 2019-09-26 03:47:26 -05:00
parent 455dabb183
commit 665e45e0ba
24 changed files with 70 additions and 94 deletions

View file

@ -922,8 +922,7 @@ static void ee_Init() {
if (!ee_IsPageClean(grp * PagesPerGroup + page)) { if (!ee_IsPageClean(grp * PagesPerGroup + page)) {
#ifdef EE_EMU_DEBUG #ifdef EE_EMU_DEBUG
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPAIR("EEPROM Page ",page); SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp);
SERIAL_ECHOLNPAIR(" not clean on group ",grp);
SERIAL_FLUSH(); SERIAL_FLUSH();
#endif #endif
ee_PageErase(grp * PagesPerGroup + page); ee_PageErase(grp * PagesPerGroup + page);
@ -953,8 +952,7 @@ static void ee_Init() {
if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) { if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) {
#ifdef EE_EMU_DEBUG #ifdef EE_EMU_DEBUG
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPAIR("EEPROM Page ",page); SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup);
SERIAL_ECHOLNPAIR(" not clean on active group ",curGroup);
SERIAL_FLUSH(); SERIAL_FLUSH();
ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page)); ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page));
#endif #endif

View file

@ -962,10 +962,11 @@ void setup() {
SERIAL_EOL(); SERIAL_EOL();
#if defined(STRING_DISTRIBUTION_DATE) && defined(STRING_CONFIG_H_AUTHOR) #if defined(STRING_DISTRIBUTION_DATE) && defined(STRING_CONFIG_H_AUTHOR)
SERIAL_ECHO_START(); SERIAL_ECHO_MSG(
SERIAL_ECHOPGM(MSG_CONFIGURATION_VER); MSG_CONFIGURATION_VER
SERIAL_ECHOPGM(STRING_DISTRIBUTION_DATE); STRING_DISTRIBUTION_DATE
SERIAL_ECHOLNPGM(MSG_AUTHOR STRING_CONFIG_H_AUTHOR); MSG_AUTHOR STRING_CONFIG_H_AUTHOR
);
SERIAL_ECHO_MSG("Compiled: " __DATE__); SERIAL_ECHO_MSG("Compiled: " __DATE__);
#endif #endif

View file

@ -50,9 +50,8 @@
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
if (!isnan(z_values[x][y])) { if (!isnan(z_values[x][y])) {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPAIR(" M421 I", x, " J", y); SERIAL_ECHOPAIR(" M421 I", int(x), " J", int(y));
SERIAL_ECHOPAIR_F(" Z", z_values[x][y], 4); SERIAL_ECHOLNPAIR_F(" Z", z_values[x][y], 4);
SERIAL_EOL();
serial_delay(75); // Prevent Printrun from exploding serial_delay(75); // Prevent Printrun from exploding
} }
} }

View file

@ -432,9 +432,7 @@ bool MMU2::rx_ok() {
*/ */
void MMU2::check_version() { void MMU2::check_version() {
if (buildnr < MMU_REQUIRED_FW_BUILDNR) { if (buildnr < MMU_REQUIRED_FW_BUILDNR) {
SERIAL_ERROR_START(); SERIAL_ERROR_MSG("Invalid MMU2 firmware. Version >= " STRINGIFY(MMU_REQUIRED_FW_BUILDNR) " required.");
SERIAL_ECHOPGM("MMU2 firmware version invalid. Required version >= ");
SERIAL_ECHOLN(MMU_REQUIRED_FW_BUILDNR);
kill(MSG_MMU2_WRONG_FIRMWARE); kill(MSG_MMU2_WRONG_FIRMWARE);
} }
} }

View file

@ -127,7 +127,7 @@ void GcodeSuite::M420() {
} }
// L or V display the map info // L or V display the map info
if (parser.seen('L') || parser.seen('V')) { if (parser.seen("LV")) {
ubl.display_map(parser.byteval('T')); ubl.display_map(parser.byteval('T'));
SERIAL_ECHOPGM("Mesh is "); SERIAL_ECHOPGM("Mesh is ");
if (!ubl.mesh_is_valid()) SERIAL_ECHOPGM("in"); if (!ubl.mesh_is_valid()) SERIAL_ECHOPGM("in");

View file

@ -41,15 +41,14 @@ void GcodeSuite::M281() {
} }
if (!angle_change) { if (!angle_change) {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPAIR(" Servo ", servo_index); SERIAL_ECHOLNPAIR(" Servo ", servo_index,
SERIAL_ECHOPAIR(" L", servo_angles[servo_index][0]); " L", servo_angles[servo_index][0],
SERIAL_ECHOLNPAIR(" U", servo_angles[servo_index][1]); " U", servo_angles[servo_index][1]);
} }
} }
else { else {
SERIAL_ERROR_START(); SERIAL_ERROR_START();
SERIAL_ECHOPAIR("Servo ", servo_index); SERIAL_ECHOLNPAIR("Servo ", servo_index, " out of range");
SERIAL_ECHOLNPGM(" out of range");
} }
} }

View file

@ -61,9 +61,9 @@ void GcodeSuite::M301() {
#if ENABLED(PID_PARAMS_PER_HOTEND) #if ENABLED(PID_PARAMS_PER_HOTEND)
SERIAL_ECHOPAIR(" e:", e); // specify extruder in serial output SERIAL_ECHOPAIR(" e:", e); // specify extruder in serial output
#endif // PID_PARAMS_PER_HOTEND #endif // PID_PARAMS_PER_HOTEND
SERIAL_ECHOPAIR(" p:", PID_PARAM(Kp, e)); SERIAL_ECHOPAIR(" p:", PID_PARAM(Kp, e),
SERIAL_ECHOPAIR(" i:", unscalePID_i(PID_PARAM(Ki, e))); " i:", unscalePID_i(PID_PARAM(Ki, e)),
SERIAL_ECHOPAIR(" d:", unscalePID_d(PID_PARAM(Kd, e))); " d:", unscalePID_d(PID_PARAM(Kd, e)));
#if ENABLED(PID_EXTRUSION_SCALING) #if ENABLED(PID_EXTRUSION_SCALING)
//Kc does not have scaling applied above, or in resetting defaults //Kc does not have scaling applied above, or in resetting defaults
SERIAL_ECHOPAIR(" c:", PID_PARAM(Kc, e)); SERIAL_ECHOPAIR(" c:", PID_PARAM(Kc, e));

View file

@ -56,8 +56,7 @@ void GcodeSuite::M302() {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPGM("Cold extrudes are "); SERIAL_ECHOPGM("Cold extrudes are ");
serialprintPGM(thermalManager.allow_cold_extrude ? PSTR("en") : PSTR("dis")); serialprintPGM(thermalManager.allow_cold_extrude ? PSTR("en") : PSTR("dis"));
SERIAL_ECHOPAIR("abled (min temp ", thermalManager.extrude_min_temp); SERIAL_ECHOLNPAIR("abled (min temp ", thermalManager.extrude_min_temp, "C)");
SERIAL_ECHOLNPGM("C)");
} }
} }

View file

@ -33,9 +33,9 @@ void GcodeSuite::M304() {
if (parser.seen('D')) thermalManager.temp_bed.pid.Kd = scalePID_d(parser.value_float()); if (parser.seen('D')) thermalManager.temp_bed.pid.Kd = scalePID_d(parser.value_float());
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPAIR(" p:", thermalManager.temp_bed.pid.Kp); SERIAL_ECHOLNPAIR(" p:", thermalManager.temp_bed.pid.Kp,
SERIAL_ECHOPAIR(" i:", unscalePID_i(thermalManager.temp_bed.pid.Ki)); " i:", unscalePID_i(thermalManager.temp_bed.pid.Ki),
SERIAL_ECHOLNPAIR(" d:", unscalePID_d(thermalManager.temp_bed.pid.Kd)); " d:", unscalePID_d(thermalManager.temp_bed.pid.Kd));
} }
#endif // PIDTEMPBED #endif // PIDTEMPBED

View file

@ -25,9 +25,9 @@
void report_M92(const bool echo=true, const int8_t e=-1) { void report_M92(const bool echo=true, const int8_t e=-1) {
if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' '); if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' ');
SERIAL_ECHOPAIR(" M92 X", LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS])); SERIAL_ECHOPAIR(" M92 X", LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]),
SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS])); " Y", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]),
SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS])); " Z", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS]));
#if DISABLED(DISTINCT_E_FACTORS) #if DISABLED(DISTINCT_E_FACTORS)
SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS])); SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS]));
#endif #endif
@ -37,8 +37,8 @@ void report_M92(const bool echo=true, const int8_t e=-1) {
for (uint8_t i = 0; i < E_STEPPERS; i++) { for (uint8_t i = 0; i < E_STEPPERS; i++) {
if (e >= 0 && i != e) continue; if (e >= 0 && i != e) continue;
if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' '); if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' ');
SERIAL_ECHOPAIR(" M92 T", (int)i); SERIAL_ECHOLNPAIR(" M92 T", (int)i,
SERIAL_ECHOLNPAIR(" E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS_N(i)])); " E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS_N(i)]));
} }
#endif #endif
@ -101,12 +101,10 @@ void GcodeSuite::M92() {
micro_steps = argH ? argH : Z_MICROSTEPS; micro_steps = argH ? argH : Z_MICROSTEPS;
const float z_full_step_mm = micro_steps * planner.steps_to_mm[Z_AXIS]; const float z_full_step_mm = micro_steps * planner.steps_to_mm[Z_AXIS];
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPAIR("{ micro_steps:", micro_steps); SERIAL_ECHOPAIR("{ micro_steps:", micro_steps, ", z_full_step_mm:", z_full_step_mm);
SERIAL_ECHOPAIR(", z_full_step_mm:", z_full_step_mm);
if (wanted) { if (wanted) {
const float best = uint16_t(wanted / z_full_step_mm) * z_full_step_mm; const float best = uint16_t(wanted / z_full_step_mm) * z_full_step_mm;
SERIAL_ECHOPGM(", best:["); SERIAL_ECHOPAIR(", best:[", best);
SERIAL_ECHO(best);
if (best != wanted) { SERIAL_CHAR(','); SERIAL_ECHO(best + z_full_step_mm); } if (best != wanted) { SERIAL_CHAR(','); SERIAL_ECHO(best + z_full_step_mm); }
SERIAL_CHAR(']'); SERIAL_CHAR(']');
} }

View file

@ -43,14 +43,12 @@ void GcodeSuite::M280() {
} }
else { else {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPAIR(" Servo ", servo_index); SERIAL_ECHOLNPAIR(" Servo ", servo_index, ": ", servo[servo_index].read());
SERIAL_ECHOLNPAIR(": ", servo[servo_index].read());
} }
} }
else { else {
SERIAL_ERROR_START(); SERIAL_ERROR_START();
SERIAL_ECHOPAIR("Servo ", servo_index); SERIAL_ECHOLNPAIR("Servo ", servo_index, " out of range");
SERIAL_ECHOLNPGM(" out of range");
} }
} }

View file

@ -151,7 +151,7 @@ void L6470_report_current(L6470 &motor, const uint8_t axis) {
break; break;
} }
SERIAL_ECHO(dtostrf(val * 100 / 256, 10, 2, numstr)); SERIAL_ECHO(dtostrf(val * 100 / 256, 10, 2, numstr));
SERIAL_ECHO("%% "); SERIAL_ECHOPGM("%% ");
serialprintPGM(suf); serialprintPGM(suf);
SERIAL_EOL(); SERIAL_EOL();
} }

View file

@ -99,13 +99,13 @@ void GcodeSuite::M900() {
if (!parser.seen_any()) { if (!parser.seen_any()) {
#if EXTRUDERS < 2 #if EXTRUDERS < 2
SERIAL_ECHOLNPAIR("Advance S", ext_slot, " K", planner.extruder_advance_K[0]); SERIAL_ECHOLNPAIR("Advance S", ext_slot, " K", planner.extruder_advance_K[0],
SERIAL_ECHOLNPAIR("(Slot ", 1 - ext_slot, " K", saved_extruder_advance_K[0], ")"); "(Slot ", 1 - ext_slot, " K", saved_extruder_advance_K[0], ")");
#else #else
LOOP_L_N(i, EXTRUDERS) { LOOP_L_N(i, EXTRUDERS) {
const int slot = (int)TEST(lin_adv_slot, i); const int slot = (int)TEST(lin_adv_slot, i);
SERIAL_ECHOLNPAIR("Advance T", int(i), " S", slot, " K", planner.extruder_advance_K[i]); SERIAL_ECHOLNPAIR("Advance T", int(i), " S", slot, " K", planner.extruder_advance_K[i],
SERIAL_ECHOLNPAIR("(Slot ", 1 - slot, " K", saved_extruder_advance_K[i], ")"); "(Slot ", 1 - slot, " K", saved_extruder_advance_K[i], ")");
SERIAL_EOL(); SERIAL_EOL();
} }
#endif #endif

View file

@ -47,7 +47,7 @@ void GcodeSuite::M413() {
} }
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY) #if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
if (parser.seen('R') || parser.seen('L')) recovery.load(); if (parser.seen("RL")) recovery.load();
if (parser.seen('W')) recovery.save(true); if (parser.seen('W')) recovery.save(true);
if (parser.seen('P')) recovery.purge(); if (parser.seen('P')) recovery.purge();
if (parser.seen('E')) serialprintPGM(recovery.exists() ? PSTR("PLR Exists\n") : PSTR("No PLR\n")); if (parser.seen('E')) serialprintPGM(recovery.exists() ? PSTR("PLR Exists\n") : PSTR("No PLR\n"));

View file

@ -28,11 +28,10 @@
#include "../../module/tool_change.h" #include "../../module/tool_change.h"
#include "../../module/motion.h" #include "../../module/motion.h"
mpe_settings_t mpe_settings; mpe_settings_t mpe_settings;
inline void mpe_settings_report() { inline void mpe_settings_report() {
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Magnetic Parking Extruder"); SERIAL_ECHO_MSG("Magnetic Parking Extruder");
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("L: Left parking :", mpe_settings.parking_xpos[0]); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("L: Left parking :", mpe_settings.parking_xpos[0]);
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("R: Right parking :", mpe_settings.parking_xpos[1]); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("R: Right parking :", mpe_settings.parking_xpos[1]);
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("I: Grab Offset :", mpe_settings.grab_distance); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("I: Grab Offset :", mpe_settings.grab_distance);

View file

@ -178,7 +178,7 @@ bool UIFlashStorage::is_present = false;
((manufacturer_id == 0x1F) && (device_type == 0x86) && (capacity == 0x01)) ; // Adesto AT255F161 ((manufacturer_id == 0x1F) && (device_type == 0x86) && (capacity == 0x01)) ; // Adesto AT255F161
if (!is_known) { if (!is_known) {
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Unable to locate supported SPI Flash Memory."); SERIAL_ECHO_MSG("Unable to locate supported SPI Flash Memory.");
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Manufacturer ID, got: ", manufacturer_id); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Manufacturer ID, got: ", manufacturer_id);
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Device Type , got: ", device_type); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Device Type , got: ", device_type);
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Capacity , got: ", capacity); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Capacity , got: ", capacity);
@ -252,7 +252,7 @@ bool UIFlashStorage::is_present = false;
return -1; return -1;
} }
} }
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("No LULZ delimiter found."); SERIAL_ECHO_MSG("No LULZ delimiter found.");
return -1; return -1;
} }
@ -264,7 +264,7 @@ bool UIFlashStorage::is_present = false;
int32_t write_offset = read_offset + 4 + block_size; int32_t write_offset = read_offset + 4 + block_size;
if ((write_offset + 4 + block_size) > data_storage_area_size) { if ((write_offset + 4 + block_size) > data_storage_area_size) {
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Not enough free space in Flash."); SERIAL_ECHO_MSG("Not enough free space in Flash.");
return -1; // Not enough free space return -1; // Not enough free space
} }
return write_offset; return write_offset;
@ -300,7 +300,7 @@ bool UIFlashStorage::is_present = false;
void UIFlashStorage::write_config_data(const void *data, size_t size) { void UIFlashStorage::write_config_data(const void *data, size_t size) {
if (!is_present) { if (!is_present) {
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("SPI Flash chip not present. Not saving UI settings."); SERIAL_ECHO_MSG("SPI Flash chip not present. Not saving UI settings.");
return; return;
} }
@ -308,7 +308,7 @@ bool UIFlashStorage::is_present = false;
// make sure that the data is different before rewriting. // make sure that the data is different before rewriting.
if (verify_config_data(data, size)) { if (verify_config_data(data, size)) {
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("UI settings already written, skipping write."); SERIAL_ECHO_MSG("UI settings already written, skipping write.");
return; return;
} }
@ -427,12 +427,12 @@ bool UIFlashStorage::is_present = false;
MediaFileReader reader; MediaFileReader reader;
if (!reader.open((char*) buff)) { if (!reader.open((char*) buff)) {
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Unable to find media file"); SERIAL_ECHO_MSG("Unable to find media file");
return FILE_NOT_FOUND; return FILE_NOT_FOUND;
} }
if (get_media_file_size(slot) != 0xFFFFFFFFUL) { if (get_media_file_size(slot) != 0xFFFFFFFFUL) {
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Media file already exists"); SERIAL_ECHO_MSG("Media file already exists");
return WOULD_OVERWRITE; return WOULD_OVERWRITE;
} }
@ -518,9 +518,8 @@ bool UIFlashStorage::is_present = false;
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Boot media file size:", bytes_remaining); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Boot media file size:", bytes_remaining);
addr = get_media_file_start(slot); addr = get_media_file_start(slot);
return true; return true;
} else {
return false;
} }
return false;
} }
int16_t UIFlashStorage::BootMediaReader::read(void *data, const size_t size) { int16_t UIFlashStorage::BootMediaReader::read(void *data, const size_t size) {

View file

@ -923,8 +923,7 @@ template <class T> bool CLCD::CommandFifo::_write_unaligned(T data, uint16_t len
#if ENABLED(TOUCH_UI_DEBUG) #if ENABLED(TOUCH_UI_DEBUG)
if (command_write_ptr == 0xFFFFFFFFul) { if (command_write_ptr == 0xFFFFFFFFul) {
SERIAL_ECHO_START(); SERIAL_ECHO_MSG("Attempt to write to FIFO before CommandFifo::Cmd_Start().");
SERIAL_ECHOLNPGM("Attempt to write to FIFO before CommandFifo::Cmd_Start().");
} }
#endif #endif
@ -1016,8 +1015,8 @@ template <class T> bool CLCD::CommandFifo::write(T data, uint16_t len) {
if (Command_Space < (len + padding)) { if (Command_Space < (len + padding)) {
#if ENABLED(TOUCH_UI_DEBUG) #if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Waiting for ", len + padding); SERIAL_ECHOPAIR("Waiting for ", len + padding,
SERIAL_ECHOPAIR(" bytes in command queue, now free: ", Command_Space); " bytes in command queue, now free: ", Command_Space);
#endif #endif
do { do {
Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF; Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF;
@ -1071,8 +1070,7 @@ void CLCD::init() {
uint8_t device_id = mem_read_8(REG::ID); // Read Device ID, Should Be 0x7C; uint8_t device_id = mem_read_8(REG::ID); // Read Device ID, Should Be 0x7C;
if (device_id == 0x7c) { if (device_id == 0x7c) {
#if ENABLED(TOUCH_UI_DEBUG) #if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START(); SERIAL_ECHO_MSG("FTDI chip initialized ");
SERIAL_ECHOLNPGM("FTDI chip initialized ");
#endif #endif
break; break;
} }

View file

@ -281,7 +281,7 @@ namespace FTDI_FT810 {
} }
namespace FTDI { namespace FTDI {
enum effect_t { enum effect_t : unsigned char {
SILENCE = 0x00, SILENCE = 0x00,
SQUARE_WAVE = 0x01, SQUARE_WAVE = 0x01,
SINE_WAVE = 0x02, SINE_WAVE = 0x02,
@ -342,7 +342,7 @@ namespace FTDI {
UNMUTE = 0x61 UNMUTE = 0x61
}; };
enum note_t { enum note_t : unsigned char {
END_SONG = 0xFF, END_SONG = 0xFF,
REST = 0x00, REST = 0x00,

View file

@ -78,8 +78,7 @@ bool DLCache::wait_until_idle() {
const unsigned long startTime = millis(); const unsigned long startTime = millis();
do { do {
if ((millis() - startTime) > 250) { if ((millis() - startTime) > 250) {
SERIAL_ECHO_START(); SERIAL_ECHO_MSG("Timeout on DL_Cache::Wait_Until_Idle()");
SERIAL_ECHOLNPGM("Timeout on DL_Cache::Wait_Until_Idle()");
CLCD::CommandFifo::reset(); CLCD::CommandFifo::reset();
return false; return false;
} }
@ -130,15 +129,15 @@ bool DLCache::store(uint32_t num_bytes /* = 0*/) {
// Not enough memory to cache the display list. // Not enough memory to cache the display list.
#if ENABLED(TOUCH_UI_DEBUG) #if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Not enough space in GRAM to cache display list, free space: ", free_space); SERIAL_ECHOLNPAIR("Not enough space in GRAM to cache display list, free space: ", free_space,
SERIAL_ECHOLNPAIR(" Required: ", dl_size); " Required: ", dl_size);
#endif #endif
return false; return false;
} else { } else {
#if ENABLED(TOUCH_UI_DEBUG) #if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Saving DL to RAMG cache, bytes: ", dl_size); SERIAL_ECHOLNPAIR("Saving DL to RAMG cache, bytes: ", dl_size,
SERIAL_ECHOLNPAIR(" Free space: ", free_space); " Free space: ", free_space);
#endif #endif
cmd.memcpy(dl_addr, MAP::RAM_DL, dl_size); cmd.memcpy(dl_addr, MAP::RAM_DL, dl_size);
cmd.execute(); cmd.execute();
@ -168,8 +167,8 @@ void DLCache::append() {
cmd.execute(); cmd.execute();
wait_until_idle(); wait_until_idle();
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Appending to DL from RAMG cache, bytes: ", dl_size); SERIAL_ECHOLNPAIR("Appending to DL from RAMG cache, bytes: ", dl_size,
SERIAL_ECHOLNPAIR(" REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL)); " REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL));
#endif #endif
} }

View file

@ -176,8 +176,7 @@ class CachedScreen {
static bool storeBackground() { static bool storeBackground() {
DLCache dlcache(DL_SLOT); DLCache dlcache(DL_SLOT);
if (!dlcache.store(DL_SIZE)) { if (!dlcache.store(DL_SIZE)) {
SERIAL_ECHO_START(); SERIAL_ECHO_MSG("CachedScreen::storeBackground() failed: not enough DL cache space");
SERIAL_ECHOLNPGM("CachedScreen::storeBackground() failed: not enough DL cache space");
return false; return false;
} }
return true; return true;

View file

@ -38,8 +38,7 @@ namespace FTDI {
#if ENABLED(TOUCH_UI_DEBUG) #if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Playing note ", note); SERIAL_ECHOLNPAIR("Playing note ", int(note), ", instrument ", int(effect));
SERIAL_ECHOLNPAIR(", instrument ", effect);
#endif #endif
// Play the note // Play the note

View file

@ -66,8 +66,7 @@ bool MediaPlayerScreen::playCardMedia() {
if (!reader.open(fname)) if (!reader.open(fname))
return false; return false;
SERIAL_ECHO_START(); SERIAL_ECHO_MSG("Starting to play STARTUP.AVI");
SERIAL_ECHOLNPGM("Starting to play STARTUP.AVI");
playStream(&reader, MediaFileReader::read); playStream(&reader, MediaFileReader::read);
reader.close(); reader.close();
#endif #endif
@ -79,8 +78,7 @@ bool MediaPlayerScreen::playBootMedia() {
UIFlashStorage::BootMediaReader reader; UIFlashStorage::BootMediaReader reader;
if (!reader.isAvailable()) return false; if (!reader.isAvailable()) return false;
SERIAL_ECHO_START(); SERIAL_ECHO_MSG("Starting to play boot video");
SERIAL_ECHOLNPGM("Starting to play boot video");
playStream(&reader, UIFlashStorage::BootMediaReader::read); playStream(&reader, UIFlashStorage::BootMediaReader::read);
return true; return true;
} }
@ -138,8 +136,7 @@ void MediaPlayerScreen::playStream(void *obj, media_streamer_func_t *data_stream
t = millis(); t = millis();
timeouts--; timeouts--;
if (timeouts == 0) { if (timeouts == 0) {
SERIAL_ECHO_START(); SERIAL_ECHO_MSG("Timeout playing video");
SERIAL_ECHOLNPGM("Timeout playing video");
cmd.reset(); cmd.reset();
goto exit; goto exit;
} }
@ -151,8 +148,7 @@ void MediaPlayerScreen::playStream(void *obj, media_streamer_func_t *data_stream
CLCD::mem_write_32(CLCD::REG::MEDIAFIFO_WRITE, writePtr); CLCD::mem_write_32(CLCD::REG::MEDIAFIFO_WRITE, writePtr);
} while (nBytes == block_size); } while (nBytes == block_size);
SERIAL_ECHO_START(); SERIAL_ECHO_MSG("Done playing video");
SERIAL_ECHOLNPGM("Done playing video");
exit: exit:
spiInit(SPI_SPEED); // Restore default speed spiInit(SPI_SPEED); // Restore default speed

View file

@ -52,8 +52,7 @@ void TouchCalibrationScreen::onEntry() {
while (CLCD::is_touching()) { while (CLCD::is_touching()) {
#if ENABLED(TOUCH_UI_DEBUG) #if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START(); SERIAL_ECHO_MSG("Waiting for touch release");
SERIAL_ECHOLNPGM("Waiting for touch release");
#endif #endif
} }
} }

View file

@ -192,8 +192,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
if (!dir.open(&parent, dosFilename, O_READ)) { if (!dir.open(&parent, dosFilename, O_READ)) {
if (lsAction == LS_SerialPrint) { if (lsAction == LS_SerialPrint) {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); SERIAL_ECHOLNPAIR(MSG_SD_CANT_OPEN_SUBDIR, dosFilename);
SERIAL_ECHOLN(dosFilename);
} }
} }
lsDive(path, dir); lsDive(path, dir);
@ -292,8 +291,7 @@ void CardReader::ls() {
if (!dir.open(&diveDir, segment, O_READ)) { if (!dir.open(&diveDir, segment, O_READ)) {
SERIAL_EOL(); SERIAL_EOL();
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); SERIAL_ECHOPAIR(MSG_SD_CANT_OPEN_SUBDIR, segment);
SERIAL_ECHO(segment);
break; break;
} }