Skip to content

Commit

Permalink
pbio/sys/hmi: Reduce time needed to power off hub.
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensvalk committed Jun 7, 2024
1 parent 83e372a commit c13bcda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
- Allow Bluetooth to be toggled off and on with the Bluetooth button on the
Prime Hub and the Inventor Hub ([support#1615]), and have this state persist
between reboots.
- Reduced hub poweroff time from 3 to 2 second to make it easier to turn off
the hub.

### Changed

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

0 comments on commit c13bcda

Please sign in to comment.