Compiler warns about incompatible type in sprintf, for Tcall and LoRa speed
@@ -551,7 +588,7 @@ String prepareCallsign(const String& callsign){
uint8_t ac_c = (axp.getVbusCurrent()) / 10;
// Pad telemetry message address to 9 characters
char Tcall_message_char[9];
- sprintf_P(Tcall_message_char, "%-9s", Tcall);
+ sprintf_P(Tcall_message_char, "%-9s", Tcall.c_str());
String Tcall_message = String(Tcall_message_char);
// Flash the light when telemetry is being sent
#ifdef ENABLE_LED_SIGNALING
@@ -958,7 +995,7 @@ void setup(){
rf95.setModemConfig(BG_RF95::Bw125Cr45Sf4096);
}
- Serial.printf("LoRa Speed:\t%d\n", lora_speed);
+ Serial.printf("LoRa Speed:\t%lu\n", lora_speed);
rf95.setFrequency(lora_freq);
Serial.printf("LoRa FREQ:\t%f\n", lora_freq);
Discussion:
I had problems with sb_min_speed. Web-Interface said it was 3. My debug printf said it was 0. I re-entered -> no effect.
I tried to change float sb_min_speed = 3; -> it worked.
I tried to change to 0.0, it kept fixed. I returned to 0 -> still worked. Hmmm.
Anyway, perhaps it's a good idea to cast float to int and int to float while setting / reading preferences. This does not fixed above described problem, but I think it makes things cleaner.
Compiler warns about incompatible type in sprintf, for Tcall and LoRa speed
Discussion: I had problems with sb_min_speed. Web-Interface said it was 3. My debug printf said it was 0. I re-entered -> no effect. I tried to change float sb_min_speed = 3; -> it worked. I tried to change to 0.0, it kept fixed. I returned to 0 -> still worked. Hmmm.
Anyway, perhaps it's a good idea to cast float to int and int to float while setting / reading preferences. This does not fixed above described problem, but I think it makes things cleaner.