Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dos
flow3r firmware
Commits
e830141f
Commit
e830141f
authored
1 year ago
by
q3k
Browse files
Options
Downloads
Patches
Plain Diff
py: run disk mode from menu
parent
6cf958f6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
python_payload/st3m/run.py
+5
-3
5 additions, 3 deletions
python_payload/st3m/run.py
sim/fakes/machine.py
+18
-0
18 additions, 0 deletions
sim/fakes/machine.py
with
23 additions
and
3 deletions
python_payload/st3m/run.py
+
5
−
3
View file @
e830141f
...
...
@@ -103,7 +103,7 @@ def run_view(v: View) -> None:
reactor
.
run
()
def
yeet_local_changes
()
->
None
:
def
_
yeet_local_changes
()
->
None
:
os
.
remove
(
"
/flash/sys/.sys-installed
"
)
machine
.
reset
()
...
...
@@ -125,10 +125,12 @@ def run_main() -> None:
[
MenuItemBack
(),
MenuItemForeground
(
"
Settings
"
,
menu_settings
),
MenuItemNoop
(
"
Disk Mode
"
),
MenuItemAction
(
"
Disk Mode (Flash)
"
,
machine
.
disk_mode_flash
),
MenuItemAction
(
"
Disk Mode (SD)
"
,
machine
.
disk_mode_sd
),
MenuItemLaunchPersistentView
(
"
About
"
,
About
),
MenuItemAction
(
"
Yeet Local Changes
"
,
yeet_local_changes
),
MenuItemAction
(
"
Yeet Local Changes
"
,
_
yeet_local_changes
),
MenuItemAction
(
"
Reboot
"
,
lambda
:
machine
.
reset
()),
MenuItemAction
(
"
Reboot
"
,
machine
.
reset
),
],
)
menu_main
=
SunMenu
(
...
...
This diff is collapsed.
Click to expand it.
sim/fakes/machine.py
+
18
−
0
View file @
e830141f
import
sys
class
Pin
:
IN
=
None
...
...
@@ -14,3 +17,18 @@ class ADC:
def
read_uv
(
self
):
# A half full battery as seen by the ADC
return
3.8e6
/
2
def
reset
():
print
(
"
beep boop i have reset
"
)
sys
.
exit
(
0
)
def
disk_mode_flash
():
print
(
"
beep boop i
'
m now in flash disk mode
"
)
sys
.
exit
(
0
)
def
disk_mode_sd
():
print
(
"
beep boop i
'
m now in sd card disk mode
"
)
sys
.
exit
(
0
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment