From 6e56fd06ed8bc619beea523bb5ad8c9a72d4239d Mon Sep 17 00:00:00 2001 From: Dhruva Gole Date: Wed, 31 Aug 2022 17:48:31 +0530 Subject: [PATCH] zephyrCommon: Implement yield() * Fixes https://github.com/zephyrproject-rtos/gsoc-2022-arduino-core/issues/40 * yield(): causes the current thread to yield execution to another thread of the same or higher priority. If there are no other ready threads of the same or higher priority, the routine returns immediately. * Also replace include Arduino "" with <>. Signed-off-by: Dhruva Gole --- cores/arduino/zephyrCommon.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cores/arduino/zephyrCommon.cpp b/cores/arduino/zephyrCommon.cpp index 6791425b..94b58674 100644 --- a/cores/arduino/zephyrCommon.cpp +++ b/cores/arduino/zephyrCommon.cpp @@ -4,7 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "Arduino.h" +#include + +void yield(void) { + k_yield(); +} /* * The ACTIVE_HIGH flag is set so that A low physical