Skip to content

Commit a87452a

Browse files
committed
fixed another typoe
1 parent 2f3fb2a commit a87452a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

core/platform/lf_STM32f4_support.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ static uint32_t _lf_num_nested_crit_sec = 0;
1818
// Timer upper half (for overflow)
1919
static uint32_t _lf_time_us_high = 0;
2020

21+
#define LF_MIN_SLEEP_NS 10
22+
2123
// Combine 2 32bit works to a 64 bit word (Takes from nrf52 support)
2224
#define COMBINE_HI_LO(hi, lo) ((((uint64_t)hi) << 32) | ((uint64_t)lo))
2325

@@ -84,15 +86,19 @@ int _lf_clock_now(instant_t *t)
8486

8587
/**
8688
* Blocks the STM32 for set nanoseconds
89+
* This implements a known function that is used in other
90+
* parts of LF so it has to return int
8791
*/
88-
void lf_sleep(interval_t sleep_duration) {
92+
int lf_sleep(interval_t sleep_duration) {
8993
instant_t target_time;
9094
instant_t current_time;
9195

9296
_lf_clock_now(&current_time);
9397
target_time = current_time + sleep_duration;
9498
while (current_time <= target_time)
9599
_lf_clock_now(&current_time);
100+
101+
return 0;
96102
}
97103

98104
/**
@@ -118,7 +124,7 @@ int _lf_interruptable_sleep_until_locked(environment_t *env, instant_t wakeup_ti
118124
// Edge case handling for super small duration
119125
if (duration <= 0) {
120126
return 0;
121-
} else if (duration < 10) {
127+
} else if (duration < LF_MIN_SLEEP_NS) {
122128
lf_busy_wait_until(wakeup_time);
123129
return 0;
124130
}

0 commit comments

Comments
 (0)