diff --git a/src/app.cpp b/src/app.cpp index 1dfcf5ef..d3fba12a 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -30,9 +30,9 @@ void app::setup() { DBGPRINTLN(F("false")); mSys.enableDebug(); - mSys.setup(mConfig->nrf.amplifierPower, 47, 38, 37, 36, 35, 48); + mSys.setup(mConfig->nrf.amplifierPower, mConfig->nrf.pinIrq, mConfig->nrf.pinCe, mConfig->nrf.pinCs, mConfig->nrf.pinSclk, mConfig->nrf.pinMosi, mConfig->nrf.pinMiso); - #if defined(AP_ONLY) +#if defined(AP_ONLY) mInnerLoopCb = std::bind(&app::loopStandard, this); #else mInnerLoopCb = std::bind(&app::loopWifi, this); diff --git a/src/app.h b/src/app.h index 55320579..cbf7e6a1 100644 --- a/src/app.h +++ b/src/app.h @@ -162,7 +162,7 @@ class app : public IApp, public ah::Scheduler { } uint8_t getIrqPin(void) { - return 47; + return mConfig->nrf.pinIrq; } String getTimeStr(uint32_t offset = 0) { diff --git a/src/config/settings.h b/src/config/settings.h index a1c5a85f..f4e6a78c 100644 --- a/src/config/settings.h +++ b/src/config/settings.h @@ -73,6 +73,9 @@ typedef struct { uint8_t pinCs; uint8_t pinCe; uint8_t pinIrq; + uint8_t pinMiso; + uint8_t pinMosi; + uint8_t pinSclk; uint8_t amplifierPower; } cfgNrf24_t; @@ -344,6 +347,10 @@ class settings { mCfg.nrf.pinCs = DEF_CS_PIN; mCfg.nrf.pinCe = DEF_CE_PIN; mCfg.nrf.pinIrq = DEF_IRQ_PIN; + mCfg.nrf.pinMiso = DEF_MISO_PIN; + mCfg.nrf.pinMosi = DEF_MOSI_PIN; + mCfg.nrf.pinSclk = DEF_SCLK_PIN; + mCfg.nrf.amplifierPower = DEF_AMPLIFIERPOWER & 0x03; snprintf(mCfg.ntp.addr, NTP_ADDR_LEN, "%s", DEF_NTP_SERVER_NAME); diff --git a/src/hm/hmSystem.h b/src/hm/hmSystem.h index ff592ca0..a95d4d24 100644 --- a/src/hm/hmSystem.h +++ b/src/hm/hmSystem.h @@ -23,7 +23,6 @@ class HmSystem { void setup(uint8_t ampPwr, uint8_t irqPin, uint8_t cePin, uint8_t csPin, uint8_t sclkPin, uint8_t mosiPin, uint8_t misoPin) { mNumInv = 0; - // Radio.setup(ampPwr, 47, 38, 37, 36, 35, 48); Radio.setup(ampPwr, irqPin, cePin, csPin, sclkPin, mosiPin, misoPin); }