feat(travelers): TCA9535 充电检测 + 键盘背光 + isVbusIn 修复
- 新增 P1.1 CHARGE_DET 充电检测(高电平=充电中),轮询间隔 2s
- Power.cpp isCharging()/isVbusIn() 均使用 TCA9535_CHARGE_DET_PIN 分支
- 新增 P1.0 键盘背光(高电平点亮),按键时亮,5s 无操作自动熄灭
- 修复开机供电维持:POWER_EN 在 Wire.begin() 后立即锁定
- 修复 P1 config 寄存器值 0x0A(之前 0x8D 导致 P1.2 高阻断电)
- ⚠️ 已知问题:TP4057 电压反串导致未充电时 P1.1 仍读高,需硬件修改
This commit is contained in:
@@ -322,14 +322,27 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
|
||||
if (event->kbchar == INPUT_BROKER_MSG_TAB && handleTabSwitch(event))
|
||||
return 1;
|
||||
|
||||
// Matrix keypad: If matrix key, trigger action select for canned message
|
||||
// Matrix keypad: If matrix key with printable char, let it fall through to
|
||||
// the normal input path (INACTIVE→FREETEXT or FREETEXT→append char).
|
||||
// Only intercept as canned-message selector if kbchar is a valid 1-based index
|
||||
// (e.g., RAK14004 sends kbchar=1..16).
|
||||
if (event->inputEvent == INPUT_BROKER_MATRIXKEY) {
|
||||
runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT;
|
||||
payload = INPUT_BROKER_MATRIXKEY;
|
||||
currentMessageIndex = event->kbchar - 1;
|
||||
lastTouchMillis = millis();
|
||||
requestFocus();
|
||||
return 1;
|
||||
// Printable ASCII (32-126): treat as keyboard input, don't intercept
|
||||
if (event->kbchar >= 32 && event->kbchar <= 126) {
|
||||
// Fall through to normal input handling below
|
||||
} else {
|
||||
// 1-based index from hardware like RAK14004
|
||||
int idx = event->kbchar - 1;
|
||||
if (idx < 0 || idx >= messagesCount) {
|
||||
return 0; // kbchar out of range, ignore
|
||||
}
|
||||
runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT;
|
||||
payload = INPUT_BROKER_MATRIXKEY;
|
||||
currentMessageIndex = idx;
|
||||
lastTouchMillis = millis();
|
||||
requestFocus();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Always normalize navigation/select buttons for further handlers
|
||||
|
||||
Reference in New Issue
Block a user