use real gpios for pinelora

1.2-legacy
Kevin Hester 2021-04-27 10:04:02 +08:00
rodzic a66ad8a9d9
commit 9c94a324e5
1 zmienionych plików z 8 dodań i 7 usunięć

Wyświetl plik

@ -23,6 +23,7 @@ void cpuDeepSleep(uint64_t msecs)
void updateBatteryLevel(uint8_t level) NOT_IMPLEMENTED("updateBatteryLevel"); void updateBatteryLevel(uint8_t level) NOT_IMPLEMENTED("updateBatteryLevel");
GPIOPin *loraIrq;
/** apps run under portduino can optionally define a portduinoSetup() to /** apps run under portduino can optionally define a portduinoSetup() to
* use portduino specific init code (such as gpioBind) to setup portduino on their host machine, * use portduino specific init code (such as gpioBind) to setup portduino on their host machine,
@ -33,15 +34,15 @@ void portduinoSetup()
printf("Setting up Meshtastic on Porduino...\n"); printf("Setting up Meshtastic on Porduino...\n");
// FIXME: remove this hack once interrupts are confirmed to work on new pine64 board // FIXME: remove this hack once interrupts are confirmed to work on new pine64 board
auto loraIrq = new LinuxGPIOPin(LORA_DIO1, "ch341", "int", "loraIrq"); // or "err"? loraIrq = new LinuxGPIOPin(LORA_DIO1, "ch341", "int", "loraIrq"); // or "err"?
gpioBind(loraIrq); gpioBind(loraIrq);
// BUSY hw is busted on current board - just use the simulated pin (which will read low) // BUSY hw was busted on current board - just use the simulated pin (which will read low)
//gpioBind(new LinuxGPIOPin(SX1262_BUSY, "ch341", "slct", "loraBusy")); gpioBind(new LinuxGPIOPin(SX1262_BUSY, "ch341", "slct", "loraBusy"));
auto fakeBusy = new SimGPIOPin(SX1262_BUSY, "fakeBusy"); // auto fakeBusy = new SimGPIOPin(SX1262_BUSY, "fakeBusy");
fakeBusy->writePin(LOW); // fakeBusy->writePin(LOW);
fakeBusy->setSilent(true); // fakeBusy->setSilent(true);
gpioBind(fakeBusy); // gpioBind(fakeBusy);
auto loraCs = new LinuxGPIOPin(SX1262_CS, "ch341", "cs0", "loraCs"); auto loraCs = new LinuxGPIOPin(SX1262_CS, "ch341", "cs0", "loraCs");
loraCs->setSilent(true); loraCs->setSilent(true);