Use do {...} while(0) for PLATFORM_FATAL_ERROR() macro.

This commit is contained in:
Gareth McMullin 2013-08-19 12:27:36 +12:00
parent fce43bcd98
commit 700833f38f
2 changed files with 4 additions and 4 deletions

View File

@ -163,14 +163,14 @@ extern const char *morse_msg;
#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) { \
#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)
int platform_init(void);
void morse(const char *msg, char repeat);

View File

@ -147,13 +147,13 @@ extern uint16_t led_idle_run;
#define SET_IDLE_STATE(state) {gpio_set_val(LED_PORT, led_idle_run, state);}
#define PLATFORM_SET_FATAL_ERROR_RECOVERY() {setjmp(fatal_error_jmpbuf);}
#define PLATFORM_FATAL_ERROR(error) { \
#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)
int platform_init(void);
void morse(const char *msg, char repeat);