<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/supervisor/stub, branch 6.0.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.0.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.0.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2020-09-28T23:55:56+00:00</updated>
<entry>
<title>Add some NORETURN attributes</title>
<updated>2020-09-28T23:55:56+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-09-24T16:20:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=726dcdb60aa84b5070e5484a19e896abdaffeb93'/>
<id>urn:sha1:726dcdb60aa84b5070e5484a19e896abdaffeb93</id>
<content type='text'>
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&lt;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.
</content>
</entry>
<entry>
<title>supervisor: stub: make unimplemented safe_mode loop forever</title>
<updated>2020-09-24T21:57:20+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-09-24T21:57:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6bcbe51f7fcfaca6ee3ee40b4ce64fd791725e8f'/>
<id>urn:sha1:6bcbe51f7fcfaca6ee3ee40b4ce64fd791725e8f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add license to some obvious files.</title>
<updated>2020-07-06T18:16:25+00:00</updated>
<author>
<name>Diego Elio Pettenò</name>
<email>flameeyes@flameeyes.com</email>
</author>
<published>2020-06-03T22:40:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=34b4993d63a6b576f29d624385c681f679b4124c'/>
<id>urn:sha1:34b4993d63a6b576f29d624385c681f679b4124c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix up end of file and trailing whitespace.</title>
<updated>2020-06-03T09:56:35+00:00</updated>
<author>
<name>Diego Elio Pettenò</name>
<email>flameeyes@flameeyes.com</email>
</author>
<published>2020-05-30T09:44:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=dd5d7c86d22807c021dd1711eb7dd3daebc5cfcf'/>
<id>urn:sha1:dd5d7c86d22807c021dd1711eb7dd3daebc5cfcf</id>
<content type='text'>
This can be enforced by pre-commit, but correct it separately to make it easier to review.
</content>
</entry>
<entry>
<title>Enable showing the console on a debug uart</title>
<updated>2020-05-19T00:02:52+00:00</updated>
<author>
<name>Mark Olsson</name>
<email>post@markolsson.se</email>
</author>
<published>2020-05-18T12:04:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=007c92ee6ab8da342dacb8967ef999b6d83596ec'/>
<id>urn:sha1:007c92ee6ab8da342dacb8967ef999b6d83596ec</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove unused static function</title>
<updated>2019-09-06T15:06:02+00:00</updated>
<author>
<name>Hierophect</name>
<email>hierophect@gmail.com</email>
</author>
<published>2019-09-06T15:06:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=bc376498845a67a0348f2f7c4a73fbb55b7563bb'/>
<id>urn:sha1:bc376498845a67a0348f2f7c4a73fbb55b7563bb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>text fixes</title>
<updated>2019-08-15T21:56:15+00:00</updated>
<author>
<name>Hierophect</name>
<email>hierophect@gmail.com</email>
</author>
<published>2019-08-15T21:56:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7dbf1a8caaebf15a634930b1b3e7f3bdc559a180'/>
<id>urn:sha1:7dbf1a8caaebf15a634930b1b3e7f3bdc559a180</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix flash size, add filesystem disable flag</title>
<updated>2019-08-15T19:55:33+00:00</updated>
<author>
<name>Hierophect</name>
<email>hierophect@gmail.com</email>
</author>
<published>2019-08-15T19:55:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a9d3ad86e5f400b9315fde58c9b8666a048956ca'/>
<id>urn:sha1:a9d3ad86e5f400b9315fde58c9b8666a048956ca</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Stub out safe mode for mpy-cross</title>
<updated>2019-03-12T18:18:30+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-03-09T00:20:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d6b2199f3614a5fe2d4da4163ca901ac1e567f5f'/>
<id>urn:sha1:d6b2199f3614a5fe2d4da4163ca901ac1e567f5f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix unix build by using filesystem stub</title>
<updated>2019-02-21T21:23:28+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-02-21T21:23:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ed1ace09e971b24bc9ff88defe2e128064780824'/>
<id>urn:sha1:ed1ace09e971b24bc9ff88defe2e128064780824</id>
<content type='text'>
</content>
</entry>
</feed>
