mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/esp_event_send_init_check' into 'master'
esp_event_send: check if the event loop is initialized See merge request !817
This commit is contained in:
commit
71d7716a45
@ -72,6 +72,10 @@ system_event_cb_t esp_event_loop_set_cb(system_event_cb_t cb, void *ctx)
|
|||||||
|
|
||||||
esp_err_t esp_event_send(system_event_t *event)
|
esp_err_t esp_event_send(system_event_t *event)
|
||||||
{
|
{
|
||||||
|
if (s_event_queue == NULL) {
|
||||||
|
ESP_LOGE(TAG, "Event loop not initialized via esp_event_loop_init, but esp_event_send called");
|
||||||
|
return ESP_ERR_INVALID_STATE;
|
||||||
|
}
|
||||||
portBASE_TYPE ret = xQueueSendToBack(s_event_queue, event, 0);
|
portBASE_TYPE ret = xQueueSendToBack(s_event_queue, event, 0);
|
||||||
if (ret != pdPASS) {
|
if (ret != pdPASS) {
|
||||||
if (event) {
|
if (event) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user