From f6e9483868abf8e837836f11a85897f27772eb6e Mon Sep 17 00:00:00 2001 From: Ayush Singh Date: Thu, 5 Sep 2024 17:51:59 +0530 Subject: [PATCH] Move interrupts and noInterrupts out of namespace - These functions are exported from Arduino.h Signed-off-by: Ayush Singh --- cores/arduino/zephyrCommon.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cores/arduino/zephyrCommon.cpp b/cores/arduino/zephyrCommon.cpp index 9eb84dca..6a8a8ebe 100644 --- a/cores/arduino/zephyrCommon.cpp +++ b/cores/arduino/zephyrCommon.cpp @@ -177,20 +177,6 @@ size_t analog_pin_index(pin_size_t pinNumber) { static unsigned int irq_key; static bool interrupts_disabled = false; - -void interrupts(void) { - if (interrupts_disabled) { - irq_unlock(irq_key); - interrupts_disabled = false; - } -} - -void noInterrupts(void) { - if (!interrupts_disabled) { - irq_key = irq_lock(); - interrupts_disabled = true; - } -} } void yield(void) { @@ -480,3 +466,17 @@ void disableInterrupt(pin_size_t pinNumber) { pcb->handlers[BIT(arduino_pins[pinNumber].pin)].enabled = false; } } + +void interrupts(void) { + if (interrupts_disabled) { + irq_unlock(irq_key); + interrupts_disabled = false; + } +} + +void noInterrupts(void) { + if (!interrupts_disabled) { + irq_key = irq_lock(); + interrupts_disabled = true; + } +}