Skip to content

Commit ef4a486

Browse files
committed
adapt the RTC nonReg test in case of stm32F1xx
With the stm32F1 device, the set/get prediv functions use a 32bit param Signed-off-by: Francois Ramu <francois.ramu@st.com>
1 parent d32e562 commit ef4a486

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

examples/NonReg/RTC/RTC_Tests/RTC_Tests.ino

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ static const char* mytime = __TIME__;
3838
clk = RTCCLK / ((predA +1) * (predS +1))
3939
clk = 1000000 / ((99 +1) * (9999+1)) = 1 Hz
4040
*/
41+
#if defined(STM32F1xx)
42+
static uint32_t userPredA = 99;
43+
#else
4144
static int8_t userPredA = 99;
45+
#endif /* STM32F1xx */
4246
static int16_t userPredS = 9999;
4347

4448
/* */
@@ -106,7 +110,11 @@ void loop()
106110
break;
107111
}
108112
Serial.println("Testing asynchronous and synchronous prescaler setting");
113+
#if defined(STM32F1xx)
114+
uint32_t a;
115+
#else
109116
int8_t a;
117+
#endif /* STM32F1xx */
110118
int16_t s;
111119
rtc.getPrediv(&a, &s);
112120
Serial.print("Async/Sync for default LSI clock: ");
@@ -254,4 +262,4 @@ void alarmMatch(void *data)
254262
Serial.println("Unknown STM32RTC::Alarm_Match type");
255263
break;
256264
}
257-
}
265+
}

0 commit comments

Comments
 (0)