kopia lustrzana https://github.com/dl9rdz/rdz_ttgo_sonde
tentativ apx key fix
rodzic
92edc5e04c
commit
e0ad39b9f0
|
@ -1294,7 +1294,8 @@ int getKeyPress() {
|
|||
return p;
|
||||
}
|
||||
|
||||
int getKey2Press() {
|
||||
// called by arduino main loop (from Sonde::waitRXcomplete) as soon as pmu_irq is set
|
||||
void handlePMUirq() {
|
||||
if (sonde.config.button2_axp) {
|
||||
// Use AXP power button as second button
|
||||
if (pmu_irq) {
|
||||
|
@ -1314,6 +1315,10 @@ int getKey2Press() {
|
|||
xSemaphoreGive( axpSemaphore );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int getKey2Press() {
|
||||
// TODO: Should be atomic
|
||||
KeyPress p = button2.pressed;
|
||||
button2.pressed = KP_NONE;
|
||||
//Serial.printf("button2 press: %d at %ld (%d)\n", p, button2.keydownTime, button2.numberKeyPresses);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const char *version_name = "rdzTTGOsonde";
|
||||
const char *version_id = "devel20201111";
|
||||
const char *version_id = "devel20201111b";
|
||||
const int SPIFFS_MAJOR=2;
|
||||
const int SPIFFS_MINOR=4;
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "Display.h"
|
||||
#include <Wire.h>
|
||||
|
||||
extern SX1278FSK sx1278;
|
||||
|
||||
RXTask rxtask = { -1, -1, -1, 0xFFFF, 0 };
|
||||
|
||||
|
@ -31,7 +30,11 @@ const char *fingerprintText[]={
|
|||
"TTGO T-Beam (new version 1.0), SPI TFT@4,13,14",
|
||||
};
|
||||
|
||||
int getKeyPressEvent(); /* in RX_FSK.ino */
|
||||
/* global variables from RX_FSK.ino */
|
||||
int getKeyPressEvent();
|
||||
int handlePMUirq();
|
||||
extern bool pmu_irq;
|
||||
extern SX1278FSK sx1278;
|
||||
|
||||
/* Task model:
|
||||
* There is a background task for all SX1278 interaction.
|
||||
|
@ -489,7 +492,11 @@ uint16_t Sonde::waitRXcomplete() {
|
|||
uint16_t res=0;
|
||||
uint32_t t0 = millis();
|
||||
rxloop:
|
||||
while( rxtask.receiveResult==0xFFFF && millis()-t0 < 3000) { delay(50); }
|
||||
while( !pmu_irq && rxtask.receiveResult==0xFFFF && millis()-t0 < 3000) { delay(50); }
|
||||
if( pmu_irq ) {
|
||||
handlePMUirq();
|
||||
goto rxloop;
|
||||
}
|
||||
if( rxtask.receiveResult == RX_UPDATERSSI ) {
|
||||
rxtask.receiveResult = 0xFFFF;
|
||||
Serial.print("RSSI update: ");
|
||||
|
|
Ładowanie…
Reference in New Issue