Commit 9ad6ce95 authored by Michael Nelson's avatar Michael Nelson

Require at least 50ms of hold time on single press

parent 515cce80
......@@ -71,6 +71,7 @@
// Config
#define BLINK_RATE 250
#define RUNNING_LIGHT_BLINK_RATE 920
#define MINIMUM_PRESS_TIME 50
#define HOLD_DOWN_TIME 500
#define DEBOUNCE_COOLDOWN_TIME 200
......@@ -216,7 +217,7 @@ void read_buttons()
{
for (int i = 0; i < num_ui_actions; i++)
{
if (hold_time[i] && !new_input_blocked && !hold_waiting)
if (hold_time[i] > MINIMUM_PRESS_TIME && !new_input_blocked && !hold_waiting)
{
input_single_hit[i] = true;
debounce_subsequent_input();
......@@ -315,7 +316,7 @@ void loop()
reset_all();
// Horn is driven asynchronously from the rest of the blinking logic
if (hold_time[btn_horn] > 0)
if (hold_time[btn_horn] > MINIMUM_PRESS_TIME)
{
digitalWrite(PIN_OUT_HORN, HIGH); // TOOOOOOT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment