release-1.0.0 #39

Merged
ismail merged 78 commits from release-1.0.0 into main 2025-09-13 10:55:49 +02:00
5 changed files with 30 additions and 30 deletions
Showing only changes of commit 79a66c19d7 - Show all commits

View File

@@ -226,15 +226,15 @@ esp_err_t relay_chn_ctl_get_run_limit_all(uint16_t *limits_sec);
* *
* Sets the time limit in seconds for the specified channel. It will not proceed * Sets the time limit in seconds for the specified channel. It will not proceed
* if the channel ID is invalid. * if the channel ID is invalid.
* If the time_sec value is lesser than the CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC, * If the limit_sec value is lesser than the CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC,
* the value will be set to CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC. * the value will be set to CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC.
* If the time_sec value is greater than the CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC, * If the limit_sec value is greater than the CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC,
* the value will be set to CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC. * the value will be set to CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC.
* *
* @param chn_id The ID of the relay channel to query. * @param chn_id The ID of the relay channel to query.
* @param time_sec The run limit time in seconds. * @param limit_sec The run limit time in seconds.
*/ */
void relay_chn_set_run_limit(uint8_t chn_id, uint16_t time_sec); void relay_chn_set_run_limit(uint8_t chn_id, uint16_t limit_sec);
/** /**
* @brief Sets the run limits for all configured relay channels. * @brief Sets the run limits for all configured relay channels.
@@ -466,14 +466,14 @@ uint16_t relay_chn_get_run_limit(void);
* *
* Sets the time limit in seconds for the channel. It will not proceed * Sets the time limit in seconds for the channel. It will not proceed
* if the channel ID is invalid. * if the channel ID is invalid.
* If the time_sec value is lesser than the CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC, * If the limit_sec value is lesser than the CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC,
* the value will be set to CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC. * the value will be set to CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC.
* If the time_sec value is greater than the CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC, * If the limit_sec value is greater than the CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC,
* the value will be set to CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC. * the value will be set to CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC.
* *
* @param time_sec The run limit time in seconds. * @param limit_sec The run limit time in seconds.
*/ */
void relay_chn_set_run_limit(uint16_t time_sec); void relay_chn_set_run_limit(uint16_t limit_sec);
#endif // CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1 #endif // CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1

View File

@@ -214,9 +214,9 @@ esp_err_t relay_chn_ctl_get_run_limit_all(uint16_t *limits_sec);
* @brief Set the run limit for the specified channel * @brief Set the run limit for the specified channel
* *
* @param chn_id The ID of the relay channel to query. * @param chn_id The ID of the relay channel to query.
* @param time_sec The run limit time in seconds. * @param limit_sec The run limit time in seconds.
*/ */
extern void relay_chn_ctl_set_run_limit(uint8_t chn_id, uint16_t time_sec); extern void relay_chn_ctl_set_run_limit(uint8_t chn_id, uint16_t limit_sec);
/** /**
* @brief Sets the run limits for all configured relay channels. * @brief Sets the run limits for all configured relay channels.
@@ -253,9 +253,9 @@ static inline esp_err_t relay_chn_get_run_limit_all(uint16_t *limits_sec)
return relay_chn_ctl_get_run_limit_all(limits_sec); return relay_chn_ctl_get_run_limit_all(limits_sec);
} }
static inline void relay_chn_set_run_limit(uint8_t chn_id, uint16_t time_sec) static inline void relay_chn_set_run_limit(uint8_t chn_id, uint16_t limit_sec)
{ {
relay_chn_ctl_set_run_limit(chn_id, time_sec); relay_chn_ctl_set_run_limit(chn_id, limit_sec);
} }
static inline esp_err_t relay_chn_set_run_limit_all(uint16_t *limits_sec) static inline esp_err_t relay_chn_set_run_limit_all(uint16_t *limits_sec)
@@ -358,18 +358,18 @@ extern uint16_t relay_chn_ctl_get_run_limit(void);
/** /**
* @brief Set the run limit for the channel * @brief Set the run limit for the channel
* *
* @param time_sec The run limit time in seconds. * @param limit_sec The run limit time in seconds.
*/ */
extern void relay_chn_ctl_set_run_limit(uint16_t time_sec); extern void relay_chn_ctl_set_run_limit(uint16_t limit_sec);
static inline uint16_t relay_chn_get_run_limit(void) static inline uint16_t relay_chn_get_run_limit(void)
{ {
return relay_chn_ctl_get_run_limit(); return relay_chn_ctl_get_run_limit();
} }
static inline void relay_chn_set_run_limit(uint16_t time_sec) static inline void relay_chn_set_run_limit(uint16_t limit_sec)
{ {
relay_chn_ctl_set_run_limit(time_sec); relay_chn_ctl_set_run_limit(limit_sec);
} }
#endif // CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1 #endif // CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1

