feat(valve): Add current measurement callbacks and shell commands
This commit introduces several enhancements to the valve library. - New weak callback functions `valve_current_open_callback` and `valve_current_close_callback` are added to allow the application to monitor the current during valve opening and closing operations. - The `movement_timeout_handler` now correctly sets the valve state to `VALVE_STATE_OPEN` and movement to `VALVE_MOVEMENT_IDLE` upon timeout. - New shell commands `valve open`, `valve close`, and `valve stop` are added for direct control of the valve. - The existing setting commands are reorganized under a `valve set` subcommand, and their names are shortened (e.g., `set_open_t` to `open_t`). - The default configuration for `LIB_MODBUS_SERVER` and `LIB_VALVE` is changed to `n`. Signed-off-by: Eduard Iten <eduard@iten.pro>
This commit is contained in:
@@ -191,4 +191,24 @@ uint16_t valve_get_obstacle_threshold_open(void);
|
||||
*/
|
||||
uint16_t valve_get_obstacle_threshold_close(void);
|
||||
|
||||
/**
|
||||
* @brief Callback function called during valve opening with current readings.
|
||||
*
|
||||
* This is a weak function that can be overridden to provide custom handling
|
||||
* of current readings during valve opening operations.
|
||||
*
|
||||
* @param current_ma The current reading in milliamps.
|
||||
*/
|
||||
void valve_current_open_callback(int current_ma);
|
||||
|
||||
/**
|
||||
* @brief Callback function called during valve closing with current readings.
|
||||
*
|
||||
* This is a weak function that can be overridden to provide custom handling
|
||||
* of current readings during valve closing operations.
|
||||
*
|
||||
* @param current_ma The current reading in milliamps.
|
||||
*/
|
||||
void valve_current_close_callback(int current_ma);
|
||||
|
||||
#endif // VALVE_H
|
||||
Reference in New Issue
Block a user