Description
Simple question that may lead to an enhancement. In RTOS mode, the wait_us function executes a division there https://github.com/ARMmbed/mbed-os/blob/master/platform/mbed_wait_api_rtos.cpp#L40 , executed in all cases, so even for sub-millisecond delays. This is only an integer division so it's not that bad, but considering the sub-millisecond case, wouldn't it preferable to avoid any costly operation, and just test if ( us < 1000 ) for that case, leaving the more complicated logic for the longer waits ? I haven't the equipment to test if it enhances the situation or not, but feel like it could for very small values (<10µs for example).
Issue request type
[ ] Question
[X] Enhancement
[ ] Bug