feat: Adjust valve obstacle detection thresholds

Reduced the current thresholds for obstacle detection during valve opening and closing from 500mA to 200mA. This makes the obstacle detection more sensitive.

refactor: Simplify valve_work_handler logic

Refactored the  function to directly call  when an obstacle is detected or the valve reaches its end position. This removes redundant code and improves the clarity of the control flow.
Signed-off-by: Eduard Iten <eduard@iten.pro>
This commit is contained in:
2025-07-11 08:57:02 +02:00
parent 66cdc3ae27
commit fc0add8583
2 changed files with 8 additions and 13 deletions

View File

@@ -17,8 +17,8 @@
#define VALVE_CHANNEL_CLOSE 1
#define VALVE_ENDPOSITION_CHECK_INTERVAL K_MSEC(100)
#define VALVE_OBSTACLE_THRESHOLD_OPEN_MA 500
#define VALVE_OBSTACLE_THRESHOLD_CLOSE_MA 500
#define VALVE_OBSTACLE_THRESHOLD_OPEN_MA 200
#define VALVE_OBSTACLE_THRESHOLD_CLOSE_MA 200
/**
* @brief Represents the static state of the valve (open or closed).