git.s-ol.nu hw/0x33.board/firmware / main boot.py
main

Tree @main (Download .tar.gz)

boot.py @mainraw · history · blame

import supervisor
import board
import digitalio
import storage
import config as board

try:
    supervisor.swet_usb_identification("s-ol", "0x33.board", 0x1209, 0x2609)
except AttributeError:
    pass

col = digitalio.DigitalInOut(board.matrix_pins[0][0])
row = digitalio.DigitalInOut(board.matrix_pins[1][-1])
col.switch_to_output(value=True)
row.switch_to_input(pull=digitalio.Pull.DOWN)
mode_pressed = row.value

if mode_pressed == board.dev_mode:
    storage.disable_usb_drive()
    storage.remount("/", False)
    print("Mounting read-write")
else:
    print("Mounting readonly")