@@ -78,7 +78,7 @@ LOG_MODULE_REGISTER(rtc_stm32, CONFIG_RTC_LOG_LEVEL);
78
78
/* Timeout in microseconds used to wait for flags */
79
79
#define RTC_TIMEOUT 1000000
80
80
81
- #ifdef CONFIG_RTC_ALARM
81
+ #ifdef STM32_RTC_ALARM_ENABLED
82
82
#define RTC_STM32_ALARMS_COUNT DT_INST_PROP(0, alarms_count)
83
83
84
84
#define RTC_STM32_ALRM_A 0U
@@ -95,7 +95,7 @@ LOG_MODULE_REGISTER(rtc_stm32, CONFIG_RTC_LOG_LEVEL);
95
95
#else
96
96
#define RTC_STM32_EXTI_LINE 0
97
97
#endif /* DT_INST_NODE_HAS_PROP(0, alrm_exti_line) */
98
- #endif /* CONFIG_RTC_ALARM */
98
+ #endif /* STM32_RTC_ALARM_ENABLED */
99
99
100
100
#if defined(PWR_CR_DBP ) || defined(PWR_CR1_DBP ) || defined(PWR_DBPCR_DBP ) || defined(PWR_DBPR_DBP )
101
101
/*
@@ -120,7 +120,7 @@ struct rtc_stm32_config {
120
120
#endif
121
121
};
122
122
123
- #ifdef CONFIG_RTC_ALARM
123
+ #ifdef STM32_RTC_ALARM_ENABLED
124
124
struct rtc_stm32_alrm {
125
125
LL_RTC_AlarmTypeDef ll_rtc_alrm ;
126
126
/* user-defined alarm mask, values from RTC_ALARM_TIME_MASK */
@@ -129,14 +129,14 @@ struct rtc_stm32_alrm {
129
129
void * user_data ;
130
130
bool is_pending ;
131
131
};
132
- #endif /* CONFIG_RTC_ALARM */
132
+ #endif /* STM32_RTC_ALARM_ENABLED */
133
133
134
134
struct rtc_stm32_data {
135
135
struct k_mutex lock ;
136
- #ifdef CONFIG_RTC_ALARM
136
+ #ifdef STM32_RTC_ALARM_ENABLED
137
137
struct rtc_stm32_alrm rtc_alrm_a ;
138
138
struct rtc_stm32_alrm rtc_alrm_b ;
139
- #endif /* CONFIG_RTC_ALARM */
139
+ #endif /* STM32_RTC_ALARM_ENABLED */
140
140
};
141
141
142
142
static int rtc_stm32_configure (const struct device * dev )
@@ -185,7 +185,7 @@ static int rtc_stm32_configure(const struct device *dev)
185
185
return err ;
186
186
}
187
187
188
- #ifdef CONFIG_RTC_ALARM
188
+ #ifdef STM32_RTC_ALARM_ENABLED
189
189
static inline ErrorStatus rtc_stm32_init_alarm (RTC_TypeDef * rtc , uint32_t format ,
190
190
LL_RTC_AlarmTypeDef * ll_alarm_struct , uint16_t id )
191
191
{
@@ -329,7 +329,7 @@ static void rtc_stm32_irq_config(const struct device *dev)
329
329
rtc_stm32_isr , DEVICE_DT_INST_GET (0 ), 0 );
330
330
irq_enable (DT_INST_IRQN (0 ));
331
331
}
332
- #endif /* CONFIG_RTC_ALARM */
332
+ #endif /* STM32_RTC_ALARM_ENABLED */
333
333
334
334
static int rtc_stm32_init (const struct device * dev )
335
335
{
@@ -421,7 +421,7 @@ static int rtc_stm32_init(const struct device *dev)
421
421
LL_PWR_DisableBkUpAccess ();
422
422
#endif /* RTC_STM32_BACKUP_DOMAIN_WRITE_PROTECTION */
423
423
424
- #ifdef CONFIG_RTC_ALARM
424
+ #ifdef STM32_RTC_ALARM_ENABLED
425
425
rtc_stm32_irq_config (dev );
426
426
427
427
ll_func_exti_enable_rtc_alarm_it (RTC_STM32_EXTI_LINE );
@@ -430,7 +430,7 @@ static int rtc_stm32_init(const struct device *dev)
430
430
memset (& (data -> rtc_alrm_a ), 0 , sizeof (struct rtc_stm32_alrm ));
431
431
memset (& (data -> rtc_alrm_b ), 0 , sizeof (struct rtc_stm32_alrm ));
432
432
k_mutex_unlock (& data -> lock );
433
- #endif /* CONFIG_RTC_ALARM */
433
+ #endif /* STM32_RTC_ALARM_ENABLED */
434
434
435
435
return err ;
436
436
}
@@ -600,7 +600,7 @@ static int rtc_stm32_get_time(const struct device *dev, struct rtc_time *timeptr
600
600
return 0 ;
601
601
}
602
602
603
- #ifdef CONFIG_RTC_ALARM
603
+ #ifdef STM32_RTC_ALARM_ENABLED
604
604
static void rtc_stm32_init_ll_alrm_struct (LL_RTC_AlarmTypeDef * p_rtc_alarm ,
605
605
const struct rtc_time * timeptr , uint16_t mask )
606
606
{
@@ -995,7 +995,7 @@ static int rtc_stm32_alarm_is_pending(const struct device *dev, uint16_t id)
995
995
k_mutex_unlock (& data -> lock );
996
996
return ret ;
997
997
}
998
- #endif /* CONFIG_RTC_ALARM */
998
+ #endif /* STM32_RTC_ALARM_ENABLED */
999
999
1000
1000
#ifdef CONFIG_RTC_CALIBRATION
1001
1001
#if !defined(CONFIG_SOC_SERIES_STM32F2X ) && \
@@ -1078,13 +1078,13 @@ static int rtc_stm32_get_calibration(const struct device *dev, int32_t *calibrat
1078
1078
static DEVICE_API (rtc , rtc_stm32_driver_api ) = {
1079
1079
.set_time = rtc_stm32_set_time ,
1080
1080
.get_time = rtc_stm32_get_time ,
1081
- #ifdef CONFIG_RTC_ALARM
1081
+ #ifdef STM32_RTC_ALARM_ENABLED
1082
1082
.alarm_get_supported_fields = rtc_stm32_alarm_get_supported_fields ,
1083
1083
.alarm_set_time = rtc_stm32_alarm_set_time ,
1084
1084
.alarm_get_time = rtc_stm32_alarm_get_time ,
1085
1085
.alarm_set_callback = rtc_stm32_alarm_set_callback ,
1086
1086
.alarm_is_pending = rtc_stm32_alarm_is_pending ,
1087
- #endif /* CONFIG_RTC_ALARM */
1087
+ #endif /* STM32_RTC_ALARM_ENABLED */
1088
1088
#ifdef CONFIG_RTC_CALIBRATION
1089
1089
#if !defined (CONFIG_SOC_SERIES_STM32F2X ) && \
1090
1090
!(defined (CONFIG_SOC_SERIES_STM32L1X ) && !defined (RTC_SMOOTHCALIB_SUPPORT ))
0 commit comments