Remove old platform specific error handling macros.
This commit is contained in:
parent
5ab8564ff6
commit
68f54a3545
|
@ -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 <setjmp.h>
|
||||
|
||||
|
@ -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;
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
extern void trace_tick(void);
|
||||
|
||||
jmp_buf fatal_error_jmpbuf;
|
||||
uint8_t running_status;
|
||||
volatile uint32_t timeout_counter;
|
||||
|
||||
|
|
|
@ -17,12 +17,6 @@
|
|||
#ifndef __PLATFORM_H
|
||||
#define __PLATFORM_H
|
||||
|
||||
#include "gdb_packet.h"
|
||||
#include "target.h"
|
||||
#include "morse.h"
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
#include <libopencm3/lm4f/gpio.h>
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
|
||||
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
#include <libopencm3/usb/usbd.h>
|
||||
#include <libopencm3/stm32/f1/adc.h>
|
||||
|
||||
jmp_buf fatal_error_jmpbuf;
|
||||
|
||||
static void adc_init(void);
|
||||
static void setup_vbus_irq(void);
|
||||
|
||||
|
|
|
@ -24,13 +24,9 @@
|
|||
#ifndef __PLATFORM_H
|
||||
#define __PLATFORM_H
|
||||
|
||||
#include "gdb_packet.h"
|
||||
#include "gpio.h"
|
||||
#include "morse.h"
|
||||
#include "timing.h"
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
#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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -24,17 +24,13 @@
|
|||
#ifndef __PLATFORM_H
|
||||
#define __PLATFORM_H
|
||||
|
||||
#include "gdb_packet.h"
|
||||
#include "gpio.h"
|
||||
#include "timing.h"
|
||||
#include "target.h"
|
||||
|
||||
#include <libopencm3/cm3/common.h>
|
||||
#include <libopencm3/stm32/f1/memorymap.h>
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
#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
|
||||
|
|
|
@ -33,8 +33,6 @@
|
|||
#include <libopencm3/usb/usbd.h>
|
||||
#include <libopencm3/stm32/f1/adc.h>
|
||||
|
||||
jmp_buf fatal_error_jmpbuf;
|
||||
|
||||
void platform_init(void)
|
||||
{
|
||||
uint32_t data;
|
||||
|
|
|
@ -24,12 +24,8 @@
|
|||
#ifndef __PLATFORM_H
|
||||
#define __PLATFORM_H
|
||||
|
||||
#include "gdb_packet.h"
|
||||
#include "gpio.h"
|
||||
#include "timing.h"
|
||||
#include "target.h"
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
#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
|
||||
|
|
Loading…
Reference in New Issue