Commit 7b56f29a authored by Rahix's avatar Rahix

chore(interrupts): Fix all modules to use new api

Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent 52b1fbbc
#include "epicardium.h"
#include "api/dispatcher.h"
#include "api/interrupt-sender.h"
#include "modules/log.h"
#include "card10.h"
......@@ -10,6 +9,7 @@
#include "tmr.h"
static void __core1_init(void);
extern void interrupt_trigger(api_int_id_t id);
struct core1_info {
/* Location of core1's interrupt vector table */
......@@ -207,7 +207,7 @@ void core1_boot(void)
void core1_trigger_reset(void)
{
/* Signal core 1 that we intend to load a new payload. */
api_interrupt_trigger(EPIC_INT_RESET);
interrupt_trigger(EPIC_INT_RESET);
}
void core1_wait_ready(void)
......
......@@ -11,7 +11,6 @@
#include "task.h"
#include "queue.h"
#include "api/interrupt-sender.h"
#include "epicardium.h"
#include "modules/log.h"
#include "modules/modules.h"
......@@ -320,7 +319,7 @@ bhi160_handle_packet(bhy_data_type_t data_type, bhy_data_generic_t *sensor_data)
}
if (wakeup) {
api_interrupt_trigger(epic_int);
interrupt_trigger(epic_int);
}
break;
default:
......
......@@ -4,7 +4,6 @@
#include "modules/config.h"
#include "modules/mutex.h"
#include "api/dispatcher.h"
#include "api/interrupt-sender.h"
#include "l0der/l0der.h"
#include "card10.h"
......
......@@ -11,7 +11,6 @@
#include "task.h"
#include "queue.h"
#include "api/interrupt-sender.h"
#include "epicardium.h"
#include "modules/log.h"
#include "modules/modules.h"
......@@ -141,7 +140,7 @@ static void max30001_handle_samples(int16_t *sensor_data, int16_t n)
LOG_WARN("max30001", "queue full");
}
}
api_interrupt_trigger(EPIC_INT_MAX30001_ECG);
interrupt_trigger(EPIC_INT_MAX30001_ECG);
}
/***** Functions *****/
......
......@@ -13,7 +13,6 @@
#include "task.h"
#include "queue.h"
#include "api/interrupt-sender.h"
#include "modules/modules.h"
static const gpio_cfg_t max86150_interrupt_pin = {
......@@ -141,7 +140,7 @@ static int max86150_handle_sample(struct max86150_sensor_data *data)
return -EIO;
}
api_interrupt_trigger(EPIC_INT_MAX86150);
interrupt_trigger(EPIC_INT_MAX86150);
return 0;
}
......
#include "epicardium.h"
#include "modules/log.h"
#include "api/interrupt-sender.h"
#include "modules/modules.h"
#include "FreeRTOS.h"
#include "task.h"
......@@ -84,19 +84,23 @@ void epic_rtc_set_milliseconds(uint64_t milliseconds)
monotonic_offset += diff;
}
/* We need to use interrupt_trigger_unsafe() here */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
void RTC_IRQHandler(void)
{
int flags = RTC_GetFlags();
if (flags & MXC_F_RTC_CTRL_ALDF) {
RTC_ClearFlags(MXC_F_RTC_CTRL_ALDF);
api_interrupt_trigger(EPIC_INT_RTC_ALARM);
interrupt_trigger_unsafe(EPIC_INT_RTC_ALARM);
} else {
LOG_WARN("rtc", "Unknown IRQ caught!");
/* Disable IRQ so it does not retrigger */
NVIC_DisableIRQ(RTC_IRQn);
}
}
#pragma GCC diagnostic pop
int epic_rtc_schedule_alarm(uint32_t timestamp)
{
......@@ -107,7 +111,7 @@ int epic_rtc_schedule_alarm(uint32_t timestamp)
* immediately.
*/
if (epic_rtc_get_seconds() >= timestamp) {
api_interrupt_trigger(EPIC_INT_RTC_ALARM);
interrupt_trigger(EPIC_INT_RTC_ALARM);
return 0;
}
......
#include "epicardium.h"
#include "api/interrupt-sender.h"
#include "modules/log.h"
#include "modules/modules.h"
......@@ -280,7 +279,7 @@ void serial_enqueue_char(char chr)
{
if (chr == 0x3) {
/* Control-C */
api_interrupt_trigger(EPIC_INT_CTRL_C);
interrupt_trigger(EPIC_INT_CTRL_C);
}
if (xQueueSend(read_queue, &chr, 100) == errQUEUE_FULL) {
......@@ -288,7 +287,7 @@ void serial_enqueue_char(char chr)
vTaskDelay(portTICK_PERIOD_MS * 50);
}
api_interrupt_trigger(EPIC_INT_UART_RX);
interrupt_trigger(EPIC_INT_UART_RX);
}
void vSerialTask(void *pvParameters)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment