From 0b1e58d6dd91369302bba646fda77de826cbe47e Mon Sep 17 00:00:00 2001 From: devsaurus Date: Tue, 7 Feb 2017 21:19:40 +0100 Subject: [PATCH] correct portYIELD --- components/modules/i2c_hw_master.c | 4 ++-- components/modules/i2c_hw_slave.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/modules/i2c_hw_master.c b/components/modules/i2c_hw_master.c index 92ff7185..74dc3312 100644 --- a/components/modules/i2c_hw_master.c +++ b/components/modules/i2c_hw_master.c @@ -6,6 +6,7 @@ #include "i2c_common.h" +#include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/queue.h" #include "esp_task.h" @@ -325,8 +326,7 @@ int li2c_hw_master_transfer( lua_State *L ) // the transfer task should be unblocked now // (i.e. in eReady state since it can receive from the queue) - // block this task briefly to allow switch over to the transfer task (it has higher prio) - vTaskDelay( 1 ); + portYIELD(); // invalidate last job, it's queued now job->cmd = NULL; // don't delete link! it's used by the transfer task diff --git a/components/modules/i2c_hw_slave.c b/components/modules/i2c_hw_slave.c index d0274602..e53db11b 100644 --- a/components/modules/i2c_hw_slave.c +++ b/components/modules/i2c_hw_slave.c @@ -7,6 +7,7 @@ #include "i2c_common.h" +#include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/queue.h" #include "esp_task.h"