diff --git a/platformio.ini b/platformio.ini index 50d381c8b..78da2c6e1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [platformio] -default_envs = tbeam # lora-relay-v1 # nrf52840dk-geeksville # linux # or if you'd like to change the default to something like lora-relay-v1 put that here +default_envs = linux # lora-relay-v1 # nrf52840dk-geeksville # linux # or if you'd like to change the default to something like lora-relay-v1 put that here ;default_envs = heltec # lora-relay-v1 # nrf52840dk-geeksville # linux # or if you'd like to change the default to something like lora-relay-v1 put that here [common] diff --git a/src/portduino/PortduinoGlue.cpp b/src/portduino/PortduinoGlue.cpp index 0862e33f9..c8a7e84c4 100644 --- a/src/portduino/PortduinoGlue.cpp +++ b/src/portduino/PortduinoGlue.cpp @@ -1,5 +1,6 @@ #include "CryptoEngine.h" #include "target_specific.h" +#include "PortduinoGPIO.h" #include #include "sleep.h" @@ -34,4 +35,15 @@ void cpuDeepSleep(uint64_t msecs) { // FIXME - implement real crypto for linux CryptoEngine *crypto = new CryptoEngine(); -void updateBatteryLevel(uint8_t level) NOT_IMPLEMENTED("updateBatteryLevel"); \ No newline at end of file +void updateBatteryLevel(uint8_t level) NOT_IMPLEMENTED("updateBatteryLevel"); + + + +/** 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, + * before running 'arduino' code. + */ +void portduinoSetup() { + printf("Setting up Meshtastic on Porduino...\n"); + gpioBind((new SimGPIOPin(RF95_NSS, "RF95_NSS"))->setSilent()); +}