fix(pl18u): rotary encoder emulation acceleration not fully implemented (#7403)

This commit is contained in:
richardclli
2026-06-05 16:22:48 +10:00
committed by GitHub
parent e528ca5318
commit 58a3433c85
+5 -1
View File
@@ -27,6 +27,7 @@
#include "hal.h" #include "hal.h"
#include "delays_driver.h" #include "delays_driver.h"
#include "keys.h" #include "keys.h"
#include "timers_driver.h"
#define REPEAT_DELAY 20 #define REPEAT_DELAY 20
@@ -72,7 +73,7 @@ enum PhysicalTrims
}; };
volatile uint32_t rotencDt = 0; volatile uint32_t rotencDt = 0;
static rotenc_t rotencValue = 0; volatile static rotenc_t rotencValue = 0;
static uint8_t lastRotState = 0; static uint8_t lastRotState = 0;
static uint8_t stateCount = 0; static uint8_t stateCount = 0;
@@ -215,6 +216,9 @@ uint32_t readKeys()
} else { } else {
stateCount++; stateCount++;
if (stateCount == 3) { if (stateCount == 3) {
#if !defined(BOOT)
rotencDt = get_tmr10ms();
#endif
if (rotState == 1) if (rotState == 1)
rotencValue++; rotencValue++;
else if (rotState == 2) else if (rotState == 2)