File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ const ticker_info_t *lp_ticker_get_info()
44
44
{
45
45
static const ticker_info_t info = {
46
46
#if MBED_CONF_TARGET_LSE_AVAILABLE
47
- LSE_VALUE ,
47
+ LSE_VALUE / MBED_CONF_TARGET_LPTICKER_LPTIM_CLOCK ,
48
48
#else
49
- LSI_VALUE ,
49
+ LSI_VALUE / MBED_CONF_TARGET_LPTICKER_LPTIM_CLOCK ,
50
50
#endif
51
51
16
52
52
};
@@ -119,7 +119,17 @@ void lp_ticker_init(void)
119
119
LptimHandle .Instance = LPTIM1 ;
120
120
LptimHandle .State = HAL_LPTIM_STATE_RESET ;
121
121
LptimHandle .Init .Clock .Source = LPTIM_CLOCKSOURCE_APBCLOCK_LPOSC ;
122
+ #if defined(MBED_CONF_TARGET_LPTICKER_LPTIM_CLOCK )
123
+ #if (MBED_CONF_TARGET_LPTICKER_LPTIM_CLOCK == 4 )
124
+ LptimHandle .Init .Clock .Prescaler = LPTIM_PRESCALER_DIV4 ;
125
+ #elif (MBED_CONF_TARGET_LPTICKER_LPTIM_CLOCK == 2 )
126
+ LptimHandle .Init .Clock .Prescaler = LPTIM_PRESCALER_DIV2 ;
127
+ #else
128
+ LptimHandle .Init .Clock .Prescaler = LPTIM_PRESCALER_DIV1 ;
129
+ #endif
130
+ #else
122
131
LptimHandle .Init .Clock .Prescaler = LPTIM_PRESCALER_DIV1 ;
132
+ #endif /* MBED_CONF_TARGET_LPTICKER_LPTIM_CLOCK */
123
133
124
134
LptimHandle .Init .Trigger .Source = LPTIM_TRIGSOURCE_SOFTWARE ;
125
135
LptimHandle .Init .OutputPolarity = LPTIM_OUTPUTPOLARITY_HIGH ;
Original file line number Diff line number Diff line change 1712
1712
"help" : " https://os.mbed.com/docs/latest/porting/low-power-ticker.html" ,
1713
1713
"value" : 1 ,
1714
1714
"macro_name" : " LPTICKER_DELAY_TICKS"
1715
+ },
1716
+ "lpticker_lptim_clock" : {
1717
+ "help" : " Default value for LPTIM clock (lpticker_lptim == 1). Value is the dividing factor. Choose 1, 2 or 4" ,
1718
+ "value" : 1
1715
1719
}
1716
1720
},
1717
1721
"device_has" : [
You can’t perform that action at this time.
0 commit comments