[SX128x] Added delay to halting while loops

This commit is contained in:
jgromes 2024-06-29 18:28:58 +02:00
parent e406c550b8
commit 798ba3efbe
11 changed files with 23 additions and 23 deletions
examples/SX128x
SX128x_BLE_Modem
SX128x_Channel_Activity_Detection_Blocking
SX128x_Channel_Activity_Detection_Interrupt
SX128x_FLRC_Modem
SX128x_GFSK_Modem
SX128x_Ranging
SX128x_Receive_Blocking
SX128x_Receive_Interrupt
SX128x_Settings
SX128x_Transmit_Blocking
SX128x_Transmit_Interrupt

View file

@ -43,7 +43,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// if needed, you can switch between any of the modems
@ -62,7 +62,7 @@ void setup() {
if (state != RADIOLIB_ERR_NONE) {
Serial.print(F("Unable to set configuration, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
#warning "This sketch is just an API guide! Read the note at line 8."

View file

@ -43,7 +43,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
}

View file

@ -38,7 +38,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// set the function that will be called

View file

@ -41,7 +41,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// if needed, you can switch between any of the modems
@ -61,7 +61,7 @@ void setup() {
if (state != RADIOLIB_ERR_NONE) {
Serial.print(F("Unable to set configuration, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
#warning "This sketch is just an API guide! Read the note at line 6."

View file

@ -41,7 +41,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// if needed, you can switch between any of the modems
@ -61,7 +61,7 @@ void setup() {
if (state != RADIOLIB_ERR_NONE) {
Serial.print(F("Unable to set configuration, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
#warning "This sketch is just an API guide! Read the note at line 6."

View file

@ -43,7 +43,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
}

View file

@ -50,7 +50,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
}

View file

@ -46,7 +46,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// set the function that will be called
@ -61,7 +61,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// if needed, 'listen' mode can be disabled by calling

View file

@ -53,7 +53,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// initialize the second LoRa instance with
@ -74,7 +74,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// you can also change the settings at runtime
@ -83,43 +83,43 @@ void setup() {
// set carrier frequency to 2410.5 MHz
if (radio1.setFrequency(2410.5) == RADIOLIB_ERR_INVALID_FREQUENCY) {
Serial.println(F("Selected frequency is invalid for this module!"));
while (true);
while (true) { delay(10); }
}
// set bandwidth to 203.125 kHz
if (radio1.setBandwidth(203.125) == RADIOLIB_ERR_INVALID_BANDWIDTH) {
Serial.println(F("Selected bandwidth is invalid for this module!"));
while (true);
while (true) { delay(10); }
}
// set spreading factor to 10
if (radio1.setSpreadingFactor(10) == RADIOLIB_ERR_INVALID_SPREADING_FACTOR) {
Serial.println(F("Selected spreading factor is invalid for this module!"));
while (true);
while (true) { delay(10); }
}
// set coding rate to 6
if (radio1.setCodingRate(6) == RADIOLIB_ERR_INVALID_CODING_RATE) {
Serial.println(F("Selected coding rate is invalid for this module!"));
while (true);
while (true) { delay(10); }
}
// set output power to -2 dBm
if (radio1.setOutputPower(-2) == RADIOLIB_ERR_INVALID_OUTPUT_POWER) {
Serial.println(F("Selected output power is invalid for this module!"));
while (true);
while (true) { delay(10); }
}
// set LoRa preamble length to 16 symbols (accepted range is 2 - 65535)
if (radio1.setPreambleLength(16) == RADIOLIB_ERR_INVALID_PREAMBLE_LENGTH) {
Serial.println(F("Selected preamble length is invalid for this module!"));
while (true);
while (true) { delay(10); }
}
// disable CRC
if (radio1.setCRC(false) == RADIOLIB_ERR_INVALID_CRC_CONFIGURATION) {
Serial.println(F("Selected CRC is invalid for this module!"));
while (true);
while (true) { delay(10); }
}
Serial.println(F("All settings succesfully changed!"));

View file

@ -52,7 +52,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// some modules have an external RF switch

View file

@ -45,7 +45,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// set the function that will be called