Use original names for config parameters
The config parameter names defined in the relay_chn_defs.h file have been changed back to their original names (with the CONFIG_ prefix), so that they are not confused with application-level defines. Refs #1085
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
#include "relay_chn_ctl.h"
|
||||
#include "relay_chn_output.h"
|
||||
|
||||
#if RELAY_CHN_ENABLE_NVS == 1
|
||||
#if CONFIG_RELAY_CHN_ENABLE_NVS == 1
|
||||
#include "relay_chn_nvs.h"
|
||||
#endif
|
||||
|
||||
@@ -27,10 +27,10 @@ esp_err_t relay_chn_ctl_init(relay_chn_output_t *output, relay_chn_run_info_t *r
|
||||
chn_ctl.pending_cmd = RELAY_CHN_CMD_NONE;
|
||||
chn_ctl.output = output;
|
||||
chn_ctl.run_info = run_info;
|
||||
#if RELAY_CHN_ENABLE_RUN_LIMIT == 1
|
||||
uint16_t run_limit_sec = RELAY_CHN_RUN_LIMIT_DEFAULT_SEC;
|
||||
#if CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1
|
||||
uint16_t run_limit_sec = CONFIG_RELAY_CHN_RUN_LIMIT_DEFAULT_SEC;
|
||||
esp_err_t ret;
|
||||
#if RELAY_CHN_ENABLE_NVS == 1
|
||||
#if CONFIG_RELAY_CHN_ENABLE_NVS == 1
|
||||
// Load run limit value from NVS
|
||||
ret = relay_chn_nvs_get_run_limit(chn_ctl.id, &run_limit_sec);
|
||||
if (ret != ESP_OK && ret != ESP_ERR_NVS_NOT_FOUND) {
|
||||
@@ -51,7 +51,7 @@ void relay_chn_ctl_deinit()
|
||||
esp_timer_delete(chn_ctl.inertia_timer);
|
||||
chn_ctl.inertia_timer = NULL;
|
||||
}
|
||||
#if RELAY_CHN_ENABLE_RUN_LIMIT == 1
|
||||
#if CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1
|
||||
if (chn_ctl.run_limit_timer != NULL) {
|
||||
esp_timer_delete(chn_ctl.run_limit_timer);
|
||||
chn_ctl.run_limit_timer = NULL;
|
||||
@@ -95,7 +95,7 @@ relay_chn_direction_t relay_chn_ctl_get_direction()
|
||||
return relay_chn_output_get_direction(chn_ctl.output);
|
||||
}
|
||||
|
||||
#if RELAY_CHN_ENABLE_RUN_LIMIT == 1
|
||||
#if CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1
|
||||
uint16_t relay_chn_ctl_get_run_limit()
|
||||
{
|
||||
return chn_ctl.run_limit_sec;
|
||||
@@ -104,14 +104,14 @@ uint16_t relay_chn_ctl_get_run_limit()
|
||||
void relay_chn_ctl_set_run_limit(uint16_t time_sec)
|
||||
{
|
||||
// Check for boundaries
|
||||
if (time_sec > RELAY_CHN_RUN_LIMIT_MAX_SEC)
|
||||
time_sec = RELAY_CHN_RUN_LIMIT_MAX_SEC;
|
||||
else if (time_sec < RELAY_CHN_RUN_LIMIT_MIN_SEC)
|
||||
time_sec = RELAY_CHN_RUN_LIMIT_MIN_SEC;
|
||||
if (time_sec > CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC)
|
||||
time_sec = CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC;
|
||||
else if (time_sec < CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC)
|
||||
time_sec = CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC;
|
||||
|
||||
chn_ctl.run_limit_sec = time_sec;
|
||||
|
||||
#if RELAY_CHN_ENABLE_NVS == 1
|
||||
#if CONFIG_RELAY_CHN_ENABLE_NVS == 1
|
||||
relay_chn_nvs_set_run_limit(chn_ctl.id, time_sec);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user