mirror of
https://github.com/whowechina/mai_pico.git
synced 2025-02-17 18:08:30 +01:00
Fixed touch update not fast enough issue
This commit is contained in:
parent
b7535d230d
commit
fb074707db
Binary file not shown.
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user