Skip to content

Commit 42f10e1

Browse files
committed
pbio/sys/hmi: Reduce time needed to power off hub.
1 parent 5a24099 commit 42f10e1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
correction of the `hub.imu.heading()` value ([support#1678]).
1414
- Added `update_heading_correction` to interactively set the heading
1515
correction value ([support#1678]).
16+
- Reduced hub poweroff time from 3 to 2 second to make it easier to turn off
17+
the hub ([pybricks-micropython#250]).
1618

1719
### Changed
1820

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

26+
[pybricks-micropython#250]: https://github.com/pybricks/pybricks-micropython/pull/250
2427
[support#1615]: https://github.com/pybricks/support/issues/1615
2528
[support#1622]: https://github.com/pybricks/support/issues/1622
2629
[support#1678]: https://github.com/pybricks/support/issues/1678

lib/pbio/sys/hmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ void pbsys_hmi_poll(void) {
129129
pbsys_status_set(PBIO_PYBRICKS_STATUS_POWER_BUTTON_PRESSED);
130130
update_program_run_button_wait_state(true);
131131

132-
// power off when button is held down for 3 seconds
133-
if (pbsys_status_test_debounce(PBIO_PYBRICKS_STATUS_POWER_BUTTON_PRESSED, true, 3000)) {
132+
// power off when button is held down for 2 seconds
133+
if (pbsys_status_test_debounce(PBIO_PYBRICKS_STATUS_POWER_BUTTON_PRESSED, true, 2000)) {
134134
pbsys_status_set(PBIO_PYBRICKS_STATUS_SHUTDOWN_REQUEST);
135135
}
136136
} else {

0 commit comments

Comments
 (0)