mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 09:43:03 +00:00
[Add] SX1280 to linux native Portduino (#3023)
* Update PortduinoGlue.cpp * Update PortduinoGlue.h * Update main.cpp * Update config-dist.yaml * Update config-dist.yaml * Fix whitespace in main.cpp --------- Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
This commit is contained in:
committed by
GitHub
parent
a138e9cb6b
commit
16a3a32f2a
16
src/main.cpp
16
src/main.cpp
@@ -742,6 +742,20 @@ void setup()
|
||||
LOG_INFO("RF95 Radio init succeeded, using RF95 radio\n");
|
||||
}
|
||||
}
|
||||
} else if (settingsMap[use_sx1280]) {
|
||||
if (!rIf) {
|
||||
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings);
|
||||
rIf = new SX1280Interface((LockingArduinoHal *)RadioLibHAL, settingsMap[cs], settingsMap[irq], settingsMap[reset],
|
||||
settingsMap[busy]);
|
||||
if (!rIf->init()) {
|
||||
LOG_ERROR("Failed to find SX1280 radio\n");
|
||||
delete rIf;
|
||||
rIf = NULL;
|
||||
exit(EXIT_FAILURE);
|
||||
} else {
|
||||
LOG_INFO("SX1280 Radio init succeeded, using SX1280 radio\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(HW_SPI1_DEVICE)
|
||||
@@ -965,4 +979,4 @@ void loop()
|
||||
mainDelay.delay(delayMsec);
|
||||
}
|
||||
// if (didWake) LOG_DEBUG("wake!\n");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user