circuitpython/supervisor/shared
Jeff Epler 726dcdb60a Add some NORETURN attributes
I have a function where it should be impossible to reach the end, so I put in a safe-mode reset at the bottom:
```
int find_unused_slot(void) {
    // precondition: you already verified that a slot was available
    for (int i=0; i<NUM_SLOTS; i++) {
        if( slot_free(i)) {
            return i;
        }
    }
    safe_mode_reset(MICROPY_FATAL_ERROR);
}
```
However, the compiler still gave a diagnostic, because safe_mode_reset was not declared NORETURN.

So I started by teaching the compiler that reset_into_safe_mode never returned.  This leads at least one level deeper due to reset_cpu needing to be a NORETURN function.  Each port is a little different in this area.  I also marked reset_to_bootloader as NORETURN.
Additional notes:

 * stm32's reset_to_bootloader was not implemented, but now does a bare reset.  Most stm32s are not fitted with uf2 bootloaders anyway.
 * ditto cxd56
 * esp32s2 did not implement reset_cpu at all.  I used esp_restart().  (not tested)
 * litex did not implement reset_cpu at all.  I used reboot_ctrl_write.  But notably this is what reset_to_bootloader already did, so one or the other must be incorrect (not tested).  reboot_ctrl_write cannot be declared NORETURN, as it returns unless the special value 0xac is written), so a new unreachable forever-loop is added.
 * cxd56's reset is via a boardctl() call which can't generically be declared NORETURN, so a new unreacahble "for(;;)" forever-loop is added.
 * In several places, NVIC_SystemReset is redeclared with NORETURN applied.  This is accepted just fine by gcc.  I chose this as preferable to editing the multiple copies of CMSIS headers where it is normally declared.
 * the stub safe_mode reset simply aborts.  This is used in mpy-cross.
2020-09-28 18:55:56 -05:00
..
external_flash Add license to some obvious files. 2020-07-06 19:16:25 +01:00
usb supervisor: Improve serial connection detection 2020-09-17 18:32:06 -05:00
autoreload.c Updates based on feedback from jepler 2020-04-06 16:03:31 -07:00
autoreload.h Refine _bleio 2019-10-21 18:57:03 -07:00
background_callback.c background callbacks: Clear any callbacks that were queued 2020-07-20 08:44:39 -05:00
bluetooth.c wip: advertising; not tested 2020-07-12 19:45:23 -04:00
bluetooth.h wip: compiles 2020-08-02 11:36:38 -04:00
board.c pygamer and pybadge boards were not resetting neopixels 2020-01-24 09:32:28 -05:00
board.h reset NeoPixels on CPB on soft reload 2020-01-23 20:16:31 -05:00
display.c supervisor: Always allocate at least a 1x1 terminal 2020-09-01 10:55:45 -05:00
display.h Turn off terminalio for ja and ko 2020-08-17 17:17:59 -07:00
filesystem.c Allow drive name to be set per target, with fallback to pre-existing behaviour 2020-02-12 11:09:48 +00:00
flash.c flash: Correctly signal error on invalid flash read 2020-06-22 10:24:21 -05:00
internal_flash.h Hopefully fix flash flush and hopefully audio as well. 2020-03-13 11:12:31 -07:00
memory.c Initial ESP32S2 port. 2020-05-15 15:36:16 -07:00
micropython.c supervisor: use mp_handle_pending to check for exceptions 2020-08-23 09:12:01 -05:00
rgb_led_colors.h Reduce DotStar status brightness; macros for status colors 2019-11-01 13:37:36 -04:00
rgb_led_status.c Fix RGB LED use 2020-08-24 18:29:50 -07:00
rgb_led_status.h Disable bitbangio on Itsy M0 2019-08-27 15:21:47 -07:00
safe_mode.c Update safe_mode.c 2020-09-13 23:17:14 +05:30
safe_mode.h Add some NORETURN attributes 2020-09-28 18:55:56 -05:00
serial.c supervisor: Improve serial connection detection 2020-09-17 18:32:06 -05:00
stack.c Initial ESP32S2 port. 2020-05-15 15:36:16 -07:00
stack.h Initial ESP32S2 port. 2020-05-15 15:36:16 -07:00
status_leds.c Add feature conditionals and clean up 2019-07-22 12:58:28 -04:00
status_leds.h Move atmel-samd to tinyusb and support nRF flash. 2018-11-08 17:25:30 -08:00
tick.c merge from upstream 2020-08-30 14:39:03 -04:00
tick.h supervisor: factor supervisor_background_tasks from sundry ports 2020-07-15 11:49:44 -05:00
translate.c Small improvements to the dictionary compression 2020-09-14 01:50:01 +09:00
translate.h supervisor translate: explain the dictionary 2020-09-15 13:18:04 -05:00