Skip to content

Commit 63cccd9

Browse files
committed
Keep rtc code if low power timer is used
Keep the RTC code if either DEVICE_RTC or DEVICE_LOWPOWERTIMER is defined on the devices which use the RTC for both the rtc api and the low power timer api. This allows DEVICE_LOWPOWERTIMER to be enabled while DEVICE_RTC is turned off.
1 parent 690569f commit 63cccd9

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL82Z/TARGET_USENSE/mbed_overrides.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ void NMI_Handler(void)
4646
gpio_init_in(&gpio, PTA4);
4747
}
4848

49-
#ifdef DEVICE_RTC
49+
#if DEVICE_RTC || DEVICE_LOWPOWERTIMER
5050
// Enable the RTC oscillator if available on the board
5151
void rtc_setup_oscillator(RTC_Type *base)
5252
{
5353
/* Enable the RTC oscillator */
5454
RTC->CR |= RTC_CR_OSCE_MASK;
5555
}
56-
#endif
56+
#endif

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/rtc_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
#include "rtc_api.h"
1717

18-
#if DEVICE_RTC
18+
#if DEVICE_RTC || DEVICE_LOWPOWERTIMER
1919

2020
#include "pinmap.h"
2121
#include "fsl_rtc.h"

targets/TARGET_STM/rtc_api.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
*******************************************************************************
2929
*/
30-
#if DEVICE_RTC
30+
#if DEVICE_RTC || DEVICE_LOWPOWERTIMER
3131

3232
#include "rtc_api.h"
3333
#include "rtc_api_hal.h"
@@ -292,8 +292,6 @@ int rtc_isenabled(void)
292292
#endif /* TARGET_STM32F1 */
293293
}
294294

295-
#if DEVICE_LOWPOWERTIMER
296-
297295
static void RTC_IRQHandler(void)
298296
{
299297
/* Update HAL state */
@@ -333,6 +331,5 @@ void rtc_synchronize(void)
333331
{
334332
HAL_RTC_WaitForSynchro(&RtcHandle);
335333
}
336-
#endif /* DEVICE_LOWPOWERTIMER */
337334

338-
#endif /* DEVICE_RTC */
335+
#endif /* DEVICE_RTC || DEVICE_LOWPOWERTIMER */

targets/TARGET_Silicon_Labs/TARGET_EFM32/rtc_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
******************************************************************************/
2323

2424
#include "device.h"
25-
#if DEVICE_RTC
25+
#if DEVICE_RTC || DEVICE_LOWPOWERTIMER
2626

2727
#include "rtc_api.h"
2828
#include "rtc_api_HAL.h"

0 commit comments

Comments
 (0)