Skip to content

Commit b65e861

Browse files
committed
STM32 LOW_POWER_TIMER update : lp_ticker
Removed unnecessary part
1 parent feaa789 commit b65e861

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

targets/TARGET_STM/lp_ticker.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* mbed Microcontroller Library
22
*******************************************************************************
3-
* Copyright (c) 2016, STMicroelectronics
3+
* Copyright (c) 2017, STMicroelectronics
44
* All rights reserved.
55
*
66
* Redistribution and use in source and binary forms, with or without
@@ -31,29 +31,18 @@
3131

3232
#if DEVICE_LOWPOWERTIMER
3333

34-
#include "ticker_api.h"
35-
#include "lp_ticker_api.h"
36-
#include "rtc_api.h"
3734
#include "rtc_api_hal.h"
3835

39-
static uint8_t lp_ticker_inited = 0;
40-
4136
void lp_ticker_init(void)
4237
{
43-
if (lp_ticker_inited) return;
44-
lp_ticker_inited = 1;
45-
4638
rtc_init();
47-
rtc_set_irq_handler((uint32_t) lp_ticker_irq_handler);
4839
}
4940

5041
uint32_t lp_ticker_read(void)
5142
{
5243
uint32_t usecs = 0;
5344
time_t time = 0;
5445

55-
lp_ticker_init();
56-
5746
do {
5847
time = rtc_read();
5948
usecs = rtc_read_subseconds();
@@ -82,7 +71,7 @@ void lp_ticker_disable_interrupt(void)
8271

8372
void lp_ticker_clear_interrupt(void)
8473
{
85-
74+
NVIC_ClearPendingIRQ(RTC_WKUP_IRQn);
8675
}
8776

88-
#endif
77+
#endif /* DEVICE_LOWPOWERTIMER */

targets/TARGET_STM/rtc_api_hal.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,12 @@
3333

3434
#include <stdint.h>
3535
#include "rtc_api.h"
36+
#include "ticker_api.h"
37+
#include "lp_ticker_api.h"
3638

3739
#ifdef __cplusplus
3840
extern "C" {
3941
#endif
40-
/*
41-
* Extend rtc_api.h
42-
*/
43-
44-
/** Set the given function as handler of wakeup timer event.
45-
*
46-
* @param handler The function to set as handler
47-
*/
48-
void rtc_set_irq_handler(uint32_t handler);
4942

5043
/** Read the subsecond register.
5144
*

0 commit comments

Comments
 (0)