Skip to content

Commit b34a991

Browse files
committed
Updated for core change.
1 parent 74210ad commit b34a991

File tree

1 file changed

+17
-26
lines changed

1 file changed

+17
-26
lines changed

thc.c

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ static io_port_t port = {0};
124124
static uint8_t n_ain, n_din;
125125
static char max_aport[4], max_dport[4];
126126

127-
static void plasma_settings_restore (void);
128-
static void plasma_settings_load (void);
129-
130127
static void pause_on_error (void)
131128
{
132129
system_set_exec_state_flag(EXEC_TOOL_CHANGE); // Set up program pause for manual tool change
@@ -484,25 +481,6 @@ static void plasma_settings_save (void)
484481
hal.nvs.memcpy_to_nvs(nvs_address, (uint8_t *)&plasma, sizeof(plasma_settings_t), true);
485482
}
486483

487-
static setting_details_t details = {
488-
.groups = plasma_groups,
489-
.n_groups = sizeof(plasma_groups) / sizeof(setting_group_detail_t),
490-
.settings = plasma_settings,
491-
.n_settings = sizeof(plasma_settings) / sizeof(setting_detail_t),
492-
#ifndef NO_SETTINGS_DESCRIPTIONS
493-
.descriptions = plasma_settings_descr,
494-
.n_descriptions = sizeof(plasma_settings_descr) / sizeof(setting_descr_t),
495-
#endif
496-
.save = plasma_settings_save,
497-
.load = plasma_settings_load,
498-
.restore = plasma_settings_restore
499-
};
500-
501-
static setting_details_t *plasma_get_settings (void)
502-
{
503-
return &details;
504-
}
505-
506484
static void plasma_settings_restore (void)
507485
{
508486
plasma.mode = updown_enabled ? Plasma_ModeUpDown : Plasma_ModeVoltage;
@@ -576,6 +554,20 @@ static void plasma_settings_load (void)
576554

577555
}
578556

557+
static setting_details_t setting_details = {
558+
.groups = plasma_groups,
559+
.n_groups = sizeof(plasma_groups) / sizeof(setting_group_detail_t),
560+
.settings = plasma_settings,
561+
.n_settings = sizeof(plasma_settings) / sizeof(setting_detail_t),
562+
#ifndef NO_SETTINGS_DESCRIPTIONS
563+
.descriptions = plasma_settings_descr,
564+
.n_descriptions = sizeof(plasma_settings_descr) / sizeof(setting_descr_t),
565+
#endif
566+
.save = plasma_settings_save,
567+
.load = plasma_settings_load,
568+
.restore = plasma_settings_restore
569+
};
570+
579571
static void enumeratePins (bool low_level, pin_info_ptr pin_info)
580572
{
581573
enumerate_pins(low_level, pin_info);
@@ -616,7 +608,7 @@ static void plasma_report_options (bool newopt)
616608
on_report_options(newopt);
617609

618610
if(!newopt)
619-
hal.stream.write("[PLUGIN:PLASMA v0.02]" ASCII_EOL);
611+
hal.stream.write("[PLUGIN:PLASMA v0.03]" ASCII_EOL);
620612
else if(driver_reset) // non-null when successfully enabled
621613
hal.stream.write(",THC");
622614
}
@@ -651,12 +643,11 @@ bool plasma_init (void)
651643
strcpy(max_aport, uitoa(n_ain - 1));
652644
strcpy(max_dport, uitoa(n_din - 1));
653645

646+
settings_register(&setting_details);
647+
654648
on_report_options = grbl.on_report_options;
655649
grbl.on_report_options = plasma_report_options;
656650

657-
details.on_get_settings = grbl.on_get_settings;
658-
grbl.on_get_settings = plasma_get_settings;
659-
660651
enumerate_pins = hal.enumerate_pins;
661652
hal.enumerate_pins = enumeratePins;
662653
/*

0 commit comments

Comments
 (0)