Skip to content

Commit

Permalink
Update WeatherSensor.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs authored Dec 17, 2024
1 parent ad875c1 commit c57c219
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions examples/BresserWeatherSensorMQTTCustom/src/WeatherSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,10 @@ volatile bool receivedFlag = false;

// This function is called when a complete packet is received by the module
// IMPORTANT: This function MUST be 'void' type and MUST NOT have any arguments!
void
#if defined(ESP8266) || defined(ESP32)
IRAM_ATTR
#endif
setFlag(void)
void setFlag(void)
{
// We got a packet, set the flag
receivedFlag = true;
Expand Down Expand Up @@ -200,7 +199,7 @@ int16_t WeatherSensor::begin(uint8_t max_sensors_default, bool init_filters, dou
{
log_e("%s Error setting fixed packet length: [%d]", RECEIVER_CHIP, state);
while (true)
;
delay(10);
}
#if defined(USE_SX1262) || defined(USE_LR1121)
state = radio.setCRC(0);
Expand All @@ -211,7 +210,7 @@ int16_t WeatherSensor::begin(uint8_t max_sensors_default, bool init_filters, dou
{
log_e("%s Error disabling crc filtering: [%d]", RECEIVER_CHIP, state);
while (true)
;
delay(10);
}

// Preamble: AA AA AA AA AA
Expand All @@ -230,14 +229,14 @@ int16_t WeatherSensor::begin(uint8_t max_sensors_default, bool init_filters, dou
{
log_e("%s Error setting sync words: [%d]", RECEIVER_CHIP, state);
while (true)
;
delay(10);
}
}
else
{
log_e("%s Error initialising: [%d]", RECEIVER_CHIP, state);
while (true)
;
delay(10);
}
log_d("%s Setup complete - awaiting incoming messages...", RECEIVER_CHIP);
rssi = radio.getRSSI();
Expand All @@ -250,7 +249,7 @@ int16_t WeatherSensor::begin(uint8_t max_sensors_default, bool init_filters, dou
{
log_e("%s startReceive() failed, code %d", RECEIVER_CHIP, state);
while (true)
;
delay(10);
}

return state;
Expand Down

0 comments on commit c57c219

Please sign in to comment.