Make yield() overridable (#2991)
This commit is contained in:
parent
8fb8e7d060
commit
c2b3f2d6af
@ -97,10 +97,12 @@ protected:
|
|||||||
uart_t* _uart;
|
uart_t* _uart;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern void serialEventRun(void) __attribute__((weak));
|
||||||
|
|
||||||
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
|
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
|
||||||
extern HardwareSerial Serial;
|
extern HardwareSerial Serial;
|
||||||
extern HardwareSerial Serial1;
|
extern HardwareSerial Serial1;
|
||||||
extern HardwareSerial Serial2;
|
extern HardwareSerial Serial2;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif // HardwareSerial_h
|
||||||
|
@ -44,11 +44,13 @@ float temperatureRead()
|
|||||||
return (temprature_sens_read() - 32) / 1.8;
|
return (temprature_sens_read() - 32) / 1.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
void yield()
|
void __yield()
|
||||||
{
|
{
|
||||||
vPortYield();
|
vPortYield();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void yield() __attribute__ ((weak, alias("__yield")));
|
||||||
|
|
||||||
#if CONFIG_AUTOSTART_ARDUINO
|
#if CONFIG_AUTOSTART_ARDUINO
|
||||||
|
|
||||||
extern TaskHandle_t loopTaskHandle;
|
extern TaskHandle_t loopTaskHandle;
|
||||||
|
@ -17,6 +17,7 @@ void loopTask(void *pvParameters)
|
|||||||
esp_task_wdt_reset();
|
esp_task_wdt_reset();
|
||||||
}
|
}
|
||||||
loop();
|
loop();
|
||||||
|
if (serialEventRun) serialEventRun();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user