Small fix on BME280 Config & CC1101-TXPower Throttle (#1382)

* https://github.com/1technophile/OpenMQTTGateway/issues/1380
CC1101 TXPower selection

* Creates the possability the define SDA/SCL Pins correct through a compiler switch from the platformio.ini
Sample:
  '-DBME280_PIN_SDA=0'
  '-DBME280_PIN_SCL=2'
This commit is contained in:
Dattel authored and GitHub committed 2023-01-10 20:13:06 +01:00
1 parent c1cedcf333
commit 5fcf02af5a
4 files changed
+31 -8

No files matched your search

+5
View File
@@ -184,6 +184,7 @@ void MQTTtoRF(char* topicOri, char* datacallback) {
# ifdef ZradioCC1101 // set Receive off and Transmitt on
disableActiveReceiver();
ELECHOUSE_cc1101.SetTx(receiveMhz);
Log.notice(F("Transmit mhz: %F" CR), receiveMhz);
# endif
mySwitch.disableReceive();
mySwitch.enableTransmit(RF_EMITTER_GPIO);
@@ -256,6 +257,10 @@ void MQTTtoRF(char* topicOri, JsonObject& RFdata) { // json object decoding
Log.notice(F("RF Pulse Lgth: %d" CR), valuePLSL);
Log.notice(F("Bits nb: %d" CR), valueBITS);
# ifdef ZradioCC1101 // set Receive off and Transmitt on
int txPower = RFdata["txpower"] | RF_CC1101_TXPOWER;
ELECHOUSE_cc1101.setPA((int)txPower);
Log.notice(F("CC1101 TX Power: %d" CR), txPower);
float trMhz = RFdata["mhz"] | CC1101_FREQUENCY;
if (validFrequency((int)trMhz)) {
disableActiveReceiver();
+6 -2
View File
@@ -58,8 +58,12 @@ unsigned long timebme280 = 0;
int BME280_i2c_addr = 0x76; // Bosch BME280 I2C Address
// Only supported for ESP
int BME280_PIN_SDA = SDA; // PIN SDA
int BME280_PIN_SCL = SCL; // PIN SCL
#ifndef BME280_PIN_SDA
# define BME280_PIN_SDA SDA
#endif
#ifndef BME280_PIN_SCL
# define BME280_PIN_SCL SCL
#endif
// Oversampling for BME280/BMP280 devices
+6
View File
@@ -175,6 +175,12 @@ const char parameters[39][3][16] = {
#if defined(ZradioCC1101) || defined(ZradioSX127x)
float receiveMhz = CC1101_FREQUENCY;
#endif
/*-------------------CC1101 DefaultTXPower----------------------*/
//Adjust the default TX-Power for sending radio if ZradioCC1101 is used.
//The following settings are possible depending on the frequency band. (-30 -20 -15 -10 -6 0 5 7 10 11 12) Default is max!
#ifndef RF_CC1101_TXPOWER
# define RF_CC1101_TXPOWER 12
#endif
/*-------------------PIN DEFINITIONS----------------------*/
#ifndef RF_RECEIVER_GPIO