From a68a562a49da111ff722a1651dd6f74604d3247b Mon Sep 17 00:00:00 2001 From: Megan Wachs Date: Fri, 9 Dec 2016 17:27:06 -0800 Subject: demo_gpio: Make the demo more interesting with interrupts that actually do things. --- bsp/env/freedom-e300-arty/init.c | 2 +- bsp/env/hifive1.h | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'bsp') diff --git a/bsp/env/freedom-e300-arty/init.c b/bsp/env/freedom-e300-arty/init.c index 4313808..37e9725 100644 --- a/bsp/env/freedom-e300-arty/init.c +++ b/bsp/env/freedom-e300-arty/init.c @@ -44,7 +44,7 @@ uintptr_t handle_trap(uintptr_t mcause, uintptr_t epc) #endif } else { - write(1, "trap\n", 5); + write(1, "Unhandled Trap:\n", 16); _exit(1 + mcause); } return epc; diff --git a/bsp/env/hifive1.h b/bsp/env/hifive1.h index f6bef9f..11b98f8 100644 --- a/bsp/env/hifive1.h +++ b/bsp/env/hifive1.h @@ -66,16 +66,14 @@ #define BUTTON_2_OFFSET 31 #define INT_DEVICE_BUTTON_0 (INT_GPIO_BASE + BUTTON_0_OFFSET) -#define INT_DEVICE_BUTTON_1 (INT_GPIO_BASE + BUTTON_0_OFFSET) -#define INT_DEVICE_BUTTON_2 (INT_GPIO_BASE + BUTTON_0_OFFSET) +#define INT_DEVICE_BUTTON_1 (INT_GPIO_BASE + BUTTON_1_OFFSET) +#define INT_DEVICE_BUTTON_2 (INT_GPIO_BASE + BUTTON_2_OFFSET) #endif #define HAS_HFXOSC 1 #define HAS_LFROSC_BYPASS 1 - - void write_hex(int fd, uint32_t hex); #endif /* _SIFIVE_HIFIVE1_H */ -- cgit v1.2.3