moggieuk / ERCF-Software-V3

New software driver for ERCF control under Klipper
GNU General Public License v3.0
298 stars 63 forks source link

Need range checking when reading new persisted variables #22

Closed jwhite closed 1 year ago

jwhite commented 1 year ago

I changed my ercf parameters file to turn on all 6 gates and immediately crashed the printer to restart. I suspect that there is no range checking on this parameter, so increased it by hand.

Could be an improvement.

ercf_state_tool_to_gate_map = [0, 1, 2, 3]

moggieuk commented 1 year ago

Yup, probably some issues there because I didn't check changing list sizes. I'll look into some safety checks. Thanks.

moggieuk commented 1 year ago

I introduced additional checks on startup so now if there is a mismatch on startup the default values for tool_to_gate_map and other arrays will be used. The default is either that store in ercf_parameters.cfg OR built in default values.