shutdown:
- add functions to read/write last encoder steps from nvs
- store encoder steps at shutdown
guide:
- add function to calculate layer count from cable length
- read last encoder-steps at startup
- if length >2m calculate layers, dont home
- home at move-to-zero when not done at startup
encoder library:
- add function to set encoder steps
control:
- read last encoder-steps at startup
- apply last steps if >2m
10 lines
387 B
C++
10 lines
387 B
C++
|
|
// task that repeatedly checks supply voltage (12V) and saves certain values to nvs in case of it drops below a certain threshold (power off detected)
|
|
void task_shutDownDetection(void *pvParameter);
|
|
|
|
// read last axis position in steps from nvs
|
|
// returns -1 when reading from nvs failed
|
|
int nvsReadLastAxisPosSteps();
|
|
|
|
// read last encoder steps from nvs
|
|
int nvsReadLastEncoderSteps(); |