Skip to content
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
9 changes: 7 additions & 2 deletions Firmware/RTK_Everywhere/Tasks.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2017,9 +2017,14 @@ void buttonCheckTask(void *e)
{
// Record the time of the most recent two button releases
// This allows us to detect single and double presses
unsigned long doubleTapInterval = 250; // User must press and release twice within this to create a double tap

if (present.imu_im19 && (present.display_type == DISPLAY_MAX_NONE))
// User must press and release twice within this to create a double tap
// 250ms is OK for youngsters. 500ms is better for older fingers
// Remember that this also limits how fast you can scroll through the display menu
// Set settings.defaultDoubleTapInterval_ms to the minimum for your fingers
unsigned long doubleTapInterval = settings.defaultDoubleTapInterval_ms;

if ((productVariant == RTK_TORCH) || (productVariant == RTK_TORCH_X2))
doubleTapInterval = 1000; // We are only interested in double taps, so use a longer interval

unsigned long previousButtonRelease = 0;
Expand Down
15 changes: 13 additions & 2 deletions Firmware/RTK_Everywhere/menuSystem.ino
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,13 @@ void menuDebugHardware()
systemPrint("19) Print CLI Debugging: ");
systemPrintf("%s\r\n", settings.debugCLI ? "Enabled" : "Disabled");

systemPrintf("20) Delay between CLI LIST prints over BLE: %d\r\n", settings.cliBlePrintDelay_ms);
systemPrintf("20) Delay between CLI LIST prints over BLE: %dms\r\n", settings.cliBlePrintDelay_ms);

systemPrint("21) Print GNSS Config Debugging: ");
systemPrintf("%s\r\n", settings.debugGnssConfig ? "Enabled" : "Disabled");

systemPrintf("22) Default Double-Tap Interval: %dms\r\n", settings.defaultDoubleTapInterval_ms);

systemPrintln("e) Erase LittleFS");

systemPrintln("t) Test Screen");
Expand Down Expand Up @@ -667,11 +669,20 @@ void menuDebugHardware()
settings.cliBlePrintDelay_ms = newDelay;
}
}

else if (incoming == 21)
{
settings.debugGnssConfig ^= 1;
}
else if (incoming == 22)
{
systemPrintf("Enter default double-tap interval (milliseconds, %d to %d): ", 250, 1000);
int newInterval = getUserInputNumber(); // Returns EXIT, TIMEOUT, or long
if ((newInterval != INPUT_RESPONSE_GETNUMBER_EXIT) && (newInterval != INPUT_RESPONSE_GETNUMBER_TIMEOUT))
{
if ((newInterval >= 250) && (newInterval <= 1000))
settings.defaultDoubleTapInterval_ms = newInterval;
}
}

else if (incoming == 'e')
{
Expand Down
2 changes: 2 additions & 0 deletions Firmware/RTK_Everywhere/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ struct Settings
int uartReceiveBufferSize = 1024 * 2; // This buffer is filled automatically as the UART receives characters

// Hardware
uint32_t defaultDoubleTapInterval_ms = 250;
bool enableExternalHardwareEventLogging = false; // Log when INT/TM2 pin goes low
uint16_t spiFrequency = 16; // By default, use 16MHz SPI

Expand Down Expand Up @@ -1431,6 +1432,7 @@ const RTK_Settings_Entry rtkSettingsEntries[] =
{ 0, 1, 0, 1, 1, 1, 1, 1, 1, ALL, 1, _uint16_t, 0, & settings.measurementRateMs, "measurementRateMs", nullptr, },

// Hardware
{ 0, 1, 0, 1, 1, 1, 1, 1, 1, ALL, 1, _uint32_t, 0, & settings.defaultDoubleTapInterval_ms, "defaultDoubleTapInterval", nullptr, },
{ 1, 1, 0, 1, 1, 1, 0, 1, 0, NON, 0, _bool, 0, & settings.enableExternalHardwareEventLogging, "enableExternalHardwareEventLogging", nullptr, },
{ 0, 0, 0, 1, 1, 1, 0, 1, 1, ALL, 0, _uint16_t, 0, & settings.spiFrequency, "spiFrequency", nullptr, },

Expand Down