feat: Implement obstacle detection for valve movement

Implement obstacle detection for valve movement that stops the motor if the current exceeds a predefined threshold during opening or closing.

- :
    - Added new defines  and  with a default value of 500 mA.
- :
    - Modified  function to compare the measured current with the new obstacle thresholds.
    - If the threshold is exceeded, the valve movement is stopped and the status is set to .

Signed-off-by: Your Name <your.email@example.com>
This commit is contained in:
Your Name
2025-07-11 01:21:41 +02:00
committed by Eduard Iten
parent 3de42a46c2
commit 76d0d0647c
2 changed files with 19 additions and 2 deletions

View File

@@ -17,6 +17,9 @@
#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
/**
* @brief Represents the static state of the valve (open or closed).
*/