/system is only downloaded tools /tools is all scripts/submodules that are part of the main core /lib is the linker libs
39 lines
772 B
Python
Executable file
39 lines
772 B
Python
Executable file
#!/usr/bin/env python3
|
|
import time
|
|
import subprocess
|
|
import uf2conv
|
|
|
|
boards = False
|
|
while True:
|
|
l = uf2conv.get_drives()
|
|
if (len(l) > 0) and (not boards):
|
|
print ("""
|
|
{
|
|
"eventType": "add",
|
|
"port": {
|
|
"address": "1",
|
|
"label": "Board",
|
|
"boardName": "RPI 2040",
|
|
"protocol": "uf2",
|
|
"protocolLabel": "UF2 Devices",
|
|
"prefs": {},
|
|
"identificationPrefs": {}
|
|
}
|
|
}""", flush=True)
|
|
boards = True
|
|
elif (len(l) == 0) and boards:
|
|
print ("""
|
|
{
|
|
"eventType": "remove",
|
|
"port": {
|
|
"address": "1",
|
|
"label": "Board",
|
|
"boardName": "RPI 2040",
|
|
"protocol": "uf2",
|
|
"protocolLabel": "UF2 Devices",
|
|
"prefs": {},
|
|
"identificationPrefs": {}
|
|
}
|
|
}""", flush=True)
|
|
boards = False
|
|
time.sleep(1)
|