From 71cc86cff064682e7774635d236541d7140bc819 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 27 Apr 2019 20:54:20 +0200 Subject: [PATCH] Windows GitGui did not update the RX_FSK.ino Some of the latest changes to the .ino were not uploaded correctly. --- RX_FSK/RX_FSK.ino | 72 +++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index 37fcaec..c277ec5 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -688,6 +688,41 @@ void loopSpectrum() { scanner.plotResult(); } +void startSpectrumDisplay() { + int marker=0; + char buf[5]; + + sonde.clearDisplay(); + u8x8->setFont(u8x8_font_chroma48medium8_r); + u8x8->drawString(0, 0, "Spectrum Scan..."); + delay(500); + + enterMode(ST_SPECTRUM); + + for (int i = 0; i < sonde.config.spectrum; i++) { + scanner.scan(); + scanner.plotResult(); + + if (sonde.config.marker != 0) { + itoa((sonde.config.startfreq), buf, 10); + u8x8->drawString(0, 1, buf); + u8x8->drawString(7, 1, "MHz"); + itoa((sonde.config.startfreq + 6), buf, 10); + u8x8->drawString(13, 1, buf); + } + + if (sonde.config.timer != 0) { + itoa((sonde.config.spectrum - i), buf, 10); + if (sonde.config.marker != 0) { + marker = 1; + } + u8x8->drawString(0, 1+marker, buf); + u8x8->drawString(2, 1+marker, "Sec."); + } + } + delay(1000); +} + String translateEncryptionType(wifi_auth_mode_t encryptionType) { switch (encryptionType) { case (WIFI_AUTH_OPEN): @@ -736,8 +771,6 @@ void loopWifiScan() { int line=0; int cnt=0; - int marker=0; - char buf[5]; WiFi.disconnect(true); WiFi.mode(WIFI_STA); @@ -806,36 +839,7 @@ void loopWifiScan() { } if (sonde.config.spectrum != 0) { // enable Spectrum in config.txt: spectrum=number_of_seconds - sonde.clearDisplay(); - u8x8->setFont(u8x8_font_chroma48medium8_r); - u8x8->drawString(0, 0, "Spectrum Scan..."); - delay(500); - - enterMode(ST_SPECTRUM); - - for (int i = 0; i < sonde.config.spectrum; i++) { - scanner.scan(); - scanner.plotResult(); - - if (sonde.config.marker != 0) { - itoa((sonde.config.startfreq), buf, 10); - u8x8->drawString(0, 1, buf); - u8x8->drawString(7, 1, "MHz"); - itoa((sonde.config.startfreq + 6), buf, 10); - u8x8->drawString(13, 1, buf); - } - - if (sonde.config.timer != 0) { - itoa((sonde.config.spectrum - i), buf, 10); - if (sonde.config.marker != 0) { - marker = 1; - } - u8x8->drawString(0, 1+marker, buf); - u8x8->drawString(2, 1+marker, "Sec."); - } - } - - delay(1000); + startSpectrumDisplay(); } enterMode(ST_SCANNER); @@ -853,7 +857,9 @@ void loopWifiScan() { SetupAsyncServer(); delay(2000); - // enterMode(ST_DECODER); ### 2019-04-20 - changed DL2MF + if (sonde.config.spectrum != 0) { // enable Spectrum in config.txt: spectrum=number_of_seconds + startSpectrumDisplay(); + } enterMode(ST_SCANNER); }