diff --git a/examples/NonReg/RTC/RTC_Tests/RTC_Tests.ino b/examples/NonReg/RTC/RTC_Tests/RTC_Tests.ino index d034413..61e7649 100644 --- a/examples/NonReg/RTC/RTC_Tests/RTC_Tests.ino +++ b/examples/NonReg/RTC/RTC_Tests/RTC_Tests.ino @@ -38,12 +38,8 @@ static const char* mytime = __TIME__; clk = RTCCLK / ((predA +1) * (predS +1)) clk = 1000000 / ((99 +1) * (9999+1)) = 1 Hz */ -#if defined(STM32F1xx) static uint32_t userPredA = 99; -#else -static int8_t userPredA = 99; -#endif /* STM32F1xx */ -static int16_t userPredS = 9999; +static uint32_t userPredS = 9999; /* */ static byte seconds = 0; @@ -112,35 +108,35 @@ void loop() #if defined(STM32F1xx) Serial.println("Testing only asynchronous prescaler setting"); - uint32_t a; #else Serial.println("Testing asynchronous and synchronous prescaler setting"); - int8_t a; #endif /* STM32F1xx */ - int16_t s = 0; + uint32_t a = 0; + uint32_t s = 0; + rtc.getPrediv(&a, &s); Serial.print("Async/Sync for default LSI clock: "); - Serial.printf("%i/%i\n", a, s); + Serial.printf("%u/%u\n", a, s); rtc_config(clkSource, rtc.HOUR_24, mydate, mytime); Serial.print("Async/Sync for selected clock: "); rtc.getPrediv(&a, &s); - Serial.printf("%i/%i\n", a, s); + Serial.printf("%u/%u\n", a, s); rtc.end(); if (clkSource == rtc.HSE_CLOCK) { - Serial.printf("User Async/Sync set to %i/%i:", userPredA, userPredS); + Serial.printf("User Async/Sync set to %u/%u:", userPredA, userPredS); rtc.setPrediv(userPredA, userPredS); rtc_config(clkSource, rtc.HOUR_24, mydate, mytime); rtc.getPrediv(&a, &s); - Serial.printf("%i/%i\n", a, s); + Serial.printf("%u/%u\n", a, s); printDateTime(10, 1000, false); } Serial.print("User Async/Sync reset to use the computed one: "); - rtc.setPrediv(-1, -1); + rtc.setPrediv(PREDIVA_MAX + 1, PREDIVS_MAX + 1); rtc_config(clkSource, rtc.HOUR_24, mydate, mytime); rtc.getPrediv(&a, &s); - Serial.printf("%i/%i\n", a, s); + Serial.printf("%u/%u\n", a, s); // Check date change Serial.println("Testing date and time"); diff --git a/examples/Peripherals/ADC/Internal_channels/Internal_channels.ino b/examples/Peripherals/ADC/Internal_channels/Internal_channels.ino index 73df14a..8f24d14 100644 --- a/examples/Peripherals/ADC/Internal_channels/Internal_channels.ino +++ b/examples/Peripherals/ADC/Internal_channels/Internal_channels.ino @@ -89,7 +89,7 @@ static int32_t readTempSensor(int32_t VRef) { #ifdef __LL_ADC_CALC_TEMPERATURE #ifdef STM32U5xx temp = __LL_ADC_CALC_TEMPERATURE(ADC1, VRef, analogRead(ATEMP), LL_ADC_RESOLUTION); -#elif defined(STM32WB0x) +#elif defined(STM32WB0x) || defined(STM32WL3x) (void)VRef; temp = __LL_ADC_CALC_TEMPERATURE(analogRead(ATEMP), LL_ADC_DS_DATA_WIDTH_12_BIT); #else diff --git a/examples/Peripherals/Registers/Reset_reason/Reset_reason.ino b/examples/Peripherals/Registers/Reset_reason/Reset_reason.ino index c6e9356..15179d0 100644 --- a/examples/Peripherals/Registers/Reset_reason/Reset_reason.ino +++ b/examples/Peripherals/Registers/Reset_reason/Reset_reason.ino @@ -1,6 +1,3 @@ -#include -#include - /* Last Reset Reason Sketch * This sketch will determine what caused the last reset on the STM32 MCU. Most microcontrollers * have a register dedicated to storing the last reason of the chip, weather being from a @@ -12,6 +9,7 @@ #include "stm32yyxx_ll_rcc.h" #include "IWatchdog.h" +// #include "STM32LowPower.h" #define USER_BTN_PIN USER_BTN // Adjust this for your board @@ -36,6 +34,9 @@ static int default_button_state = LOW; void Reset_My_MCU() { // There are a few reset conditions. Keep the one you wish to use and comment out the others. + // Below is the WakeUp reset condition (needs STM32LowPower.h library) + // LowPower.shutdown(1000); + // Below is the Software reset condition // NVIC_SystemReset(); @@ -82,7 +83,7 @@ void setup() { #endif - // Clear reset flags + // Clear internal reset flags after they were captured LL_RCC_ClearResetFlags(); #if defined(PWR_SCR_CSBF) || defined(PWR_CR1_CSBF) || defined(PWR_PMCR_CSSF) || defined(PWR_SR_CSSF) #if defined(STM32U0xx) diff --git a/library.properties b/library.properties index be51ffb..837b88a 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=STM32duino Examples -version=1.2.7 +version=1.2.8 author=several maintainer=stm32duino sentence=Provides several examples for the Arduino core for STM32 MCUs.