View File

@@ -53,7 +53,7 @@ esp_err_t relay_chn_nvs_get_direction(uint8_t ch, relay_chn_direction_t *directi
* @param[in] direction Run limit value to store. * @param[in] direction Run limit value to store.
* @return ESP_OK on success, error code otherwise. * @return ESP_OK on success, error code otherwise.
*/ */
esp_err_t relay_chn_nvs_set_run_limit(uint8_t ch, uint16_t time_sec); esp_err_t relay_chn_nvs_set_run_limit(uint8_t ch, uint16_t limit_sec);
/** /**
* @brief Retrieve relay channel run limit from NVS. * @brief Retrieve relay channel run limit from NVS.
@@ -62,7 +62,7 @@ esp_err_t relay_chn_nvs_set_run_limit(uint8_t ch, uint16_t time_sec);
* @param[out] direction Pointer to store retrieved run limit value. * @param[out] direction Pointer to store retrieved run limit value.
* @return ESP_OK on success, error code otherwise. * @return ESP_OK on success, error code otherwise.
*/ */
esp_err_t relay_chn_nvs_get_run_limit(uint8_t ch, uint16_t *time_sec); esp_err_t relay_chn_nvs_get_run_limit(uint8_t ch, uint16_t *limit_sec);
#endif // CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1 #endif // CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1
#if CONFIG_RELAY_CHN_ENABLE_TILTING #if CONFIG_RELAY_CHN_ENABLE_TILTING

View File

@@ -101,18 +101,18 @@ uint16_t relay_chn_ctl_get_run_limit()
return chn_ctl.run_limit_sec; return chn_ctl.run_limit_sec;
} }
void relay_chn_ctl_set_run_limit(uint16_t time_sec) void relay_chn_ctl_set_run_limit(uint16_t limit_sec)
{ {
// Check for boundaries // Check for boundaries
if (time_sec > CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC) if (limit_sec > CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC)
time_sec = CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC; limit_sec = CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC;
else if (time_sec < CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC) else if (limit_sec < CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC)
time_sec = CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC; limit_sec = CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC;
chn_ctl.run_limit_sec = time_sec; chn_ctl.run_limit_sec = limit_sec;
#if CONFIG_RELAY_CHN_ENABLE_NVS #if CONFIG_RELAY_CHN_ENABLE_NVS
relay_chn_nvs_set_run_limit(chn_ctl.id, time_sec); relay_chn_nvs_set_run_limit(chn_ctl.id, limit_sec);
#endif #endif
} }
#endif #endif

View File

@@ -73,18 +73,18 @@ esp_err_t relay_chn_nvs_get_direction(uint8_t ch, relay_chn_direction_t *directi
} }
#if CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT #if CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT
esp_err_t relay_chn_nvs_set_run_limit(uint8_t ch, uint16_t time_sec) esp_err_t relay_chn_nvs_set_run_limit(uint8_t ch, uint16_t limit_sec)
{ {
esp_err_t ret = nvs_set_u16(relay_chn_nvs, RELAY_CHN_KEY_RLIM(ch), time_sec); esp_err_t ret = nvs_set_u16(relay_chn_nvs, RELAY_CHN_KEY_RLIM(ch), limit_sec);
ESP_RETURN_ON_ERROR(ret, TAG, "Failed to set run limit for channel %d", ch); ESP_RETURN_ON_ERROR(ret, TAG, "Failed to set run limit for channel %d", ch);
return nvs_commit(relay_chn_nvs); return nvs_commit(relay_chn_nvs);
} }
esp_err_t relay_chn_nvs_get_run_limit(uint8_t ch, uint16_t *time_sec) esp_err_t relay_chn_nvs_get_run_limit(uint8_t ch, uint16_t *limit_sec)
{ {
ESP_RETURN_ON_FALSE(time_sec != NULL, ESP_ERR_INVALID_ARG, TAG, "Run limit value pointer is NULL"); ESP_RETURN_ON_FALSE(limit_sec != NULL, ESP_ERR_INVALID_ARG, TAG, "Run limit value pointer is NULL");
return nvs_get_u16(relay_chn_nvs, RELAY_CHN_KEY_RLIM(ch), time_sec); return nvs_get_u16(relay_chn_nvs, RELAY_CHN_KEY_RLIM(ch), limit_sec);
} }
#endif // CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1 #endif // CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1