mirror of
https://github.com/supleed2/EIE4-FYP.git
synced 2024-12-22 06:05:49 +00:00
Add custom isr.cpp
to project
This commit is contained in:
parent
eb55b06779
commit
4c8687014e
|
@ -3,7 +3,7 @@ BUILD_DIR?=../build/gsd_orangecrab/
|
|||
include $(BUILD_DIR)/software/include/generated/variables.mak
|
||||
include $(SOC_DIRECTORY)/software/common.mak
|
||||
|
||||
OBJECTS = audio.o can.o crt0.o donut.o led.o main.o
|
||||
OBJECTS = audio.o can.o crt0.o donut.o isr.o led.o main.o
|
||||
CFLAGS += -DWITH_CXX
|
||||
|
||||
|
||||
|
|
30
demo/isr.cpp
Normal file
30
demo/isr.cpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
// This file is Copyright (c) 2013-2014 Sebastien Bourdeauducq <sb@m-labs.hk>
|
||||
// This file is Copyright (c) 2019 Gabriel L. Somlo <gsomlo@gmail.com>
|
||||
// This file is Copyright (c) 2020 Raptor Engineering, LLC <sales@raptorengineering.com>
|
||||
// License: BSD
|
||||
|
||||
#include "can"
|
||||
#include <generated/csr.h>
|
||||
#include <generated/soc.h>
|
||||
#include <irq.h>
|
||||
#include <libbase/uart.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef CONFIG_CPU_HAS_INTERRUPT
|
||||
void isr(void) {
|
||||
__attribute__((unused)) unsigned int irqs;
|
||||
|
||||
irqs = irq_pending() & irq_getmask();
|
||||
|
||||
#ifdef CSR_UART_BASE
|
||||
#ifndef UART_POLLING
|
||||
if (irqs & (1 << UART_INTERRUPT))
|
||||
uart_isr();
|
||||
#endif
|
||||
#ifdef CAN_INTERRUPT
|
||||
if (irqs & (1 << CAN_INTERRUPT))
|
||||
can_isr();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
Loading…
Reference in a new issue