Send notifications to ExtUI for M0/M1 (#13344)
- Send notifications to ExtUI for M0/M1 - wait_for_user can be non-volatile (not changed by interrupt) C / C++ compilers don't optimize away reads of non-volatile variables when a function call is used between accesses, because *any* variable could be changed by the function call. Since `wait_for_user` can't be changed without a function call, it should be non-volatile so the compiler can optimize away cases where it is read more than once without an intervening function call.
This commit is contained in:
committed by
Scott Lahteine
parent
00fc43144a
commit
60e82e3929
@ -46,7 +46,7 @@ namespace ExtUI {
|
||||
*/
|
||||
}
|
||||
void onIdle() {}
|
||||
void onPrinterKilled(const char* msg) {}
|
||||
void onPrinterKilled(PGM_P const msg) {}
|
||||
void onMediaInserted() {};
|
||||
void onMediaError() {};
|
||||
void onMediaRemoved() {};
|
||||
@ -55,6 +55,7 @@ namespace ExtUI {
|
||||
void onPrintTimerPaused() {}
|
||||
void onPrintTimerStopped() {}
|
||||
void onFilamentRunout() {}
|
||||
void onUserConfirmRequired(const char * const msg) {}
|
||||
void onStatusChanged(const char * const msg) {}
|
||||
void onFactoryReset() {}
|
||||
void onLoadSettings() {}
|
||||
|
@ -630,6 +630,12 @@ namespace ExtUI {
|
||||
feedrate_percentage = clamp(value, 10, 500);
|
||||
}
|
||||
|
||||
void setUserConfirmed(void) {
|
||||
#if HAS_RESUME_CONTINUE
|
||||
wait_for_user = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void printFile(const char *filename) {
|
||||
IFSD(card.openAndPrintFile(filename), NOOP);
|
||||
}
|
||||
|
@ -117,6 +117,7 @@ namespace ExtUI {
|
||||
void setRetractAcceleration_mm_s2(const float);
|
||||
void setTravelAcceleration_mm_s2(const float);
|
||||
void setFeedrate_percent(const float);
|
||||
void setUserConfirmed(void);
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
float getLinearAdvance_mm_mm_s(const extruder_t);
|
||||
@ -239,11 +240,12 @@ namespace ExtUI {
|
||||
void onMediaError();
|
||||
void onMediaRemoved();
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration);
|
||||
void onPrinterKilled(const char* msg);
|
||||
void onPrinterKilled(PGM_P const msg);
|
||||
void onPrintTimerStarted();
|
||||
void onPrintTimerPaused();
|
||||
void onPrintTimerStopped();
|
||||
void onFilamentRunout(const extruder_t extruder);
|
||||
void onUserConfirmRequired(const char * const msg);
|
||||
void onStatusChanged(const char * const msg);
|
||||
void onFactoryReset();
|
||||
void onStoreSettings();
|
||||
|
Reference in New Issue
Block a user