mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-16 18:12:07 +00:00
pinelora wip
This commit is contained in:
parent
2a9b2d3b29
commit
a42bb80cf4
@ -23,6 +23,31 @@ void cpuDeepSleep(uint64_t msecs)
|
|||||||
void updateBatteryLevel(uint8_t level) NOT_IMPLEMENTED("updateBatteryLevel");
|
void updateBatteryLevel(uint8_t level) NOT_IMPLEMENTED("updateBatteryLevel");
|
||||||
|
|
||||||
|
|
||||||
|
/** a simulated pin for busted IRQ hardware
|
||||||
|
* Porduino helper class to do this i2c based polling:
|
||||||
|
*/
|
||||||
|
class PolledIrqPin : public GPIOPin
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PolledIrqPin() : GPIOPin(LORA_DIO1, "loraIRQ") {}
|
||||||
|
|
||||||
|
/// Read the low level hardware for this pin
|
||||||
|
virtual PinStatus readPinHardware()
|
||||||
|
{
|
||||||
|
if (isrPinStatus < 0)
|
||||||
|
return LOW; // No interrupt handler attached, don't bother polling i2c right now
|
||||||
|
else {
|
||||||
|
extern RadioInterface *rIf; // FIXME, temporary hack until we know if we need to keep this
|
||||||
|
|
||||||
|
assert(rIf);
|
||||||
|
RadioLibInterface *rIf95 = static_cast<RadioLibInterface *>(rIf);
|
||||||
|
bool p = rIf95->isIRQPending();
|
||||||
|
log(SysGPIO, LogDebug, "PolledIrqPin::readPinHardware(%s, %d, %d)", getName(), getPinNum(), p);
|
||||||
|
return p ? HIGH : LOW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
GPIOPin *loraIrq;
|
GPIOPin *loraIrq;
|
||||||
|
|
||||||
/** apps run under portduino can optionally define a portduinoSetup() to
|
/** apps run under portduino can optionally define a portduinoSetup() to
|
||||||
@ -34,18 +59,24 @@ 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
|
||||||
|
// loraIrq = new PolledIrqPin();
|
||||||
loraIrq = new LinuxGPIOPin(LORA_DIO1, "ch341", "int", "loraIrq"); // or "err"?
|
loraIrq = new LinuxGPIOPin(LORA_DIO1, "ch341", "int", "loraIrq"); // or "err"?
|
||||||
|
loraIrq->setSilent();
|
||||||
gpioBind(loraIrq);
|
gpioBind(loraIrq);
|
||||||
|
|
||||||
// BUSY hw was 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"));
|
auto busy = new LinuxGPIOPin(SX1262_BUSY, "ch341", "slct", "loraBusy");
|
||||||
// auto fakeBusy = new SimGPIOPin(SX1262_BUSY, "fakeBusy");
|
busy->setSilent();
|
||||||
// fakeBusy->writePin(LOW);
|
gpioBind(busy);
|
||||||
// fakeBusy->setSilent(true);
|
//auto fakeBusy = new SimGPIOPin(SX1262_BUSY, "fakeBusy");
|
||||||
// gpioBind(fakeBusy);
|
//fakeBusy->writePin(LOW);
|
||||||
|
//fakeBusy->setSilent(true);
|
||||||
|
//gpioBind(fakeBusy);
|
||||||
|
|
||||||
|
gpioBind(new LinuxGPIOPin(SX1262_RESET, "ch341", "ini", "loraReset"));
|
||||||
|
|
||||||
auto loraCs = new LinuxGPIOPin(SX1262_CS, "ch341", "cs0", "loraCs");
|
auto loraCs = new LinuxGPIOPin(SX1262_CS, "ch341", "cs0", "loraCs");
|
||||||
loraCs->setSilent(true);
|
loraCs->setSilent();
|
||||||
gpioBind(loraCs);
|
gpioBind(loraCs);
|
||||||
|
|
||||||
// gpioBind((new SimGPIOPin(LORA_RESET, "LORA_RESET")));
|
// gpioBind((new SimGPIOPin(LORA_RESET, "LORA_RESET")));
|
||||||
|
@ -231,8 +231,6 @@ External serial flash WP25R1635FZUIL0
|
|||||||
#define PIN_GPS_TX (32 + 9) // This is for bits going TOWARDS the CPU
|
#define PIN_GPS_TX (32 + 9) // This is for bits going TOWARDS the CPU
|
||||||
#define PIN_GPS_RX (32 + 8) // This is for bits going TOWARDS the GPS
|
#define PIN_GPS_RX (32 + 8) // This is for bits going TOWARDS the GPS
|
||||||
|
|
||||||
#define HAS_AIR530_GPS
|
|
||||||
|
|
||||||
#define PIN_SERIAL1_RX PIN_GPS_TX
|
#define PIN_SERIAL1_RX PIN_GPS_TX
|
||||||
#define PIN_SERIAL1_TX PIN_GPS_RX
|
#define PIN_SERIAL1_TX PIN_GPS_RX
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user