Skip to content

Commit

Permalink
Fix - GFSK & nano crash (#211)
Browse files Browse the repository at this point in the history
* dev-r3.5_xFSK Bugfix GFSK
 - Allows other modulations than ASK / OOK and 2-FSK to be received.

* fix nano328 send crash
 - revised PROGVERS
 - pins excluded to avoid crash
 - revised comment & changed pins
 - revised code PullUp loop #211 (comment)
  • Loading branch information
HomeAutoUser committed Jun 23, 2021
1 parent c6e7fba commit 4487c02
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/cc1101.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#endif

#define ccMaxBuf 64 // for cc1101 FIFO, variable is better to revised
uint8_t cc1101::ccmode = 3; // MDMCFG2–Modem Configuration Bit 6:4
uint8_t cc1101::ccmode = 3; // MDMCFG2–Modem Configuration Bit 6:4 default ASK/OOK
uint8_t cc1101::revision = 0x01;
uint8_t ccBuf[ccMaxBuf]; // for cc1101 FIFO, if Circuit board for more cc110x -> ccBuf expand ( ccBuf[radionr][ccMaxBuf] )
extern volatile bool blinkLED;
Expand Down Expand Up @@ -247,7 +247,7 @@ void cc1101::writeCCreg(uint8_t reg, uint8_t var) { // write CC1101 register
writeReg(reg - EE_CC1101_CFG, var);

if (reg - EE_CC1101_CFG == 18) {
ccmode = ( var & 0x70 ) >> 4; // for STM32 - read modulation direct from 0x12 MDMCFG2
ccmode = ( var & 0x70 ) >> 4; // read modulation direct from 0x12 MDMCFG2
}

/*
Expand Down Expand Up @@ -596,9 +596,9 @@ void cc1101::getRxFifo(uint16_t Boffs) { // xFSK
fifoBytes = ccMaxBuf;
}
dup = readRXFIFO(fifoBytes);
if (cc1101::ccmode != 2 || dup == false) {
if (cc1101::ccmode != 2 || dup == false) { // Ralf9: 2 - FIFO ohne dup

if (cc1101::ccmode != 9) {
if (cc1101::ccmode != 9) { // Ralf9: 9 - FIFO mit Debug Ausgaben
MSG_PRINT(char(MSG_START)); // SDC_WRITE not work in this scope
MSG_PRINT(F("MN;D="));
}
Expand Down Expand Up @@ -656,7 +656,8 @@ void cc1101::getRxFifo(uint16_t Boffs) { // xFSK
*
*/

if (marcstate == 17 || cc1101::ccmode == 0) { // RXoverflow oder LaCrosse?
if (marcstate == 17 || cc1101::ccmode != 3) { // RXoverflow oder nicht ASK/OOK
// if (marcstate == 17 || cc1101::ccmode == 0) { // RXoverflow oder LaCrosse?
if (cc1101::flushrx()) { // Flush the RX FIFO buffer
cc1101::setReceiveMode();
}
Expand Down
2 changes: 1 addition & 1 deletion src/compile_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*/


#define PROGVERS "3.5.0-dev+20210420"
#define PROGVERS "3.5.0-dev+20210623"

#ifdef OTHER_BOARD_WITH_CC1101
#define CMP_CC1101
Expand Down
27 changes: 26 additions & 1 deletion src/signalduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,34 @@ void setup() {
; // wait for serial port to connect. Needed for native USB
}

for (uint8_t i=2;i<13;i++) {
// defined states - pullup on for unused pins
// start behind RX / TX Pin´s --> all hardware used for system serial 0 & 1
// not radino (other boards) --> end on Pin 23
// radino --> end on Pin 29 (CCM_radino_CC1101.pdf | sources In-Circuit -> pins_arduino.h)
for (uint8_t i=2 ; i<=29;i++) {
#ifndef ARDUINO_RADINOCC1101
if (i>23) break;
#endif

if (i==LED_BUILTIN) continue;
if (i==PIN_LED) continue;
if (i==PIN_RECEIVE) continue;
if (i==PIN_SEND) continue;

#ifdef CMP_CC1101
if (i==MOSI || i==MISO || i==SCK || i==SS) continue;
#endif

#if defined(ARDUINO_RADINOCC1101) || defined(ARDUINO_ATMEGA328P_MINICUL)
if (i==PIN_MARK433) continue;

#ifdef ARDUINO_RADINOCC1101
if (i==8 || i==LED_BUILTIN_RX || i==LED_BUILTIN_TX) continue; // special pin ´s --> ...\packages\In-Circuit\hardware\avr\1.0.0\variants\ictmicro --> pins_arduino.h
#endif
#endif
pinAsInputPullUp(i);
}

//delay(2000);
pinAsInput(PIN_RECEIVE);
pinAsOutput(PIN_LED);
Expand Down

0 comments on commit 4487c02

Please sign in to comment.