@@ -1114,17 +1114,17 @@ BUILD_ASSERT(DT_INST_CLOCKS_HAS_IDX(0, 1), "RTC source clock not defined in the
1114
1114
static const struct rtc_stm32_config rtc_config = {
1115
1115
#if DT_INST_CLOCKS_CELL_BY_IDX (0 , 1 , bus ) == STM32_SRC_LSI
1116
1116
/* prescaler values for LSI @ 32 KHz */
1117
- .async_prescaler = 0x7F ,
1118
- .sync_prescaler = 0x00F9 ,
1117
+ .async_prescaler = DT_INST_PROP_OR ( 0 , async_prescaler , 0x7F ) ,
1118
+ .sync_prescaler = DT_INST_PROP_OR ( 0 , sync_prescaler , 0x00F9 ) ,
1119
1119
#elif DT_INST_CLOCKS_CELL_BY_IDX (0 , 1 , bus ) == STM32_SRC_LSE
1120
1120
/* prescaler values for LSE @ 32768 Hz */
1121
- .async_prescaler = 0x7F ,
1122
- .sync_prescaler = 0x00FF ,
1121
+ .async_prescaler = DT_INST_PROP_OR ( 0 , async_prescaler , 0x7F ) ,
1122
+ .sync_prescaler = DT_INST_PROP_OR ( 0 , sync_prescaler , 0x00FF ) ,
1123
1123
#elif DT_INST_CLOCKS_CELL_BY_IDX (0 , 1 , bus ) == STM32_SRC_HSE
1124
1124
/* prescaler values for HSE */
1125
- .async_prescaler = RTC_HSE_ASYNC_PRESCALER - 1 ,
1126
- .sync_prescaler = RTC_HSE_SYNC_PRESCALER - 1 ,
1127
- .hse_prescaler = RTC_HSE_PRESCALER ,
1125
+ .async_prescaler = DT_INST_PROP_OR ( 0 , async_prescaler , RTC_HSE_ASYNC_PRESCALER - 1 ) ,
1126
+ .sync_prescaler = DT_INST_PROP_OR ( 0 , sync_prescaler , RTC_HSE_SYNC_PRESCALER - 1 ) ,
1127
+ .hse_prescaler = DT_INST_PROP_OR ( 0 , hse_prescaler , RTC_HSE_PRESCALER ) ,
1128
1128
#else
1129
1129
#error Invalid RTC SRC
1130
1130
#endif
0 commit comments