Add kiosk HID firmware build script
This commit is contained in:
parent
30b11d0e5e
commit
4e7745b8da
15
build/kiosk-hid.sh
Executable file
15
build/kiosk-hid.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mkdir -p workspace/src/kiosk-hid
|
||||||
|
cp ../src/kiosk/kiosk-hid.py workspace/src/kiosk-hid/main.py
|
||||||
|
cp ../src/kiosk/manifest-hid.py workspace/src/kiosk-hid/manifest.py
|
||||||
|
cd workspace
|
||||||
|
git clone https://github.com/micropython/micropython.git --branch=master --depth=1
|
||||||
|
cd micropython
|
||||||
|
make -C ports/rp2 submodules
|
||||||
|
make -C mpy-cross
|
||||||
|
cd ports/rp2
|
||||||
|
make FROZEN_MANIFEST=../../../src/kiosk-hid/manifest.py
|
||||||
|
cd ../../../../
|
||||||
|
mkdir -p out
|
||||||
|
mv workspace/micropython/ports/rp2/build-RPI_PICO/firmware.uf2 out/kiosk-hid.uf2
|
@ -44,7 +44,7 @@ from micropython import const
|
|||||||
from usb.device.hid import HIDInterface
|
from usb.device.hid import HIDInterface
|
||||||
|
|
||||||
print("PostalPoint(r) Shipping Kiosk Door Controller")
|
print("PostalPoint(r) Shipping Kiosk Door Controller")
|
||||||
print("Firmware version 1.2.0")
|
print("Firmware version 1.2.1")
|
||||||
print("USB HID build")
|
print("USB HID build")
|
||||||
|
|
||||||
led = Pin(25, Pin.OUT) # Onboard LED
|
led = Pin(25, Pin.OUT) # Onboard LED
|
||||||
@ -122,7 +122,11 @@ class USBHIDInterface(HIDInterface):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def on_set_report(self, report_data, _report_id, _report_type):
|
def on_set_report(self, report_data, _report_id, _report_type):
|
||||||
unlockDoor(False)
|
if report_data[1] == 0x50:
|
||||||
|
print("Entering firmware update mode, power cycle to undo. Goodbye for now!")
|
||||||
|
machine.bootloader()
|
||||||
|
else:
|
||||||
|
unlockDoor(False)
|
||||||
|
|
||||||
def send_data(self, data=None):
|
def send_data(self, data=None):
|
||||||
while self.busy():
|
while self.busy():
|
||||||
@ -175,4 +179,4 @@ try:
|
|||||||
|
|
||||||
except KeyboardInterrupt: # trap Ctrl-C input
|
except KeyboardInterrupt: # trap Ctrl-C input
|
||||||
terminateThread = True # signal second 'background' thread to terminate
|
terminateThread = True # signal second 'background' thread to terminate
|
||||||
exit()
|
exit()
|
||||||
|
4
src/kiosk/manifest-hid.py
Normal file
4
src/kiosk/manifest-hid.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Build manifest for PostalPoint Kiosk Controller (USB HID)
|
||||||
|
include("$(MPY_DIR)/ports/rp2/boards/manifest.py")
|
||||||
|
require("usb-device-hid")
|
||||||
|
module("main.py")
|
Loading…
x
Reference in New Issue
Block a user