-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add automatic provisioning of the frontboard, from mpy files in github
TODO: This currently still builds the files into the firmware, the github action needs changing to mpy-cross these independently
- Loading branch information
1 parent
f22c91a
commit b9f2917
Showing
7 changed files
with
67 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,27 @@ | ||
from app import App | ||
from system.hexpansion.util import read_hexpansion_header, get_hexpansion_block_devices | ||
import vfs | ||
|
||
|
||
class FrontBoard(App): | ||
year: int | ||
|
||
|
||
def mount_frontboard(i2c, readonly=True): | ||
header = read_hexpansion_header(i2c, eeprom_addr=0x57) | ||
if header is None: | ||
return False | ||
|
||
try: | ||
eep, partition = get_hexpansion_block_devices(i2c, header, addr=0x57) | ||
except Exception: | ||
return False | ||
|
||
mountpoint = "/frontboard" | ||
|
||
try: | ||
vfs.mount(partition, mountpoint, readonly=readonly) | ||
except OSError: | ||
return False | ||
|
||
return True |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters