diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-10-01 11:18:36 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-01 11:18:36 -0700 |
| commit | d62ac24493abb7aadcf68751997092a1b4141b01 (patch) | |
| tree | 29f26f565aad2e9d24a3b31e5b0152f0bd3beaaa /supervisor | |
| parent | 160651785a6c64e3292fe6cb3a41a84d1541e0c1 (diff) | |
| parent | dd6e7f5a8afa9d089e1be7f5a5a8110e0044dbd7 (diff) | |
Merge pull request #3469 from jepler/noreturn
Add some NORETURN attributes
Diffstat (limited to 'supervisor')
| -rw-r--r-- | supervisor/port.h | 4 | ||||
| -rw-r--r-- | supervisor/shared/safe_mode.h | 4 | ||||
| -rw-r--r-- | supervisor/stub/safe_mode.c | 5 |
3 files changed, 8 insertions, 5 deletions
diff --git a/supervisor/port.h b/supervisor/port.h index ddb96bd52..f5b3c15d1 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -44,7 +44,7 @@ extern uint32_t _ebss; safe_mode_t port_init(void); // Reset the microcontroller completely. -void reset_cpu(void); +void reset_cpu(void) NORETURN; // Reset the microcontroller state. void reset_port(void); @@ -53,7 +53,7 @@ void reset_port(void); void reset_board(void); // Reset to the bootloader -void reset_to_bootloader(void); +void reset_to_bootloader(void) NORETURN; // Get stack limit address uint32_t *port_stack_get_limit(void); diff --git a/supervisor/shared/safe_mode.h b/supervisor/shared/safe_mode.h index 7d3cd63b5..34fc3c8ae 100644 --- a/supervisor/shared/safe_mode.h +++ b/supervisor/shared/safe_mode.h @@ -27,6 +27,8 @@ #ifndef MICROPY_INCLUDED_SUPERVISOR_SAFE_MODE_H #define MICROPY_INCLUDED_SUPERVISOR_SAFE_MODE_H +#include "py/mpconfig.h" + typedef enum { NO_SAFE_MODE = 0, BROWNOUT, @@ -48,7 +50,7 @@ typedef enum { safe_mode_t wait_for_safe_mode_reset(void); void safe_mode_on_next_reset(safe_mode_t reason); -void reset_into_safe_mode(safe_mode_t reason); +void reset_into_safe_mode(safe_mode_t reason) NORETURN; void print_safe_mode_message(safe_mode_t reason); diff --git a/supervisor/stub/safe_mode.c b/supervisor/stub/safe_mode.c index 8072be2c6..a70ac6b6d 100644 --- a/supervisor/stub/safe_mode.c +++ b/supervisor/stub/safe_mode.c @@ -26,14 +26,15 @@ #include "supervisor/shared/safe_mode.h" +#include <stdlib.h> + safe_mode_t wait_for_safe_mode_reset(void) { return NO_SAFE_MODE; } void reset_into_safe_mode(safe_mode_t reason) { (void) reason; - for (;;) { - } + abort(); } void print_safe_mode_message(safe_mode_t reason) { |
