Skip to content

Commit 7c3b471

Browse files
authored
Merge pull request #2935 from Sigma1912/2.9-g92-fix-active-gcode
fix double indication of 'G52'/'G92' and 'G92.2' in active gcodes list
2 parents fadbc8d + e47da72 commit 7c3b471

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/emc/rs274ngc/interp_write.cc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,19 @@ int Interp::write_g_codes(block_pointer block, //!< pointer to a block of RS27
123123
(settings->spindle_mode[0] == CONSTANT_RPM) ? G_97 : G_96;
124124
gez[14] = (settings->ijk_distance_mode == MODE_ABSOLUTE) ? G_90_1 : G_91_1;
125125
gez[15] = (settings->lathe_diameter_mode) ? G_7 : G_8;
126-
gez[16] = (settings->parameters[5210])? G_92_3: G_92_2;
126+
// 'G52','G92' are handled in modal group 0 which is cleared on startup, m2/m30 and abort, hence there
127+
// is no indication of active G92 offsets after such events so we need modal group 16 as a workaround
128+
if (block == NULL){ // this handles config startup
129+
if (settings->parameters[5210] == 1){
130+
gez[16] = G_92_3;
131+
} else {
132+
gez[16] = -1;
133+
}
134+
} else if (settings->parameters[5210] == 1 && block->g_modes[0] == -1){ // this handles aborts, m2/m30
135+
gez[16] = G_92_3;
136+
} else {
137+
gez[16] = block->g_modes[16];
138+
}
127139
return INTERP_OK;
128140
}
129141

0 commit comments

Comments
 (0)