diff --git a/VersionInfo.txt b/VersionInfo.txt index 581a34ab..4ab4930f 100644 --- a/VersionInfo.txt +++ b/VersionInfo.txt @@ -10,7 +10,7 @@ I am getting a lot of hints from the group. Ian KD8CEC kd8cec@gmail.com ================================================================== -Files modified in Version1.074 Beta +Files modified in Version1.075 Beta 1.Delted Files. @@ -25,6 +25,6 @@ Files modified in Version1.074 Beta - ubitx_lcd_1602.ino - ubitx_lcd_1602Dual.ino - ubitx_lcd_2004.ino - -ubitx_wspr.ino + - ubitx_wspr.ino \ No newline at end of file diff --git a/ubitx_20/ubitx.h b/ubitx_20/ubitx.h index 09334e5d..f60095d3 100644 --- a/ubitx_20/ubitx.h +++ b/ubitx_20/ubitx.h @@ -37,6 +37,7 @@ //#define EXTEND_KEY_GROUP2 //Numeric (0~9), Point(.), Enter //Not supported in Version 1.0x //#define ENABLE_FACTORYALIGN +#define FACTORY_RECOVERY_BOOTUP //Whether to enter Factory Recovery mode by pressing FKey and turning on power #define ENABLE_ADCMONITOR //Starting with Version 1.07, you can read ADC values directly from uBITX Manager. So this function is not necessary. extern byte I2C_LCD_MASTER_ADDRESS; //0x27 //if Set I2C Address by uBITX Manager, read from EEProm diff --git a/ubitx_20/ubitx_20.ino b/ubitx_20/ubitx_20.ino index 764e52d8..216d34ce 100644 --- a/ubitx_20/ubitx_20.ino +++ b/ubitx_20/ubitx_20.ino @@ -6,8 +6,8 @@ // So I put + in the sense that it was improved one by one based on Original Firmware. // This firmware has been gradually changed based on the original firmware created by Farhan, Jack, Jerry and others. -#define FIRMWARE_VERSION_INFO F("+v1.074") -#define FIRMWARE_VERSION_NUM 0x02 //1st Complete Project : 1 (Version 1.061), 2st Project : 2 +#define FIRMWARE_VERSION_INFO F("+v1.075") +#define FIRMWARE_VERSION_NUM 0x03 //1st Complete Project : 1 (Version 1.061), 2st Project : 2 /** Cat Suppoort uBITX CEC Version @@ -254,8 +254,8 @@ void setNextHamBandFreq(unsigned long f, char moveDirection) if ((resultFreq / 1000) < hamBandRange[(unsigned char)findedIndex][0] || (resultFreq / 1000) > hamBandRange[(unsigned char)findedIndex][1]) resultFreq = (unsigned long)(hamBandRange[(unsigned char)findedIndex][0]) * 1000; - setFrequency(resultFreq); byteToMode(loadMode, 1); + setFrequency(resultFreq); } void saveBandFreqByIndex(unsigned long f, unsigned long mode, char bandIndex) { @@ -941,6 +941,15 @@ void initSettings(){ if (EEPROM.read(VERSION_ADDRESS) != FIRMWARE_VERSION_NUM) EEPROM.write(VERSION_ADDRESS, FIRMWARE_VERSION_NUM); + //Backup Calibration Setting from Factory Setup + //Check Factory Setting Backup Y/N + if (EEPROM.read(FACTORY_BACKUP_YN) != 0x13) { + EEPROM.write(FACTORY_BACKUP_YN, 0x13); //Set Backup Y/N + + for (unsigned int i = 0; i < 32; i++) //factory setting range + EEPROM.write(FACTORY_VALUES + i, EEPROM.read(i)); //0~31 => 65~96 + } + EEPROM.get(CW_CAL, cwmCarrier); //for Save VFO_A_MODE to eeprom @@ -1216,6 +1225,40 @@ void initPorts(){ digitalWrite(CW_KEY, 0); } +//Recovery Factory Setting Values +void factory_Recovery() +{ + if (EEPROM.read(FACTORY_BACKUP_YN) != 0x13) + return; + + if (digitalRead(PTT) == 0) //Do not proceed if PTT is pressed to prevent malfunction. + return; + + printLineF2(F("Factory Recovery")); + delay(2000); + if (!btnDown()) + return; + + printLineF2(F("IF you continue")); + printLineF1(F("release the key")); + delay(2000); + if (btnDown()) + return; + + printLineF1(F("Press Key PTT")); + delay(2000); + if (digitalRead(PTT) == 0) + { + for (unsigned int i = 0; i < 32; i++) //factory setting range + EEPROM.write(i, EEPROM.read(FACTORY_VALUES + i)); //65~96 => 0~31 + + //printLineF2(F("CompleteRecovery")); + printLineF1(F("Power Reset!")); + while(1); //Hold + } +} + + void setup() { /* @@ -1266,6 +1309,11 @@ void setup() initPorts(); +#ifdef FACTORY_RECOVERY_BOOTUP + if (btnDown()) + factory_Recovery(); +#endif + byteToMode(vfoA_mode, 0); initOscillators(); @@ -1278,6 +1326,7 @@ void setup() if (btnDown()) factory_alignment(); #endif + } //Auto save Frequency and Mode with Protected eeprom life by KD8CEC diff --git a/ubitx_20/ubitx_eemap.h b/ubitx_20/ubitx_eemap.h index 200ba440..e7991874 100644 --- a/ubitx_20/ubitx_eemap.h +++ b/ubitx_20/ubitx_eemap.h @@ -44,7 +44,9 @@ // (Enabled if the EEProm address is insufficient) // Address : 64 ~ 100 //============================================================================== -#define RESERVE_FOR_FACTORY2 64 +#define RESERVE_FOR_FACTORY2 64 //use Factory backup from Version 1.075 +#define FACTORY_BACKUP_YN 64 //Check Backup //Magic : 0x13 +#define FACTORY_VALUES 65 //65 ~ 65 + 32 //============================================================================== // KD8CEC EEPROM MAP diff --git a/ubitx_20/ubitx_menu.ino b/ubitx_20/ubitx_menu.ino index 2af96277..79f4ad72 100644 --- a/ubitx_20/ubitx_menu.ino +++ b/ubitx_20/ubitx_menu.ino @@ -1106,7 +1106,6 @@ void menuSetupKeyType(int btn){ } */ - printLineF2(F("CW Key Type set!")); cwKeyType = selectedKeyType; EEPROM.put(CW_KEY_TYPE, cwKeyType); @@ -1127,7 +1126,7 @@ void menuSetupKeyType(int btn){ } //===================================================== -//END OF STANDARD Tune Setup for reduce Program Memory +//END OF STANDARD Set by Knob for reduce Program Memory //=====================================================