From 68f54a35457da4c07ec84bd7e0c2823183e8811e Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Sun, 22 Mar 2015 14:06:56 -0700 Subject: [PATCH] Remove old platform specific error handling macros. --- src/platforms/f4discovery/platform.h | 15 --------------- src/platforms/launchpad-icdi/platform.c | 1 - src/platforms/launchpad-icdi/platform.h | 17 ----------------- src/platforms/libftdi/platform.h | 3 --- src/platforms/native/platform.c | 2 -- src/platforms/native/platform.h | 17 ----------------- src/platforms/stlink/platform.c | 2 -- src/platforms/stlink/platform.h | 15 --------------- src/platforms/swlink/platform.c | 2 -- src/platforms/swlink/platform.h | 15 --------------- 10 files changed, 89 deletions(-) diff --git a/src/platforms/f4discovery/platform.h b/src/platforms/f4discovery/platform.h index 68027ee..92ae046 100644 --- a/src/platforms/f4discovery/platform.h +++ b/src/platforms/f4discovery/platform.h @@ -24,11 +24,8 @@ #ifndef __PLATFORM_H #define __PLATFORM_H -#include "gdb_packet.h" #include "gpio.h" -#include "morse.h" #include "timing.h" -#include "target.h" #include @@ -142,8 +139,6 @@ #define DEBUG(...) -extern jmp_buf fatal_error_jmpbuf; - #define gpio_set_val(port, pin, val) do { \ if(val) \ gpio_set((port), (pin)); \ @@ -155,16 +150,6 @@ extern jmp_buf fatal_error_jmpbuf; #define SET_IDLE_STATE(state) {gpio_set_val(LED_PORT, LED_IDLE_RUN, state);} #define SET_ERROR_STATE(state) {gpio_set_val(LED_PORT, LED_ERROR, state);} -#define PLATFORM_SET_FATAL_ERROR_RECOVERY() {setjmp(fatal_error_jmpbuf);} -#define PLATFORM_FATAL_ERROR(error) { \ - if(running_status) gdb_putpacketz("X1D"); \ - else gdb_putpacketz("EFF"); \ - running_status = 0; \ - target_list_free(); \ - morse("TARGET LOST.", 1); \ - longjmp(fatal_error_jmpbuf, (error)); \ -} - static inline int platform_hwversion(void) { return 0; diff --git a/src/platforms/launchpad-icdi/platform.c b/src/platforms/launchpad-icdi/platform.c index 1a3598a..ff67fa0 100644 --- a/src/platforms/launchpad-icdi/platform.c +++ b/src/platforms/launchpad-icdi/platform.c @@ -33,7 +33,6 @@ extern void trace_tick(void); -jmp_buf fatal_error_jmpbuf; uint8_t running_status; volatile uint32_t timeout_counter; diff --git a/src/platforms/launchpad-icdi/platform.h b/src/platforms/launchpad-icdi/platform.h index ddc2035..c13172f 100644 --- a/src/platforms/launchpad-icdi/platform.h +++ b/src/platforms/launchpad-icdi/platform.h @@ -17,12 +17,6 @@ #ifndef __PLATFORM_H #define __PLATFORM_H -#include "gdb_packet.h" -#include "target.h" -#include "morse.h" - -#include - #include #include @@ -31,7 +25,6 @@ #define DFU_IDENT "Black Magic Firmware Upgrade (Launchpad)" #define DFU_IFACE_STRING "lolwut" -extern jmp_buf fatal_error_jmpbuf; extern uint8_t running_status; extern volatile uint32_t timeout_counter; @@ -108,16 +101,6 @@ extern usbd_driver lm4f_usb_driver; #define SET_IDLE_STATE(state) {} #define SET_ERROR_STATE(state) SET_IDLE_STATE(state) -#define PLATFORM_SET_FATAL_ERROR_RECOVERY() {setjmp(fatal_error_jmpbuf);} -#define PLATFORM_FATAL_ERROR(error) { \ - if( running_status ) gdb_putpacketz("X1D"); \ - else gdb_putpacketz("EFF"); \ - running_status = 0; \ - target_list_free(); \ - morse("TARGET LOST.", 1); \ - longjmp(fatal_error_jmpbuf, (error)); \ -} - #define PLATFORM_HAS_TRACESWO inline static void gpio_set_val(uint32_t port, uint8_t pin, uint8_t val) { diff --git a/src/platforms/libftdi/platform.h b/src/platforms/libftdi/platform.h index 135b2e3..8611674 100644 --- a/src/platforms/libftdi/platform.h +++ b/src/platforms/libftdi/platform.h @@ -36,9 +36,6 @@ #define SET_IDLE_STATE(state) #define SET_ERROR_STATE(state) -#define PLATFORM_FATAL_ERROR(error) abort() -#define PLATFORM_SET_FATAL_ERROR_RECOVERY() - extern struct ftdi_context *ftdic; void platform_buffer_flush(void); diff --git a/src/platforms/native/platform.c b/src/platforms/native/platform.c index ac54b4b..babb498 100644 --- a/src/platforms/native/platform.c +++ b/src/platforms/native/platform.c @@ -35,8 +35,6 @@ #include #include -jmp_buf fatal_error_jmpbuf; - static void adc_init(void); static void setup_vbus_irq(void); diff --git a/src/platforms/native/platform.h b/src/platforms/native/platform.h index 3b1769b..6958585 100644 --- a/src/platforms/native/platform.h +++ b/src/platforms/native/platform.h @@ -24,13 +24,9 @@ #ifndef __PLATFORM_H #define __PLATFORM_H -#include "gdb_packet.h" #include "gpio.h" -#include "morse.h" #include "timing.h" -#include - #define PLATFORM_HAS_TRACESWO #define PLATFORM_HAS_POWER_SWITCH #define BOARD_IDENT "Black Magic Probe" @@ -147,23 +143,10 @@ #define DEBUG(...) -extern jmp_buf fatal_error_jmpbuf; - #define SET_RUN_STATE(state) {running_status = (state);} #define SET_IDLE_STATE(state) {gpio_set_val(LED_PORT, LED_IDLE_RUN, state);} #define SET_ERROR_STATE(state) {gpio_set_val(LED_PORT, LED_ERROR, state);} -#include "target.h" -#define PLATFORM_SET_FATAL_ERROR_RECOVERY() {setjmp(fatal_error_jmpbuf);} -#define PLATFORM_FATAL_ERROR(error) do { \ - if(running_status) gdb_putpacketz("X1D"); \ - else gdb_putpacketz("EFF"); \ - running_status = 0; \ - target_list_free(); \ - morse("TARGET LOST.", 1); \ - longjmp(fatal_error_jmpbuf, (error)); \ -} while (0) - /* Use newlib provided integer only stdio functions */ #define sscanf siscanf #define sprintf siprintf diff --git a/src/platforms/stlink/platform.c b/src/platforms/stlink/platform.c index fb10faa..dd501a4 100644 --- a/src/platforms/stlink/platform.c +++ b/src/platforms/stlink/platform.c @@ -36,8 +36,6 @@ uint8_t running_status; volatile uint32_t timeout_counter; -jmp_buf fatal_error_jmpbuf; - uint16_t led_idle_run; /* Pins PC[14:13] are used to detect hardware revision. Read * 11 for STLink V1 e.g. on VL Discovery, tag as hwversion 0 diff --git a/src/platforms/stlink/platform.h b/src/platforms/stlink/platform.h index 549b6d6..aa02ac0 100644 --- a/src/platforms/stlink/platform.h +++ b/src/platforms/stlink/platform.h @@ -24,17 +24,13 @@ #ifndef __PLATFORM_H #define __PLATFORM_H -#include "gdb_packet.h" #include "gpio.h" #include "timing.h" -#include "target.h" #include #include #include -#include - #define BOARD_IDENT "Black Magic Probe (STLINK), (Firmware 1.5" VERSION_SUFFIX ", build " BUILDDATE ")" #define BOARD_IDENT_DFU "Black Magic (Upgrade) for STLink/Discovery, (Firmware 1.5" VERSION_SUFFIX ", build " BUILDDATE ")" #define BOARD_IDENT_UPD "Black Magic (DFU Upgrade) for STLink/Discovery, (Firmware 1.5" VERSION_SUFFIX ", build " BUILDDATE ")" @@ -131,23 +127,12 @@ #define DEBUG(...) -extern jmp_buf fatal_error_jmpbuf; - extern uint16_t led_idle_run; #define LED_IDLE_RUN led_idle_run #define SET_RUN_STATE(state) {running_status = (state);} #define SET_IDLE_STATE(state) {gpio_set_val(LED_PORT, led_idle_run, state);} #define SET_ERROR_STATE(x) -#define PLATFORM_SET_FATAL_ERROR_RECOVERY() {setjmp(fatal_error_jmpbuf);} -#define PLATFORM_FATAL_ERROR(error) do { \ - if(running_status) gdb_putpacketz("X1D"); \ - else gdb_putpacketz("EFF"); \ - running_status = 0; \ - target_list_free(); \ - longjmp(fatal_error_jmpbuf, (error)); \ -} while (0) - /* Use newlib provided integer only stdio functions */ #define sscanf siscanf #define sprintf siprintf diff --git a/src/platforms/swlink/platform.c b/src/platforms/swlink/platform.c index cbdae0c..02cde19 100644 --- a/src/platforms/swlink/platform.c +++ b/src/platforms/swlink/platform.c @@ -33,8 +33,6 @@ #include #include -jmp_buf fatal_error_jmpbuf; - void platform_init(void) { uint32_t data; diff --git a/src/platforms/swlink/platform.h b/src/platforms/swlink/platform.h index e82124a..2c6fb76 100644 --- a/src/platforms/swlink/platform.h +++ b/src/platforms/swlink/platform.h @@ -24,12 +24,8 @@ #ifndef __PLATFORM_H #define __PLATFORM_H -#include "gdb_packet.h" #include "gpio.h" #include "timing.h" -#include "target.h" - -#include #define BOARD_IDENT "Black Magic Probe (SWLINK), (Firmware 1.5" VERSION_SUFFIX ", build " BUILDDATE ")" #define BOARD_IDENT_DFU "Black Magic (Upgrade), STM8S Discovery, (Firmware 1.5" VERSION_SUFFIX ", build " BUILDDATE ")" @@ -126,21 +122,10 @@ #define DEBUG(...) -extern jmp_buf fatal_error_jmpbuf; - #define SET_RUN_STATE(state) {running_status = (state);} #define SET_IDLE_STATE(state) {gpio_set_val(LED_PORT, LED_IDLE_RUN, state);} #define SET_ERROR_STATE(x) -#define PLATFORM_SET_FATAL_ERROR_RECOVERY() {setjmp(fatal_error_jmpbuf);} -#define PLATFORM_FATAL_ERROR(error) { \ - if(running_status) gdb_putpacketz("X1D"); \ - else gdb_putpacketz("EFF"); \ - running_status = 0; \ - target_list_free(); \ - longjmp(fatal_error_jmpbuf, (error)); \ -} - /* Use newlib provided integer only stdio functions */ #define sscanf siscanf #define sprintf siprintf