Commit 6e6d5963 authored by George Wort's avatar George Wort

Make sure that mp_hal_delay does wait at least once per call.

parent f08164aa
...@@ -123,6 +123,7 @@ void mp_hal_display_string(const char *str) { ...@@ -123,6 +123,7 @@ void mp_hal_display_string(const char *str) {
} }
void mp_hal_delay_us(mp_uint_t us) { void mp_hal_delay_us(mp_uint_t us) {
wait_us(1);
mp_uint_t start = mp_hal_ticks_us(); mp_uint_t start = mp_hal_ticks_us();
while (mp_hal_ticks_us() - start < us) { while (mp_hal_ticks_us() - start < us) {
wait_us(1); wait_us(1);
...@@ -130,6 +131,7 @@ void mp_hal_delay_us(mp_uint_t us) { ...@@ -130,6 +131,7 @@ void mp_hal_delay_us(mp_uint_t us) {
} }
void mp_hal_delay_ms(mp_uint_t ms) { void mp_hal_delay_ms(mp_uint_t ms) {
wait_ms(1);
mp_uint_t start = mp_hal_ticks_ms(); mp_uint_t start = mp_hal_ticks_ms();
while (mp_hal_ticks_ms() - start < ms) { while (mp_hal_ticks_ms() - start < ms) {
wait_ms(1); wait_ms(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment