Fix PROGMEM read in ProgressCode message
This could cause the printer to crash. The Serial Stream would show a garbled string and the same corruption would appear on the Status Screen's status line.
This commit is contained in:
parent
d6044387d9
commit
4b71466526
|
|
@ -62,7 +62,8 @@ static const char * const progressTexts[] PROGMEM = {
|
|||
};
|
||||
|
||||
const char * const ProgressCodeToText(uint16_t pc){
|
||||
return ( pc <= 26 ) ? progressTexts[pc] : progressTexts[0]; // @@TODO ?? a better fallback option?
|
||||
// @@TODO ?? a better fallback option?
|
||||
return ( pc <= 26 ) ? static_cast<const char * const>(pgm_read_ptr(&progressTexts[pc])) : static_cast<const char * const>(pgm_read_ptr(&progressTexts[0]));
|
||||
}
|
||||
|
||||
void TranslateProgress(uint16_t pc, char *dst, size_t dstSize) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue