Skip to content

Commit

Permalink
Move interrupts and noInterrupts out of namespace
Browse files Browse the repository at this point in the history
- These functions are exported from Arduino.h

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
  • Loading branch information
Ayush1325 committed Sep 6, 2024
1 parent 0af5724 commit ff3e1e8
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions cores/arduino/zephyrCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
}

0 comments on commit ff3e1e8

Please sign in to comment.