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:
2025-08-25 10:24:13 +03:00
parent 9d3f8ddbff
commit 5afefc4dc0
21 changed files with 186 additions and 207 deletions

View File

@@ -64,7 +64,7 @@ esp_err_t relay_chn_register_listener(relay_chn_state_listener_t listener);
*/
void relay_chn_unregister_listener(relay_chn_state_listener_t listener);
#if RELAY_CHN_COUNT > 1
#if CONFIG_RELAY_CHN_COUNT > 1
/**
* @brief Get the state of the specified relay channel.
*
@@ -143,7 +143,7 @@ void relay_chn_flip_direction(uint8_t chn_id);
*/
relay_chn_direction_t relay_chn_get_direction(uint8_t chn_id);
#if RELAY_CHN_ENABLE_RUN_LIMIT == 1
#if CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1
/**
* @brief Get the run limit for the specified channel
*
@@ -168,7 +168,7 @@ uint16_t relay_chn_get_run_limit(uint8_t chn_id);
* @param time_sec The run limit time in seconds.
*/
void relay_chn_set_run_limit(uint8_t chn_id, uint16_t time_sec);
#endif // RELAY_CHN_ENABLE_RUN_LIMIT == 1
#endif // CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1
#if CONFIG_RELAY_CHN_ENABLE_TILTING == 1
@@ -239,7 +239,7 @@ esp_err_t relay_chn_tilt_get_sensitivity(uint8_t chn_id, uint8_t *sensitivity, s
#endif // CONFIG_RELAY_CHN_ENABLE_TILTING
#else // RELAY_CHN_COUNT > 1
#else // CONFIG_RELAY_CHN_COUNT > 1
/**
* @brief Get the state of the relay channel.
@@ -299,7 +299,7 @@ void relay_chn_flip_direction(void);
*/
relay_chn_direction_t relay_chn_get_direction(void);
#if RELAY_CHN_ENABLE_RUN_LIMIT == 1
#if CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1
/**
* @brief Get the run limit for the channel
*
@@ -320,7 +320,7 @@ uint16_t relay_chn_get_run_limit(void);
* @param time_sec The run limit time in seconds.
*/
void relay_chn_set_run_limit(uint16_t time_sec);
#endif // RELAY_CHN_ENABLE_RUN_LIMIT == 1
#endif // CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1
#if CONFIG_RELAY_CHN_ENABLE_TILTING == 1
@@ -377,7 +377,7 @@ uint8_t relay_chn_tilt_get_sensitivity(void);
#endif // CONFIG_RELAY_CHN_ENABLE_TILTING
#endif // RELAY_CHN_COUNT > 1
#endif // CONFIG_RELAY_CHN_COUNT > 1
#ifdef __cplusplus
}

View File

@@ -4,7 +4,7 @@
* SPDX-License-Identifier: MIT
*
* An adapter header to expose the appropriate API functions to the public API
* depending on the RELAY_CHN_COUNT value which determines single or multi mode.
* depending on the CONFIG_RELAY_CHN_COUNT value which determines single or multi mode.
*/
#pragma once
@@ -13,7 +13,7 @@
extern "C" {
#endif
#if RELAY_CHN_COUNT > 1
#if CONFIG_RELAY_CHN_COUNT > 1
/**
* @brief Get the current state of a relay channel.
*
@@ -101,7 +101,7 @@ static inline relay_chn_direction_t relay_chn_get_direction(uint8_t chn_id)
return relay_chn_ctl_get_direction(chn_id);
}
#if RELAY_CHN_ENABLE_RUN_LIMIT == 1
#if CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1
/**
* @brief Get the run limit for the specified channel
*
@@ -129,7 +129,7 @@ static inline void relay_chn_set_run_limit(uint8_t chn_id, uint16_t time_sec)
{
relay_chn_ctl_set_run_limit(chn_id, time_sec);
}
#endif // RELAY_CHN_ENABLE_RUN_LIMIT == 1
#endif // CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1
#else
@@ -209,7 +209,7 @@ static inline relay_chn_direction_t relay_chn_get_direction(void)
return relay_chn_ctl_get_direction();
}
#if RELAY_CHN_ENABLE_RUN_LIMIT == 1
#if CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1
/**
* @brief Get the run limit for the channel
*
@@ -233,9 +233,9 @@ static inline void relay_chn_set_run_limit(uint16_t time_sec)
{
relay_chn_ctl_set_run_limit(time_sec);
}
#endif // RELAY_CHN_ENABLE_RUN_LIMIT == 1
#endif // CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT == 1
#endif // RELAY_CHN_COUNT > 1
#endif // CONFIG_RELAY_CHN_COUNT > 1
#ifdef __cplusplus
}

View File

@@ -10,31 +10,10 @@
extern "C" {
#endif
/* Config defines for covenient writing */
#define RELAY_CHN_OPPOSITE_INERTIA_MS CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS
#define RELAY_CHN_COUNT CONFIG_RELAY_CHN_COUNT
#define RELAY_CHN_ENABLE_TILTING CONFIG_RELAY_CHN_ENABLE_TILTING
#define RELAY_CHN_ENABLE_NVS CONFIG_RELAY_CHN_ENABLE_NVS
#define RELAY_CHN_ENABLE_RUN_LIMIT CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT
#if RELAY_CHN_ENABLE_NVS == 1
#define RELAY_CHN_NVS_NAMESPACE CONFIG_RELAY_CHN_NVS_NAMESPACE
#define RELAY_CHN_NVS_CUSTOM_PARTITION CONFIG_RELAY_CHN_NVS_CUSTOM_PARTITION
#if RELAY_CHN_NVS_CUSTOM_PARTITION == 1
#define RELAY_CHN_NVS_CUSTOM_PARTITION_NAME CONFIG_RELAY_CHN_NVS_CUSTOM_PARTITION_NAME
#endif
#endif
#if RELAY_CHN_COUNT > 1
#define RELAY_CHN_ID_ALL RELAY_CHN_COUNT /*!< Special ID to address all channels */
#endif
#if RELAY_CHN_ENABLE_RUN_LIMIT == 1
#define RELAY_CHN_RUN_LIMIT_MIN_SEC CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC
#define RELAY_CHN_RUN_LIMIT_MAX_SEC CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC
#define RELAY_CHN_RUN_LIMIT_DEFAULT_SEC CONFIG_RELAY_CHN_RUN_LIMIT_DEFAULT_SEC
#endif
#ifdef __cplusplus
}
#endif