File: use-debian-micropython-runtime-hex

package info (click to toggle)
python-uflash 1.2.4%2Bdfsg-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 264 kB
  • sloc: python: 760; makefile: 221; sh: 40
file content (29 lines) | stat: -rw-r--r-- 971 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Description: Use the Debian-packaged MicroPython firmware by default
 During repacking of the upstream source, we remove the 2 embedded copies of
 the upstream-provided MicroPython runtime. Here we ensure that the MicroPython
 firmware provided in package firmware-microbit-micropython is used by default.
Author: Nick Morrott <nickm@debian.org>
Forwarded: not-needed
Last-Update: 2022-02-15
---
--- a/uflash.py
+++ b/uflash.py
@@ -28,6 +28,10 @@
 except ImportError:  # pragma: no cover
     can_minify = False
 
+# The default Debian MicroPython runtime is provided in the
+# firmware-microbit-micropython package
+DEFAULT_RUNTIME_PATH = "/usr/share/firmware-microbit-micropython/firmware.hex"
+
 #: The magic start address in flash memory for a Python script.
 _SCRIPT_ADDR = 0x3e000
 
@@ -453,6 +457,7 @@
 
 
 #: A string representation of the MicroPython runtime hex.
+_RUNTIME = open(DEFAULT_RUNTIME_PATH).read()
 
 
 if __name__ == '__main__':  # pragma: no cover