From 5da16e62583082001f2ee5c0891ae38c8718a09b Mon Sep 17 00:00:00 2001 From: Francois RAMU Date: Thu, 8 Feb 2024 17:27:11 +0100 Subject: [PATCH] stm32RTC can give the hour Format 24 or 12 hours Adding a boolean (true) if the Hour format is 24 Hours. Signed-off-by: Francois RAMU --- README.md | 6 ++++++ src/STM32RTC.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index bc11b65..bbcc584 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,12 @@ underflow. Used by STM32LoRaWAN. Refer to the Arduino RTC documentation for the other functions http://arduino.cc/en/Reference/RTC +### Since STM32RTC version higher than 1.4.0 +_IsFormat_24Hour_ + +Returns True if the current Hour Format is HOUR_24 else false if Hour format is HOUR_12 + + ## Source Source files available at: diff --git a/src/STM32RTC.h b/src/STM32RTC.h index fe0374c..e7c9611 100644 --- a/src/STM32RTC.h +++ b/src/STM32RTC.h @@ -240,6 +240,10 @@ class STM32RTC { { return RTC_IsConfigured(); } + bool isFormat_24hour(void) + { + return (_format == HOUR_24); + } bool isAlarmEnabled(Alarm name = ALARM_A); bool isTimeSet(void) {