Skip to content

Commit

Permalink
✨ AUTO_REPORT_REAL_POSITION option for M154 (MarlinFirmware#25738)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSnowfield authored Apr 27, 2023
1 parent 9a7d9e6 commit 959f730
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -3733,6 +3733,9 @@
* Auto-report position with M154 S<seconds>
*/
//#define AUTO_REPORT_POSITION
#if ENABLED(AUTO_REPORT_POSITION)
//#define AUTO_REPORT_REAL_POSITION // Auto-report the real position
#endif

/**
* Include capabilities in M115 output
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/module/motion.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ void report_current_position_projected();

#if ENABLED(AUTO_REPORT_POSITION)
#include "../libs/autoreport.h"
struct PositionReport { static void report() { report_current_position_projected(); } };
struct PositionReport { static void report() {
TERN(AUTO_REPORT_REAL_POSITION, report_real_position(), report_current_position_projected());
} };
extern AutoReporter<PositionReport> position_auto_reporter;
#endif

Expand Down

0 comments on commit 959f730

Please sign in to comment.