File tree Expand file tree Collapse file tree 4 files changed +27
-15
lines changed Expand file tree Collapse file tree 4 files changed +27
-15
lines changed Original file line number Diff line number Diff line change 1
1
/* mbed Microcontroller Library
2
2
*******************************************************************************
3
- * Copyright (c) 2017 , STMicroelectronics
3
+ * Copyright (c) 2018 , STMicroelectronics
4
4
* All rights reserved.
5
5
*
6
6
* Redistribution and use in source and binary forms, with or without
30
30
31
31
#if DEVICE_LPTICKER
32
32
33
- #include "rtc_api_hal.h"
34
-
33
+ /***********************************************************************/
34
+ /* lpticker_lptim config is 1 in json config file */
35
+ /* LPTICKER is based on LPTIM feature from ST drivers. RTC is not used */
35
36
#if MBED_CONF_TARGET_LPTICKER_LPTIM
36
37
38
+ #include "lp_ticker_api.h"
39
+ #include "mbed_error.h"
40
+
37
41
LPTIM_HandleTypeDef LptimHandle ;
38
42
39
43
const ticker_info_t * lp_ticker_get_info ()
40
44
{
41
45
static const ticker_info_t info = {
42
- RTC_CLOCK ,
46
+ #if MBED_CONF_TARGET_LSE_AVAILABLE
47
+ LSE_VALUE ,
48
+ #else
49
+ LSI_VALUE ,
50
+ #endif
43
51
16
44
52
};
45
53
return & info ;
@@ -224,8 +232,14 @@ void lp_ticker_clear_interrupt(void)
224
232
NVIC_ClearPendingIRQ (LPTIM1_IRQn );
225
233
}
226
234
235
+
236
+
237
+ /*****************************************************************/
238
+ /* lpticker_lptim config is 0 or not defined in json config file */
239
+ /* LPTICKER is based on RTC wake up feature from ST drivers */
227
240
#else /* MBED_CONF_TARGET_LPTICKER_LPTIM */
228
241
242
+ #include "rtc_api_hal.h"
229
243
void lp_ticker_init (void )
230
244
{
231
245
rtc_init ();
Original file line number Diff line number Diff line change 1
1
/* mbed Microcontroller Library
2
2
*******************************************************************************
3
- * Copyright (c) 2017 , STMicroelectronics
3
+ * Copyright (c) 2018 , STMicroelectronics
4
4
* All rights reserved.
5
5
*
6
6
* Redistribution and use in source and binary forms, with or without
32
32
33
33
#include "rtc_api_hal.h"
34
34
#include "mbed_mktime.h"
35
+ #include "mbed_error.h"
35
36
36
37
static RTC_HandleTypeDef RtcHandle ;
37
38
Original file line number Diff line number Diff line change 1
1
/* mbed Microcontroller Library
2
2
*******************************************************************************
3
- * Copyright (c) 2017 , STMicroelectronics
3
+ * Copyright (c) 2018 , STMicroelectronics
4
4
* All rights reserved.
5
5
*
6
6
* Redistribution and use in source and binary forms, with or without
31
31
#ifndef MBED_RTC_API_HAL_H
32
32
#define MBED_RTC_API_HAL_H
33
33
34
- #include <stdint.h>
35
34
#include "rtc_api.h"
36
- #include "ticker_api.h"
37
35
#include "lp_ticker_api.h"
38
- #include "us_ticker_api.h"
39
- #include "hal_tick.h"
40
- #include "mbed_critical.h"
41
- #include "mbed_error.h"
42
- #include "mbed_debug.h"
43
36
44
37
#ifdef __cplusplus
45
38
extern "C" {
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) 2018 , STMicroelectronics
4
4
* All rights reserved.
5
5
*
6
6
* Redistribution and use in source and binary forms, with or without
30
30
#if DEVICE_SLEEP
31
31
32
32
#include "sleep_api.h"
33
- #include "rtc_api_hal.h"
33
+ #include "us_ticker_api.h"
34
+ #include "hal_tick.h"
35
+ #include "mbed_critical.h"
36
+ #include "mbed_error.h"
34
37
35
38
extern void HAL_SuspendTick (void );
36
39
extern void HAL_ResumeTick (void );
40
+ extern void rtc_synchronize (void );
37
41
38
42
/* Wait loop - assuming tick is 1 us */
39
43
static void wait_loop (uint32_t timeout )
You can’t perform that action at this time.
0 commit comments