void mp_hal_delay_us(uint32_t us) {
if (us == 0) return;
if (us > 10000) {
// Delay greater then 10 ms, use ms delay function
uint32_t dus = us % 10000; // remaining micro seconds
mp_hal_delay_ms(us/10000);
if (dus) ets_delay_us(dus);
return;
}
ets_delay_us(us);
}
In this following line:
mp_hal_delay_ms(us/10000)
Here, the delay is smaller than it should by a factor of 10, since a millisecond is 1000 microseconds.
I did the following test code:
It gaves me the following output:
exec time: 0.102143
I think it comes from mphalport.c:
In this following line:
mp_hal_delay_ms(us/10000)
Here, the delay is smaller than it should by a factor of 10, since a millisecond is 1000 microseconds.