Skip to content

Commit

Permalink
[SX1231] a recent fix for RadioLib
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Jan 28, 2025
1 parent babdfc3 commit a5e1ef3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/adb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,30 @@ jobs:
- name: Run script
run: |
cd $GITHUB_WORKSPACE/software/utils ;
rm -f data/ogn.cdb data/ogn.md5 ;
rm -f data/fln.cdb data/fln.md5 ;
mkdir -p db data ;
# rm -f cdb/ogn.cdb cdb/ogn.md5 ;
# rm -f cdb/fln.cdb cdb/fln.md5 ;
mkdir -p db cdb ;
sh ogn.sh ;
mv ogn.db db/ ;
mv ogn.cdb data/ ;
md5sum db/ogn.db > db/ogn.md5 ;
md5sum data/ogn.cdb > data/ogn.md5 ;
chmod a-w data/ogn.cdb data/ogn.md5 ;
mv ogn.cdb cdb/ ;
# md5sum db/ogn.db > db/ogn.md5 ;
# md5sum cdb/ogn.cdb > cdb/ogn.md5 ;
# chmod a-w cdb/ogn.cdb cdb/ogn.md5 ;
sh fln.sh ;
mv fln.db db/ ;
mv fln.cdb data/ ;
md5sum db/fln.db > db/fln.md5 ;
md5sum data/fln.cdb > data/fln.md5 ;
chmod a-w data/fln.cdb data/fln.md5 ;
mv fln.cdb cdb/ ;
# md5sum db/fln.db > db/fln.md5 ;
# md5sum cdb/fln.cdb > cdb/fln.md5 ;
# chmod a-w cdb/fln.cdb cdb/fln.md5 ;
echo 'Use data files in "db" folder with SkyView EZ' > README.txt
echo 'Use data files in "cdb" folder with SkyView Pico, Badge or Prime Mk3 Editions' >> README.txt
- uses: actions/upload-artifact@v4
with:
name: Data
path: |
software/utils/db/
software/utils/data/
software/utils/README.txt
if-no-files-found: warn

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Model(s)|Platform|First appearance|       Sta
[**Academy**](https://github.com/lyusupov/SoftRF/wiki/Academy-Edition)&nbsp;![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/updated-icon.gif) **upgrade**|[Renesas<br>RA4M1](https://en.wikipedia.org/wiki/Renesas_Electronics#The_RA_MCU_family)|Q1 2024|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_may_need_imp.png)|
Academy|[Silicon Labs](https://en.wikipedia.org/wiki/Silicon_Labs)<br>[EFx32](https://en.wikipedia.org/wiki/EFM32)|Q3 2024|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_in_progress.png)|
Academy|[Nanjing Qinheng Microelectronics](https://www.wch-ic.com/)<br>[CH32V307](https://www.wch-ic.com/products/CH32V307.html)|Q3 2024|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_may_need_imp.png)|[RISC-V](https://en.wikipedia.org/wiki/RISC-V)<br>IMAFC
[**SkyView Pico**](https://github.com/lyusupov/SoftRF/wiki/SkyView-Pico)&nbsp;![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/updated-icon.gif)|[Raspberry Pi<br>Foundation<br>**RP2350**](https://en.wikipedia.org/wiki/RP2350)|Q1 2025|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_in_progress.png)|
[**SkyView Pico**](https://github.com/lyusupov/SoftRF/wiki/SkyView-Pico)&nbsp;![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/updated-icon.gif)|[Raspberry Pi<br>Foundation<br>**RP2350**](https://en.wikipedia.org/wiki/RP2350)|Q1 2025|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_may_need_imp.png)|

## By sub-1 GHz radio
Radio|Model(s)|First appearance|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|Notes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,12 +701,15 @@ int16_t RF69::setSyncWord(uint8_t* syncWord, size_t len, uint8_t maxErrBits) {
}
}

// enable filtering
int16_t state = enableSyncWordFiltering(maxErrBits);
RADIOLIB_ASSERT(state);

// set the length
state = this->mod->SPIsetRegValue(RADIOLIB_RF69_REG_SYNC_CONFIG, len, 5, 3);

// set sync word register
this->mod->SPIwriteRegisterBurst(RADIOLIB_RF69_REG_SYNC_VALUE_1, syncWord, len);

if(state == RADIOLIB_ERR_NONE) {
this->syncWordLength = len;
}
Expand Down Expand Up @@ -801,7 +804,11 @@ int16_t RF69::variablePacketLengthMode(uint8_t maxLen) {

int16_t RF69::enableSyncWordFiltering(uint8_t maxErrBits) {
// enable sync word recognition
return(this->mod->SPIsetRegValue(RADIOLIB_RF69_REG_SYNC_CONFIG, RADIOLIB_RF69_SYNC_ON | RADIOLIB_RF69_FIFO_FILL_CONDITION_SYNC | (this->syncWordLength - 1) << 3 | maxErrBits, 7, 0));
int16_t state = this->mod->SPIsetRegValue(RADIOLIB_RF69_REG_SYNC_CONFIG, RADIOLIB_RF69_SYNC_ON | RADIOLIB_RF69_FIFO_FILL_CONDITION_SYNC, 7, 6);
RADIOLIB_ASSERT(state);

// set maximum error bits
return(this->mod->SPIsetRegValue(RADIOLIB_RF69_REG_SYNC_CONFIG, maxErrBits, 3, 0));
}

int16_t RF69::disableSyncWordFiltering() {
Expand Down

0 comments on commit a5e1ef3

Please sign in to comment.