From 51f690ef85fd0bb40a5a0ad5c54efd7d3befade9 Mon Sep 17 00:00:00 2001 From: phdlee Date: Thu, 3 May 2018 17:57:06 +0900 Subject: [PATCH] change frequency display in WSPR Menu --- ubitx_20/ubitx_wspr.ino | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/ubitx_20/ubitx_wspr.ino b/ubitx_20/ubitx_wspr.ino index eb85147..5765aca 100644 --- a/ubitx_20/ubitx_wspr.ino +++ b/ubitx_20/ubitx_wspr.ino @@ -113,22 +113,9 @@ void SendWSPRManage() EEPROM.get(bandBuffIndex, WsprTXFreq); EEPROM.get(bandBuffIndex + 4, WsprMultiChan); - /* - //3, 4, 5, 6, 7 - Wspr_Reg1[3] = EEPROM.read(bandBuffIndex + 6); - Wspr_Reg1[4] = EEPROM.read(bandBuffIndex + 7); - Wspr_Reg1[5] = EEPROM.read(bandBuffIndex + 8); - Wspr_Reg1[6] = EEPROM.read(bandBuffIndex + 9); - Wspr_Reg1[7] = EEPROM.read(bandBuffIndex + 10); - */ for (loopIndex = 3; loopIndex < 8; loopIndex++) Wspr_Reg1[loopIndex] = EEPROM.read(bandBuffIndex + loopIndex + 3); - /* - Wspr_Reg2[2] = EEPROM.read(bandBuffIndex + 11); - Wspr_Reg2[3] = EEPROM.read(bandBuffIndex + 12); - Wspr_Reg2[4] = EEPROM.read(bandBuffIndex + 13); - */ //2, 3, 4 for (loopIndex = 2; loopIndex < 5; loopIndex++) Wspr_Reg2[loopIndex] = EEPROM.read(bandBuffIndex + loopIndex + 9); @@ -136,18 +123,32 @@ void SendWSPRManage() TX_MSNB_P2 = ((unsigned long)Wspr_Reg1[5] & 0x0F) << 16 | ((unsigned long)Wspr_Reg1[6]) << 8 | Wspr_Reg1[7]; } - ltoa(WsprTXFreq, b, DEC); if (digitalRead(PTT) == 0) - strcpy(c, "SEND:"); + strcpy(c, "SEND: "); else - strcpy(c, "PTT->"); + strcpy(c, "PTT-> "); + + //ltoa(WsprTXFreq, b, DEC); + //strcat(c, b); + + //display frequency, Frequency to String for KD8CEC + unsigned long tmpFreq = WsprTXFreq; + for (int i = 15; i >= 6; i--) { + if (tmpFreq > 0) { + if (i == 12 || i == 8) c[i] = '.'; + else { + c[i] = tmpFreq % 10 + 0x30; + tmpFreq /= 10; + } + } + else + c[i] = ' '; + } - strcat(c, b); printLine1(c); if (digitalRead(PTT) == 0) { - //printLineF1(F("Transmitting")); //SEND WSPR //If you need to consider the Rit and Sprite modes, uncomment them below. //remark = To reduce the size of the program