Skip to content

Commit f6e9483

Browse files
Ayush1325DhruvaG2000
authored andcommitted
Move interrupts and noInterrupts out of namespace
- These functions are exported from Arduino.h Signed-off-by: Ayush Singh <[email protected]>
1 parent 0af5724 commit f6e9483

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Diff for: cores/arduino/zephyrCommon.cpp

+14-14
Original file line numberDiff line numberDiff line change
@@ -177,20 +177,6 @@ size_t analog_pin_index(pin_size_t pinNumber) {
177177

178178
static unsigned int irq_key;
179179
static bool interrupts_disabled = false;
180-
181-
void interrupts(void) {
182-
if (interrupts_disabled) {
183-
irq_unlock(irq_key);
184-
interrupts_disabled = false;
185-
}
186-
}
187-
188-
void noInterrupts(void) {
189-
if (!interrupts_disabled) {
190-
irq_key = irq_lock();
191-
interrupts_disabled = true;
192-
}
193-
}
194180
}
195181

196182
void yield(void) {
@@ -480,3 +466,17 @@ void disableInterrupt(pin_size_t pinNumber) {
480466
pcb->handlers[BIT(arduino_pins[pinNumber].pin)].enabled = false;
481467
}
482468
}
469+
470+
void interrupts(void) {
471+
if (interrupts_disabled) {
472+
irq_unlock(irq_key);
473+
interrupts_disabled = false;
474+
}
475+
}
476+
477+
void noInterrupts(void) {
478+
if (!interrupts_disabled) {
479+
irq_key = irq_lock();
480+
interrupts_disabled = true;
481+
}
482+
}

0 commit comments

Comments
 (0)