summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/button.c3
-rw-r--r--common/power_button.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/common/button.c b/common/button.c
index 1ccc548c75..4ca1dac852 100644
--- a/common/button.c
+++ b/common/button.c
@@ -367,7 +367,8 @@ static int console_command_button(int argc, char **argv)
button_interrupt_simulate(button_idx);
/* Hold the button(s) */
- msleep(press_ms);
+ if (press_ms > 0)
+ msleep(press_ms);
/* Release the button(s) */
for (button_idx = 0; button_idx < BUTTON_COUNT; button_idx++)
diff --git a/common/power_button.c b/common/power_button.c
index a5da582afd..97ac7b0a77 100644
--- a/common/power_button.c
+++ b/common/power_button.c
@@ -179,7 +179,8 @@ static int command_powerbtn(int argc, char **argv)
power_button_is_stable = 0;
hook_call_deferred(&power_button_change_deferred_data, 0);
- msleep(ms);
+ if (ms > 0)
+ msleep(ms);
ccprintf("Simulating power button release.\n");
simulate_power_pressed = 0;