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

pbio/sys/hmi: Reduce time needed to power off hub. #250

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
correction of the `hub.imu.heading()` value ([support#1678]).
- Added `update_heading_correction` to interactively set the heading
correction value ([support#1678]).
- Reduced hub poweroff time from 3 to 2 second to make it easier to turn off
the hub ([pybricks-micropython#250]).

### Changed

Expand All @@ -21,6 +23,7 @@
- The `angular_velocity_threshold`, and `acceleration_threshold` settings
in `hub.imu.settings` are now persistent between reboots.

[pybricks-micropython#250]: https://github.com/pybricks/pybricks-micropython/pull/250
[support#1615]: https://github.com/pybricks/support/issues/1615
[support#1622]: https://github.com/pybricks/support/issues/1622
[support#1678]: https://github.com/pybricks/support/issues/1678
Expand Down
4 changes: 2 additions & 2 deletions lib/pbio/sys/hmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ void pbsys_hmi_poll(void) {
pbsys_status_set(PBIO_PYBRICKS_STATUS_POWER_BUTTON_PRESSED);
update_program_run_button_wait_state(true);

// power off when button is held down for 3 seconds
if (pbsys_status_test_debounce(PBIO_PYBRICKS_STATUS_POWER_BUTTON_PRESSED, true, 3000)) {
// power off when button is held down for 2 seconds
if (pbsys_status_test_debounce(PBIO_PYBRICKS_STATUS_POWER_BUTTON_PRESSED, true, 2000)) {
pbsys_status_set(PBIO_PYBRICKS_STATUS_SHUTDOWN_REQUEST);
}
} else {
Expand Down
Loading