Store encoder-steps at shutdown, consider at startup
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
This commit is contained in:
@@ -164,6 +164,13 @@ esp_err_t rotary_encoder_get_state(const rotary_encoder_info_t * info, rotary_en
|
||||
*/
|
||||
esp_err_t rotary_encoder_reset(rotary_encoder_info_t * info);
|
||||
|
||||
/**
|
||||
* @brief Set the current position of the rotary encoder to passed value.
|
||||
* @param[in] info Pointer to initialised rotary encoder info structure.
|
||||
* @return ESP_OK if successful, ESP_FAIL or ESP_ERR_* if an error occurred.
|
||||
*/
|
||||
esp_err_t rotary_encoder_set_position(rotary_encoder_info_t * info, uint32_t posNew);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user