Skip to content

Commit b0ad713

Browse files
committed
Issue #2483. Simplistic fix to suit 90%+ of use cases.
speed_override is an array, one flag per spindle. However the "active M-codes" array and the state-tags have no way to represent this. For the moment this only considers spindle 0. A proper fix would require an entry in the settings struct to exho the count of spindles. Also, the state tag is limited to 64 bits, spending 24 of those on spindles that probably don't exist seems wrong.
1 parent 3085057 commit b0ad713

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/emc/rs274ngc/interp_write.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,12 @@ int Interp::write_m_codes(block_pointer block, //!< pointer to a block of RS27
161161
(settings->mist) ? 7 : (settings->flood) ? -1 : 9;
162162
emz[5] = /* 5 flood */
163163
(settings->flood) ? 8 : -1;
164+
// This only considers spindle 0. This function //
165+
//doesn't even know how many spindles there are //
164166
if (settings->feed_override) {
165-
if (settings->speed_override) emz[6] = 48;
167+
if (settings->speed_override[0]) emz[6] = 48;
166168
else emz[6] = 50;
167-
} else if (settings->speed_override) {
169+
} else if (settings->speed_override[0]) {
168170
emz[6] = 51;
169171
} else emz[6] = 49;
170172

@@ -315,7 +317,7 @@ int Interp::write_state_tag(block_pointer block,
315317
state.flags[GM_FLAG_FLOOD] = (settings->flood);
316318

317319
state.flags[GM_FLAG_FEED_OVERRIDE] = settings->feed_override;
318-
state.flags[GM_FLAG_SPEED_OVERRIDE] = settings->speed_override;
320+
state.flags[GM_FLAG_SPEED_OVERRIDE] = settings->speed_override[0];
319321

320322
state.flags[GM_FLAG_ADAPTIVE_FEED] = (settings->adaptive_feed);
321323

0 commit comments

Comments
 (0)