🤙Ꮶ
Size: a a a
🤙Ꮶ
AP
AP
🤙Ꮶ
🤙Ꮶ
AP
#define NOP() asm volatile ("nop")
unsigned long IRAM_ATTR micros()
{
return (unsigned long) (esp_timer_get_time());
}
void IRAM_ATTR delayMicroseconds(uint32_t us)
{
uint32_t m = micros();
if(us){
uint32_t e = (m + us);
if(m > e){ //overflow
while(micros() > e){
NOP();
}
}
while(micros() < e){
NOP();
}
}
}
🤙Ꮶ
🤙Ꮶ
AP
There's also 'usleep' which is a portable wrapper around ets_delay_us or vTaskDelay, depending on whether the delay is larger or smaller than the tick period.
AP
AP
🤙Ꮶ
AP
🤙Ꮶ
🤙Ꮶ
idf.py create-project
AP
g