| 100 | } |
| 101 | |
| 102 | void Channel::autoReportGCodeState() { |
| 103 | // When moving, we suppress $G reports in which the only change is the motion mode |
| 104 | // (e.g. G0/G1/G2/G3 changes) because rapid-fire motion mode changes are fairly common. |
| 105 | // We would rather not issue a $G report after every GCode line. |
| 106 | // Similarly, F and S values can change rapidly, especially in laser programs. |
| 107 | // F and S values are also reported in ? status reports, so they will show up |
| 108 | // at the chosen periodic rate there. |
| 109 | if (motionState()) { |
| 110 | // Force the compare to succeed if the only change is the motion mode |
| 111 | _lastModal.motion = gc_state.modal.motion; |
| 112 | } |
| 113 | if (memcmp(&_lastModal, &gc_state.modal, sizeof(_lastModal)) || _lastTool != gc_state.selected_tool || |
| 114 | (!motionState() && (_lastSpindleSpeed != gc_state.spindle_speed || _lastFeedRate != gc_state.feed_rate))) { |
| 115 | report_gcode_modes(*this); |
| 116 | memcpy(&_lastModal, &gc_state.modal, sizeof(_lastModal)); |
| 117 | _lastTool = gc_state.selected_tool; |
| 118 | _lastSpindleSpeed = gc_state.spindle_speed; |
| 119 | _lastFeedRate = gc_state.feed_rate; |
| 120 | } |
| 121 | } |
| 122 | void Channel::autoReport() { |
| 123 | if (_reportInterval) { |
| 124 | const char* stateName = state_name(); |
nothing calls this directly
no test coverage detected