File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,11 @@ void lp_ticker_set_interrupt(timestamp_t timestamp)
139
139
140
140
/* Checking if LPTRM can handle this sleep */
141
141
delta_ticks = USEC_TO_COUNT (delta_us , CLOCK_GetFreq (kCLOCK_Er32kClk ));
142
+ if (delta_ticks == 0 ) {
143
+ /* The requested delay is less than the minimum resolution of this counter */
144
+ delta_ticks = 1 ;
145
+ }
146
+
142
147
if (delta_ticks > MAX_LPTMR_SLEEP ) {
143
148
/* Using RTC if wait time is over 16b (2s @32kHz) */
144
149
uint32_t delta_sec ;
@@ -154,6 +159,11 @@ void lp_ticker_set_interrupt(timestamp_t timestamp)
154
159
/* Set aditional, subsecond, sleep time */
155
160
if (delta_us ) {
156
161
lptmr_schedule = USEC_TO_COUNT (delta_us , CLOCK_GetFreq (kCLOCK_Er32kClk ));
162
+ if (lptmr_schedule == 0 ) {
163
+ /* The requested delay is less than the minimum resolution of this counter */
164
+ lptmr_schedule = 1 ;
165
+ }
166
+
157
167
}
158
168
} else {
159
169
/* Below RTC resolution using LPTMR */
You can’t perform that action at this time.
0 commit comments