- Introduced NVS configuration options in Kconfig. - Implemented NVS initialization and deinitialization in relay_chn_core. - Added functions for storing and retrieving relay channel direction and tilt sensitivity in NVS. - Updated relay_chn_tilt and relay_chn_output to utilize NVS for state management. - Created relay_chn_nvs.c and relay_chn_nvs.h for NVS-related functionalities. Closes #1074.
33 lines
890 B
C
33 lines
890 B
C
/*
|
|
* SPDX-FileCopyrightText: 2025 Kozmotronik Tech
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
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
|
|
|
|
#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
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif |