Skip to content

Commit

Permalink
Better interrupt handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Nov 24, 2016
1 parent 5220aa1 commit 777ce7f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ BUILD_PATH=build/$(BOARD)
INCLUDES = -I./inc -I./inc/preprocessor
INCLUDES += -I./asf/sam0/utils/cmsis/samd21/include -I./asf/thirdparty/CMSIS/Include -I./asf/sam0/utils/cmsis/samd21/source
INCLUDES += -I./asf/common -I./asf/common/utils -I./asf/sam0/utils/header_files -I./asf/sam0/utils -I./asf/common/utils/interrupt
INCLUDES += -I./asf/sam0/drivers/system/interrupt -I./asf/sam0/drivers/system/interrupt/system_interrupt_samd21
INCLUDES += -I./boards/$(BOARD)

COMMON_SRC = \
Expand Down
15 changes: 13 additions & 2 deletions src/startup_samd21.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void Dummy_Handler(void);

/* Cortex-M0+ core handlers */
void NMI_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void HardFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
//void HardFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void SVC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void PendSV_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void SysTick_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
Expand Down Expand Up @@ -273,10 +273,21 @@ void Reset_Handler(void)
while (1);
}

#include "system_interrupt.h"

/**
* \brief Default interrupt handler for unused IRQs.
*/
void Dummy_Handler(void)
{
//while (1) {}
volatile int act = system_interrupt_get_active();
(void)act;
while (1) {
}
}

void HardFault_Handler(void)
{
while (1) {
}
}

0 comments on commit 777ce7f

Please sign in to comment.