Skip to content

Commit a5ce724

Browse files
committed
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 a5ce724

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

cores/arduino/zephyrCommon.cpp

+17-17
Original file line numberDiff line numberDiff line change
@@ -174,23 +174,6 @@ size_t analog_pin_index(pin_size_t pinNumber) {
174174
}
175175

176176
#endif //CONFIG_ADC
177-
178-
static unsigned int irq_key;
179-
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-
}
194177
}
195178

196179
void yield(void) {
@@ -480,3 +463,20 @@ void disableInterrupt(pin_size_t pinNumber) {
480463
pcb->handlers[BIT(arduino_pins[pinNumber].pin)].enabled = false;
481464
}
482465
}
466+
467+
static unsigned int irq_key;
468+
static bool interrupts_disabled = false;
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)