Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option to force module to always boot into the menu #361

Merged
merged 4 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions software/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ default configuration:
"DISPLAY_CHANNEL": 0,
"MAX_OUTPUT_VOLTAGE": 10,
"MAX_INPUT_VOLTAGE": 12,
"GATE_VOLTAGE": 5
"GATE_VOLTAGE": 5,
"MENU_AFTER_POWER_ON": false
roryjamesallen marked this conversation as resolved.
Show resolved Hide resolved
}
```

Expand All @@ -36,7 +37,8 @@ default configuration:
The hardware is capable of 12V maximum
- `GATE_VOLTAGE` is an integer in the range `[0, 10]` indicating the voltage that an output will produce when `cvx.on()`
is called. This value must not be higher than `MAX_OUTPUT_VOLTAGE`

- `MENU_AFTER_POWER_ON` is a boolean indicating whether or not the module should always return to the main menu when
it powers on. By default the EuroPi will re-launch the last-used program instead of returning to the main menu.
chrisib marked this conversation as resolved.
Show resolved Hide resolved


# Experimental configuration
Expand Down Expand Up @@ -121,6 +123,7 @@ customizations described in the sections above. Below is a detailed summary of t
'GATE_VOLTAGE',
'MAX_INPUT_VOLTAGE',
'MAX_OUTPUT_VOLTAGE',
'MENU_AFTER_POWER_ON',
'PICO_MODEL',
'ROTATE_DISPLAY'
]
Expand Down
4 changes: 4 additions & 0 deletions software/firmware/bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ def main(self):
europi.b2._handler_both(europi.b1, self.exit_to_menu)

try:
if europi.europi_config.MENU_AFTER_POWER_ON:
# Remove the last-launched file to force the module back to the menu after it powers-on next time
self.save_state_json({})

script_class().main()
except Exception as err:
# set all outputs to zero for safety
Expand Down
8 changes: 7 additions & 1 deletion software/firmware/europi_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def config_points(cls):
default=0
),

# Synthesizer family settings
# I/O voltage settings
configuration.integer(
name="MAX_OUTPUT_VOLTAGE",
range=range(1, 11),
Expand All @@ -89,6 +89,12 @@ def config_points(cls):
range=range(1, 11),
default=5
),

# Menu settings
configuration.boolean(
name="MENU_AFTER_POWER_ON",
default=False
),
]
# fmt: on

Expand Down