On systems that cannot feed the watchdog from an ISR (e.g. anything
without a button) then tab completion is risky because the watchdog might
fire before all the options are listed. Fix this by feeding the dog from
the tx routine.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
A soft reset doesn't reconfigure the watchdog which means if previous
software on the device has set a bad timeout then we are stuck without
until the battery runs flat or a watchdog reset takes place. Add a
mechanism to stop feeding the dog so that we can wait for it to trigger.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This is mostly use for BLE comms since it allows us to easily share
data structures with our peers.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently readline ignores linefeeds which works well for \r\n (and \r)
data but has problems with linefeed seperations (which, amoung other
things, is used by Gadgetbridge's BangleJS driver.
Add support for executing commands on a linefeed whilst ensuring that
we continue to treat \r\n as a single line.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This allows us to load .mpy files stored in the filesystem without having
to invoke the compiler (e.g. with a much lower memory overhead).
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently pinetime reserves 64k of FLASH for an unused file system. This
is pointless because we have a 4MB SPI flash that we can use as a
filesystem.
It is also pointless on dsd6 and nitrogen because we'd prefer to run
without a filesystem than to have something so stunted!
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
These 32 bytes can be used as pseudo-NVRAM to allow communication between
the payload and the bootloader. The pseudo-NVRAM driver can be written in
pure python (using machine.mem32) so there no code changes beyond reserving
the memory are required.
Currently the nrf port doesn't implement a proper RTC (it exposes
raw RTCounters instead) but it is still useful to implement
localtime() and mktime() (although the argument to localtime becomes
mandatory).
Feeding a watchdog from a periodic interrupt isn't the smartest thing
to do (unless you have setup multi-channels) so we also allow us to
express to the WDT driver whether we've arrived from an ISR or not.
Currently it is difficult to deploy uPy on form factor devices without
a reset pin. Any mistake in the boot code risks the system getting
stuck (at least until the battery goes flat). A watchdog and user
button can be combined to give a long-press reset that gives the user
a better shot at recovering the device before the battery runs down!
Move webrepl support code from ports/esp8266/modules into extmod/webrepl
(to be alongside extmod/modwebrepl.c), and use frozen manifests to include
it in the build on esp8266 and esp32.
A small modification is made to webrepl.py to make it work on non-ESP
ports, i.e. don't call dupterm_notify if not available.