Skip to content

Commit

Permalink
Merge branch 'dev-r3.5_xFSK' into dev-r3.5_xFSK_mcloopfix
Browse files Browse the repository at this point in the history
  • Loading branch information
sidey79 committed Aug 7, 2021
2 parents 7826687 + 4487c02 commit e351e19
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/actions/arduino-cli/action.yml
Expand Up @@ -2,7 +2,7 @@ name: 'setup arduino-cli and plattform'
description: 'install plattform into arduino-cli to be ready to compile'
inputs:
boardurl:
description: 'URL of arduino compaible package.json'
description: 'URL of arduino compatible package.json'
required: false
default: ''
plattform:
Expand Down
11 changes: 6 additions & 5 deletions src/cc1101.cpp
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
4 changes: 2 additions & 2 deletions src/cc1101.h
Expand Up @@ -139,8 +139,8 @@ namespace cc1101 {
#endif
#endif

#define wait_Miso() while(isHigh(misoPin) ) { static uint8_t miso_count=255;delay(1); if(miso_count==0) return; miso_count--; } // wait until SPI MISO line goes low
#define wait_Miso_rf() while(isHigh(misoPin) ) { static uint8_t miso_count=255;delay(1); if(miso_count==0) return false; miso_count--; } // wait until SPI MISO line goes low
#define wait_Miso() { uint8_t miso_count = 255; while(isHigh(misoPin)) { delay(1); if(miso_count == 0) return ; miso_count--; } } // wait until SPI MISO line goes low
#define wait_Miso_rf() { uint8_t miso_count = 255; while(isHigh(misoPin)) { delay(1); if(miso_count == 0) return false; miso_count--; } } // wait until SPI MISO line goes low

#ifdef ARDUINO_MAPLEMINI_F103CB
#define cc1101_Select() digitalLow(cc1101::radioCsPin[radionr]) // select (SPI) CC1101 | variant from array, Circuit board for 4 cc110x
Expand Down
2 changes: 1 addition & 1 deletion src/compile_config.h
Expand Up @@ -118,4 +118,4 @@
#endif


#endif /* END _COMPILE_CONFIG_h */
#endif /* END _COMPILE_CONFIG_h */
28 changes: 27 additions & 1 deletion src/signalduino.h
Expand Up @@ -96,7 +96,33 @@ void setup() {
; // wait for serial port to connect. Needed for native USB
}


// 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);
Expand Down

0 comments on commit e351e19

Please sign in to comment.