Skip to content

Commit 94d15b4

Browse files
committed
Put functionality in NGC_EXPRESSIONS_ENABLE block
1 parent 9d6f09b commit 94d15b4

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

gcode.c

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -509,46 +509,7 @@ static status_code_t read_parameter (char *line, uint_fast8_t *char_counter, flo
509509
return status;
510510
}
511511

512-
#endif // NGC_EXPRESSIONS_ENABLE
513-
514-
#if NGC_PARAMETERS_ENABLE
515-
516-
static parameter_words_t g65_words = {0};
517-
518-
parameter_words_t gc_get_g65_arguments (void)
519-
{
520-
return g65_words;
521-
}
522-
523-
bool gc_modal_state_restore (gc_modal_t *copy)
524-
{
525-
bool ok = false;
526-
527-
if((ok = !!copy && !ABORTED)) {
528-
529-
copy->auto_restore = false;
530-
copy->motion = gc_state.modal.motion;
531-
532-
if(copy->coolant.value != gc_state.modal.coolant.value) {
533-
hal.coolant.set_state(copy->coolant);
534-
delay_sec(settings.safety_door.coolant_on_delay, DelayMode_SysSuspend);
535-
}
536-
537-
if(copy->spindle.state.value != gc_state.modal.spindle.state.value || copy->rpm != gc_state.modal.rpm)
538-
spindle_restore(gc_state.spindle.hal, copy->spindle.state, copy->rpm);
539-
540-
memcpy(&gc_state.modal, copy, sizeof(gc_modal_t));
541-
542-
gc_state.spindle.rpm = gc_state.modal.rpm;
543-
gc_state.feed_rate = gc_state.modal.feed_rate;
544-
}
545-
546-
return ok;
547-
}
548-
549-
#endif // NGC_PARAMETERS_ENABLE
550-
551-
void substitute_parameters(char *comment, char **message) {
512+
static void substitute_parameters(char *comment, char **message) {
552513
size_t len = 0;
553514
float value;
554515
char *s3;
@@ -593,6 +554,45 @@ void substitute_parameters(char *comment, char **message) {
593554
}
594555
}
595556

557+
#endif // NGC_EXPRESSIONS_ENABLE
558+
559+
#if NGC_PARAMETERS_ENABLE
560+
561+
static parameter_words_t g65_words = {0};
562+
563+
parameter_words_t gc_get_g65_arguments (void)
564+
{
565+
return g65_words;
566+
}
567+
568+
bool gc_modal_state_restore (gc_modal_t *copy)
569+
{
570+
bool ok = false;
571+
572+
if((ok = !!copy && !ABORTED)) {
573+
574+
copy->auto_restore = false;
575+
copy->motion = gc_state.modal.motion;
576+
577+
if(copy->coolant.value != gc_state.modal.coolant.value) {
578+
hal.coolant.set_state(copy->coolant);
579+
delay_sec(settings.safety_door.coolant_on_delay, DelayMode_SysSuspend);
580+
}
581+
582+
if(copy->spindle.state.value != gc_state.modal.spindle.state.value || copy->rpm != gc_state.modal.rpm)
583+
spindle_restore(gc_state.spindle.hal, copy->spindle.state, copy->rpm);
584+
585+
memcpy(&gc_state.modal, copy, sizeof(gc_modal_t));
586+
587+
gc_state.spindle.rpm = gc_state.modal.rpm;
588+
gc_state.feed_rate = gc_state.modal.feed_rate;
589+
}
590+
591+
return ok;
592+
}
593+
594+
#endif // NGC_PARAMETERS_ENABLE
595+
596596
// Remove whitespace, control characters, comments and if block delete is active block delete lines
597597
// else the block delete character. Remaining characters are converted to upper case.
598598
// If the driver handles message comments then the first is extracted and returned in a dynamically
@@ -641,7 +641,7 @@ char *gc_normalize_block (char *block, char **message)
641641

642642
if(message && *message == NULL && !strncmp(comment, "(MSG,", 5) && (*message = malloc(len))) {
643643
comment += 5;
644-
#if NGC_PARAMETERS_ENABLE
644+
#if NGC_EXPRESSIONS_ENABLE
645645
substitute_parameters(comment, message);
646646
#else
647647
while(*comment == ' ') {

0 commit comments

Comments
 (0)