mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-22 18:57:12 +02:00
set radio pointer to inverter
This commit is contained in:
parent
9b22b1017a
commit
dcd5d5a72b
2 changed files with 9 additions and 3 deletions
|
@ -60,9 +60,13 @@ void app::setup() {
|
|||
#endif /* defined(ETHERNET) */
|
||||
|
||||
mSys.setup(&mTimestamp, &mConfig->inst);
|
||||
Inverter<> *iv;
|
||||
for (uint8_t i = 0; i < MAX_NUM_INVERTERS; i++) {
|
||||
mSys.addInverter(i);
|
||||
mSys.addInverter(i, [this](Inverter<> *iv) {
|
||||
if((IV_MI == iv->ivGen) || (IV_HM == iv->ivGen))
|
||||
iv->radio = &mNrfRadio;
|
||||
else if((IV_HMS == iv->ivGen) || (IV_HMT == iv->ivGen))
|
||||
iv->radio = &mCmtRadio;
|
||||
});
|
||||
}
|
||||
if (mConfig->nrf.enabled) {
|
||||
mPayload.setup(this, &mSys, &mNrfRadio, &mNrfStat, mConfig->nrf.maxRetransPerPyld, &mTimestamp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue