Fixed inversion logic and inverted frame sync word (#641)
This commit is contained in:
parent
c1674fba82
commit
132c2b3b82
1 changed files with 6 additions and 2 deletions
|
@ -235,7 +235,11 @@ int16_t PagerClient::startReceive(RADIOLIB_PIN_TYPE pin, uint32_t addr, uint32_t
|
||||||
// now set up the direct mode reception
|
// now set up the direct mode reception
|
||||||
Module* mod = _phy->getMod();
|
Module* mod = _phy->getMod();
|
||||||
mod->pinMode(pin, INPUT);
|
mod->pinMode(pin, INPUT);
|
||||||
|
if(inv) {
|
||||||
|
_phy->setDirectSyncWord(~RADIOLIB_PAGER_FRAME_SYNC_CODE_WORD, 32);
|
||||||
|
} else {
|
||||||
_phy->setDirectSyncWord(RADIOLIB_PAGER_FRAME_SYNC_CODE_WORD, 32);
|
_phy->setDirectSyncWord(RADIOLIB_PAGER_FRAME_SYNC_CODE_WORD, 32);
|
||||||
|
}
|
||||||
_phy->setDirectAction(PagerClientReadBit);
|
_phy->setDirectAction(PagerClientReadBit);
|
||||||
_phy->receiveDirect();
|
_phy->receiveDirect();
|
||||||
|
|
||||||
|
@ -445,7 +449,7 @@ void PagerClient::write(uint32_t codeWord) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally, check if inversion is enabled
|
// finally, check if inversion is enabled
|
||||||
if(inv) {
|
if(!inv) {
|
||||||
change = -change;
|
change = -change;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue