Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/companion_radio/MyMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,9 @@ void MyMesh::handleCmdFrame(size_t len) {
savePrefs();

radio_set_params(_prefs.freq, _prefs.bw, _prefs.sf, _prefs.cr);
//You need to clear the old registers, otherwise the LoRa module won't receive any information the first time.
_radio->onSendFinished();
_radio->startRecv();
MESH_DEBUG_PRINTLN("OK: CMD_SET_RADIO_PARAMS: f=%d, bw=%d, sf=%d, cr=%d", freq, bw, (uint32_t)sf,
(uint32_t)cr);

Expand Down
6 changes: 6 additions & 0 deletions examples/simple_repeater/MyMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1253,12 +1253,18 @@ void MyMesh::loop() {
if (set_radio_at && millisHasNowPassed(set_radio_at)) { // apply pending (temporary) radio params
set_radio_at = 0; // clear timer
radio_set_params(pending_freq, pending_bw, pending_sf, pending_cr);
//You need to clear the old registers, otherwise the LoRa module won't receive any information the first time.
_radio->onSendFinished();
_radio->startRecv();
MESH_DEBUG_PRINTLN("Temp radio params");
}

if (revert_radio_at && millisHasNowPassed(revert_radio_at)) { // revert radio params to orig
revert_radio_at = 0; // clear timer
radio_set_params(_prefs.freq, _prefs.bw, _prefs.sf, _prefs.cr);
//You need to clear the old registers, otherwise the LoRa module won't receive any information the first time.
_radio->onSendFinished();
_radio->startRecv();
MESH_DEBUG_PRINTLN("Radio params restored");
}

Expand Down
6 changes: 6 additions & 0 deletions examples/simple_room_server/MyMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,12 +870,18 @@ void MyMesh::loop() {
if (set_radio_at && millisHasNowPassed(set_radio_at)) { // apply pending (temporary) radio params
set_radio_at = 0; // clear timer
radio_set_params(pending_freq, pending_bw, pending_sf, pending_cr);
//You need to clear the old registers, otherwise the LoRa module won't receive any information the first time.
_radio->onSendFinished();
_radio->startRecv();
MESH_DEBUG_PRINTLN("Temp radio params");
}

if (revert_radio_at && millisHasNowPassed(revert_radio_at)) { // revert radio params to orig
revert_radio_at = 0; // clear timer
radio_set_params(_prefs.freq, _prefs.bw, _prefs.sf, _prefs.cr);
//You need to clear the old registers, otherwise the LoRa module won't receive any information the first time.
_radio->onSendFinished();
_radio->startRecv();
MESH_DEBUG_PRINTLN("Radio params restored");
}

Expand Down
6 changes: 6 additions & 0 deletions examples/simple_sensor/SensorMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,12 +882,18 @@ void SensorMesh::loop() {
if (set_radio_at && millisHasNowPassed(set_radio_at)) { // apply pending (temporary) radio params
set_radio_at = 0; // clear timer
radio_set_params(pending_freq, pending_bw, pending_sf, pending_cr);
//You need to clear the old registers, otherwise the LoRa module won't receive any information the first time.
_radio->onSendFinished();
_radio->startRecv();
MESH_DEBUG_PRINTLN("Temp radio params");
}

if (revert_radio_at && millisHasNowPassed(revert_radio_at)) { // revert radio params to orig
revert_radio_at = 0; // clear timer
radio_set_params(_prefs.freq, _prefs.bw, _prefs.sf, _prefs.cr);
//You need to clear the old registers, otherwise the LoRa module won't receive any information the first time.
_radio->onSendFinished();
_radio->startRecv();
MESH_DEBUG_PRINTLN("Radio params restored");
}

Expand Down
2 changes: 2 additions & 0 deletions src/Dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class Radio {
*/
virtual void loop() { }

virtual void startRecv() { }

virtual int getNoiseFloor() const { return 0; }

virtual void triggerNoiseFloorCalibrate(int threshold) { }
Expand Down