<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/supervisor/shared, branch 6.1.0-alpha.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.1.0-alpha.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.1.0-alpha.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2020-10-13T01:43:21+00:00</updated>
<entry>
<title>Finer grained, per port tick locking</title>
<updated>2020-10-13T01:43:21+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-10-13T01:36:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=379e73af2e55b1f0c517883360e29d5dbc27a20b'/>
<id>urn:sha1:379e73af2e55b1f0c517883360e29d5dbc27a20b</id>
<content type='text'>
Fixes #3504 hopefully.
</content>
</entry>
<entry>
<title>Unify iMX flash config and add Metro M7 1011</title>
<updated>2020-10-07T22:23:47+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-09-29T02:21:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=09bc4157516dd59754a3eb1a5dbbb72a758ebe93'/>
<id>urn:sha1:09bc4157516dd59754a3eb1a5dbbb72a758ebe93</id>
<content type='text'>
This unifies the flash config to the settings used by the Boot ROM.
This makes the config unique per board which allows for changing
quad enable and status bit differences per flash device. It also
allows for timing differences due to the board layout.

This change also tweaks linker layout to leave more ram space for
the CircuitPython heap.
</content>
</entry>
<entry>
<title>Merge pull request #3469 from jepler/noreturn</title>
<updated>2020-10-01T18:18:36+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@adafruit.com</email>
</author>
<published>2020-10-01T18:18:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d62ac24493abb7aadcf68751997092a1b4141b01'/>
<id>urn:sha1:d62ac24493abb7aadcf68751997092a1b4141b01</id>
<content type='text'>
Add some NORETURN attributes</content>
</entry>
<entry>
<title>Update make translate script</title>
<updated>2020-09-29T05:44:30+00:00</updated>
<author>
<name>microDev</name>
<email>70126934+microDev1@users.noreply.github.com</email>
</author>
<published>2020-09-29T05:44:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4c7d9e3aafbde08399d9839d6cde968f4d1ae005'/>
<id>urn:sha1:4c7d9e3aafbde08399d9839d6cde968f4d1ae005</id>
<content type='text'>
</content>
</entry>
<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: Improve serial connection detection</title>
<updated>2020-09-17T23:32:06+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-09-03T18:36:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=28043c94b5ea5f3cce11fa57afa9f3f0141b8dce'/>
<id>urn:sha1:28043c94b5ea5f3cce11fa57afa9f3f0141b8dce</id>
<content type='text'>
These changes remove the caveat from supervisor.runtime.serial_connected.

It appears that _tud_cdc_connected() only tracks explicit changes to the
"DTR" bit, which leads to disconnects not being registered.

Instead:
 * when line state is changed explicitly, track the dtr value in
   _serial_connected
 * when the USB bus is suspended, set _serial_connected to False

Testing performed (using sam e54 xplained):  Run a program to show
the state of `serial_connected` on the LED:
```
import digitalio
import supervisor
import board

led = digitalio.DigitalInOut(board.LED)
while True:
    led.switch_to_output(not supervisor.runtime.serial_connected)
```

Try all the following:
 * open, close serial terminal program
    - LED status tracks whether terminal is open
 * turn on/off data lines using the switchable charge-only cable
    - LED turns off when switch is in "charger" position
    - LED turns back on when switch is in Data position and terminal is
      opened (but doesn't turn back on just because switch position is
      changed)
</content>
</entry>
<entry>
<title>Merge pull request #3398 from jepler/better-dictionary-compression</title>
<updated>2020-09-16T18:10:22+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@adafruit.com</email>
</author>
<published>2020-09-16T18:10:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=750bc1e04ac6f3c5bec7cb6d5f2bdf1e84c45f47'/>
<id>urn:sha1:750bc1e04ac6f3c5bec7cb6d5f2bdf1e84c45f47</id>
<content type='text'>
compression: Implement @ciscorn's dictionary approach</content>
</entry>
<entry>
<title>supervisor translate: explain the dictionary</title>
<updated>2020-09-15T18:18:04+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-09-15T18:18:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d9e336d39f7a19c47cd98619049f5d8e29512947'/>
<id>urn:sha1:d9e336d39f7a19c47cd98619049f5d8e29512947</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update safe_mode.c</title>
<updated>2020-09-13T17:47:14+00:00</updated>
<author>
<name>microDev</name>
<email>70126934+microDev1@users.noreply.github.com</email>
</author>
<published>2020-09-13T17:47:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=506bb097f7af5118a4e52a9471fe4599e681ba39'/>
<id>urn:sha1:506bb097f7af5118a4e52a9471fe4599e681ba39</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update safe mode reason</title>
<updated>2020-09-13T17:27:24+00:00</updated>
<author>
<name>microDev</name>
<email>70126934+microDev1@users.noreply.github.com</email>
</author>
<published>2020-09-13T17:27:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=36da92075b6b83a6b1a998b377f340524d143f35'/>
<id>urn:sha1:36da92075b6b83a6b1a998b377f340524d143f35</id>
<content type='text'>
</content>
</entry>
</feed>
