Skip to content
Snippets Groups Projects
Commit 185b3ef7 authored by schneider's avatar schneider
Browse files

fix(interrupt): make error values negative

parent b6a2a86a
No related branches found
No related tags found
No related merge requests found
Pipeline #1357 failed
...@@ -7,7 +7,7 @@ static bool enabled[API_INT_MAX + 1]; ...@@ -7,7 +7,7 @@ static bool enabled[API_INT_MAX + 1];
int api_interrupt_trigger(api_int_id_t id) int api_interrupt_trigger(api_int_id_t id)
{ {
if (id > API_INT_MAX) { if (id > API_INT_MAX) {
return EINVAL; return -EINVAL;
} }
if (enabled[id]) { if (enabled[id]) {
...@@ -32,7 +32,7 @@ void api_interrupt_init(void) ...@@ -32,7 +32,7 @@ void api_interrupt_init(void)
int epic_interrupt_enable(api_int_id_t int_id) int epic_interrupt_enable(api_int_id_t int_id)
{ {
if (int_id > API_INT_MAX) { if (int_id > API_INT_MAX) {
return EINVAL; return -EINVAL;
} }
enabled[int_id] = true; enabled[int_id] = true;
...@@ -42,7 +42,7 @@ int epic_interrupt_enable(api_int_id_t int_id) ...@@ -42,7 +42,7 @@ int epic_interrupt_enable(api_int_id_t int_id)
int epic_interrupt_disable(api_int_id_t int_id) int epic_interrupt_disable(api_int_id_t int_id)
{ {
if (int_id > API_INT_MAX) { if (int_id > API_INT_MAX) {
return EINVAL; return -EINVAL;
} }
enabled[int_id] = false; enabled[int_id] = false;
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#define MICROPY_PY_URE_MATCH_SPAN_START_END (1) #define MICROPY_PY_URE_MATCH_SPAN_START_END (1)
#define MICROPY_PY_URE_SUB (1) #define MICROPY_PY_URE_SUB (1)
#define MICROPY_PY_UTIME_MP_HAL (1) #define MICROPY_PY_UTIME_MP_HAL (1)
#define MICROPY_PY_THREAD (1)
#define MICROPY_PY_THREAD_GIL (1)
/* Modules */ /* Modules */
#define MODULE_UTIME_ENABLED (1) #define MODULE_UTIME_ENABLED (1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment