We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3538c54 commit b382d4bCopy full SHA for b382d4b
cores/arduino/zephyrCommon.cpp
@@ -175,6 +175,20 @@ size_t analog_pin_index(pin_size_t pinNumber) {
175
176
#endif //CONFIG_ADC
177
178
+static unsigned int irq_key = UINT_MAX;
179
+
180
+void interrupts(void) {
181
+ if (irq_key != UINT_MAX) {
182
+ irq_unlock(irq_key);
183
+ irq_key = UINT_MAX;
184
+ }
185
+}
186
187
+void noInterrupts(void) {
188
+ if (irq_key == UINT_MAX) {
189
+ irq_key = irq_lock();
190
191
192
}
193
194
void yield(void) {
@@ -464,3 +478,4 @@ void disableInterrupt(pin_size_t pinNumber) {
464
478
pcb->handlers[BIT(arduino_pins[pinNumber].pin)].enabled = false;
465
479
466
480
481
0 commit comments