Fixed touch update not fast enough issue

This commit is contained in:
whowechina 2023-12-08 20:59:42 +08:00
parent b7535d230d
commit fb074707db
3 changed files with 4 additions and 4 deletions

Binary file not shown.

View File

@ -45,7 +45,7 @@ uint8_t button_num()
static uint16_t button_reading;
/* If a switch flips, it freezes for a while */
#define DEBOUNCE_FREEZE_TIME_US 5000
#define DEBOUNCE_FREEZE_TIME_US 3000
void button_update()
{
uint64_t now = time_us_64();

View File

@ -229,9 +229,9 @@ static void send_touch()
return;
}
static uint32_t last_sent_time = 0;
uint32_t now = time_us_32();
if (now - last_sent_time < 5000) {
static uint64_t last_sent_time = 0;
uint64_t now = time_us_64();
if (now - last_sent_time < 1000) {
return;
}
last_sent_time = now;