File tree Expand file tree Collapse file tree 2 files changed +5
-23
lines changed Expand file tree Collapse file tree 2 files changed +5
-23
lines changed Original file line number Diff line number Diff line change 1
1
/* mbed Microcontroller Library
2
2
*******************************************************************************
3
- * Copyright (c) 2016 , STMicroelectronics
3
+ * Copyright (c) 2017 , STMicroelectronics
4
4
* All rights reserved.
5
5
*
6
6
* Redistribution and use in source and binary forms, with or without
31
31
32
32
#if DEVICE_LOWPOWERTIMER
33
33
34
- #include "ticker_api.h"
35
- #include "lp_ticker_api.h"
36
- #include "rtc_api.h"
37
34
#include "rtc_api_hal.h"
38
35
39
- static uint8_t lp_ticker_inited = 0 ;
40
-
41
36
void lp_ticker_init (void )
42
37
{
43
- if (lp_ticker_inited ) return ;
44
- lp_ticker_inited = 1 ;
45
-
46
38
rtc_init ();
47
- rtc_set_irq_handler ((uint32_t ) lp_ticker_irq_handler );
48
39
}
49
40
50
41
uint32_t lp_ticker_read (void )
51
42
{
52
43
uint32_t usecs = 0 ;
53
44
time_t time = 0 ;
54
45
55
- lp_ticker_init ();
56
-
57
46
do {
58
47
time = rtc_read ();
59
48
usecs = rtc_read_subseconds ();
@@ -82,7 +71,7 @@ void lp_ticker_disable_interrupt(void)
82
71
83
72
void lp_ticker_clear_interrupt (void )
84
73
{
85
-
74
+ NVIC_ClearPendingIRQ ( RTC_WKUP_IRQn );
86
75
}
87
76
88
- #endif
77
+ #endif /* DEVICE_LOWPOWERTIMER */
Original file line number Diff line number Diff line change 33
33
34
34
#include <stdint.h>
35
35
#include "rtc_api.h"
36
+ #include "ticker_api.h"
37
+ #include "lp_ticker_api.h"
36
38
37
39
#ifdef __cplusplus
38
40
extern "C" {
39
41
#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 );
49
42
50
43
/** Read the subsecond register.
51
44
*
You can’t perform that action at this time.
0 commit comments