Skip to content

Commit

Permalink
Merge pull request #34 from phdlee/version1.075
Browse files Browse the repository at this point in the history
Version1.075
  • Loading branch information
phdlee authored May 9, 2018
2 parents 4d97ac2 + 65d21ab commit 2de1c87
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 8 deletions.
4 changes: 2 additions & 2 deletions VersionInfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ I am getting a lot of hints from the group.
Ian KD8CEC
[email protected]
==================================================================
Files modified in Version1.074 Beta
Files modified in Version1.075 Beta

1.Delted Files.

Expand All @@ -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


1 change: 1 addition & 0 deletions ubitx_20/ubitx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
55 changes: 52 additions & 3 deletions ubitx_20/ubitx_20.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
{
/*
Expand Down Expand Up @@ -1266,6 +1309,11 @@ void setup()

initPorts();

#ifdef FACTORY_RECOVERY_BOOTUP
if (btnDown())
factory_Recovery();
#endif

byteToMode(vfoA_mode, 0);
initOscillators();

Expand All @@ -1278,6 +1326,7 @@ void setup()
if (btnDown())
factory_alignment();
#endif

}

//Auto save Frequency and Mode with Protected eeprom life by KD8CEC
Expand Down
4 changes: 3 additions & 1 deletion ubitx_20/ubitx_eemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions ubitx_20/ubitx_menu.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,6 @@ void menuSetupKeyType(int btn){
}
*/


printLineF2(F("CW Key Type set!"));
cwKeyType = selectedKeyType;
EEPROM.put(CW_KEY_TYPE, cwKeyType);
Expand All @@ -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
//=====================================================


Expand Down

0 comments on commit 2de1c87

Please sign in to comment.