sys/arduino: add interrupts/noInterrupts

This fixes the error:

$ BOARD=arduino-mega2560 make -C tests/pkg_arduino_sdi_12/
[...]
[...]/RIOT/build/pkg/arduino_sdi_12/src/SDI12.cpp:379:7: error: ‘interrupts’ was not declared in this scope
This commit is contained in:
J. David Ibáñez 2021-05-21 11:30:31 +02:00
parent c965ce3de6
commit a651315fbe

View File

@ -23,6 +23,7 @@
extern "C" { extern "C" {
#include <stdint.h> #include <stdint.h>
#include "irq.h"
#include "periph/gpio.h" #include "periph/gpio.h"
#include "arduino_board.h" #include "arduino_board.h"
} }
@ -165,5 +166,21 @@ int analogRead(int pin);
void analogWrite(int pin, int value); void analogWrite(int pin, int value);
#endif #endif
/**
* @brief Enables interrupts
*/
static inline void interrupts(void)
{
irq_enable();
}
/**
* @brief Disables interrupts
*/
static inline void noInterrupts(void)
{
irq_disable();
}
#endif /* ARDUINO_HPP */ #endif /* ARDUINO_HPP */
/** @} */ /** @} */