Code cleanup a bit

pull/10/head
Łukasz Nidecki 2021-02-13 18:15:02 +01:00
parent 6bb59dafc7
commit f759805b04
1 changed files with 56 additions and 58 deletions

View File

@ -228,18 +228,18 @@ void recalcGPS(){
#ifdef SHOW_BATT // battery is not frame part move after comment
outString += " Batt=";
outString += String(BattVolts,2);
outString += String(BattVolts, 2);
outString += ("V");
#endif
#ifdef KISS_PROTOCOL
Serial.print(encode_kiss(outString));
#ifdef ENABLE_BLUETOOTH
if (SerialBT.connected()){
if (SerialBT.connected()) {
SerialBT.print(encode_kiss(outString));
}
#endif
#else
#else
Serial.println(outString);
#endif
}
@ -330,7 +330,6 @@ void setup(){
#ifdef T_BEAM_V1_0
if (!axp.begin(Wire, AXP192_SLAVE_ADDRESS)) {
}
axp.setPowerOutPut(AXP192_LDO2, AXP202_ON);
axp.setPowerOutPut(AXP192_LDO3, AXP202_ON); // switch on GPS
axp.setPowerOutPut(AXP192_DCDC2, AXP202_ON);
@ -340,6 +339,7 @@ void setup(){
axp.adc1Enable(0xfe, true);
axp.adc2Enable(0x80, true);
#endif
if(!display.begin(SSD1306_SWITCHCAPVCC, SSD1306_ADDRESS)) {
for(;;); // Don't proceed, loop forever
}
@ -370,13 +370,13 @@ void setup(){
rf95.setModemConfig(BG_RF95::Bw125Cr45Sf4096); // hard coded because of double definition
rf95.setTxPower(20); // was 5
delay(250);
#ifdef ENABLE_BLUETOOTH
#ifdef ENABLE_BLUETOOTH
#ifdef BLUETOOTH_PIN
SerialBT.setPin(BLUETOOTH_PIN);
#endif
SerialBT.begin(String("TTGO LORA APRS ") + CALLSIGN);
writedisplaytext("LoRa-APRS","","Init:","BT OK!","","",250);
#endif
#endif
writedisplaytext("LoRa-APRS","","Init:","FINISHED OK!"," =:-) ","",250);
writedisplaytext("","","","","","",0);
}
@ -539,9 +539,8 @@ void loop() {
#ifdef ENABLE_BLUETOOTH
SerialBT.print(encapsulateKISS(debug_message, CMD_HARDWARE));
#endif
}
#endif
#endif
#endif
vTaskDelay(1);
}
@ -552,7 +551,6 @@ void handleKISSData(char character) {
writedisplaytext("(KISSTX))","","","","","",1);
#ifdef KISS_PROTOCOL
const String &TNC2DataFrame = decode_kiss(inTNCData);
Serial.print(inTNCData);
#ifdef ENABLE_BLUETOOTH
if (SerialBT.connected()) {