Rename time_sec to limit_sec in relay channel functions for clarity
Fixes #1087
This commit is contained in:
@@ -101,18 +101,18 @@ uint16_t relay_chn_ctl_get_run_limit()
|
||||
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
|
||||
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;
|
||||
if (limit_sec > CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC)
|
||||
limit_sec = CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC;
|
||||
else if (limit_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
|
||||
relay_chn_nvs_set_run_limit(chn_ctl.id, time_sec);
|
||||
relay_chn_nvs_set_run_limit(chn_ctl.id, limit_sec);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user