Skip to content

Commit 2de1c87

Browse files
authored
Merge pull request #34 from phdlee/version1.075
Version1.075
2 parents 4d97ac2 + 65d21ab commit 2de1c87

File tree

5 files changed

+59
-8
lines changed

5 files changed

+59
-8
lines changed

VersionInfo.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ I am getting a lot of hints from the group.
1010
Ian KD8CEC
1111
1212
==================================================================
13-
Files modified in Version1.074 Beta
13+
Files modified in Version1.075 Beta
1414

1515
1.Delted Files.
1616

@@ -25,6 +25,6 @@ Files modified in Version1.074 Beta
2525
- ubitx_lcd_1602.ino
2626
- ubitx_lcd_1602Dual.ino
2727
- ubitx_lcd_2004.ino
28-
-ubitx_wspr.ino
28+
- ubitx_wspr.ino
2929

3030

ubitx_20/ubitx.h

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
//#define EXTEND_KEY_GROUP2 //Numeric (0~9), Point(.), Enter //Not supported in Version 1.0x
3838

3939
//#define ENABLE_FACTORYALIGN
40+
#define FACTORY_RECOVERY_BOOTUP //Whether to enter Factory Recovery mode by pressing FKey and turning on power
4041
#define ENABLE_ADCMONITOR //Starting with Version 1.07, you can read ADC values directly from uBITX Manager. So this function is not necessary.
4142

4243
extern byte I2C_LCD_MASTER_ADDRESS; //0x27 //if Set I2C Address by uBITX Manager, read from EEProm

ubitx_20/ubitx_20.ino

+52-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// So I put + in the sense that it was improved one by one based on Original Firmware.
77
// This firmware has been gradually changed based on the original firmware created by Farhan, Jack, Jerry and others.
88

9-
#define FIRMWARE_VERSION_INFO F("+v1.074")
10-
#define FIRMWARE_VERSION_NUM 0x02 //1st Complete Project : 1 (Version 1.061), 2st Project : 2
9+
#define FIRMWARE_VERSION_INFO F("+v1.075")
10+
#define FIRMWARE_VERSION_NUM 0x03 //1st Complete Project : 1 (Version 1.061), 2st Project : 2
1111

1212
/**
1313
Cat Suppoort uBITX CEC Version
@@ -254,8 +254,8 @@ void setNextHamBandFreq(unsigned long f, char moveDirection)
254254
if ((resultFreq / 1000) < hamBandRange[(unsigned char)findedIndex][0] || (resultFreq / 1000) > hamBandRange[(unsigned char)findedIndex][1])
255255
resultFreq = (unsigned long)(hamBandRange[(unsigned char)findedIndex][0]) * 1000;
256256

257-
setFrequency(resultFreq);
258257
byteToMode(loadMode, 1);
258+
setFrequency(resultFreq);
259259
}
260260

261261
void saveBandFreqByIndex(unsigned long f, unsigned long mode, char bandIndex) {
@@ -941,6 +941,15 @@ void initSettings(){
941941
if (EEPROM.read(VERSION_ADDRESS) != FIRMWARE_VERSION_NUM)
942942
EEPROM.write(VERSION_ADDRESS, FIRMWARE_VERSION_NUM);
943943

944+
//Backup Calibration Setting from Factory Setup
945+
//Check Factory Setting Backup Y/N
946+
if (EEPROM.read(FACTORY_BACKUP_YN) != 0x13) {
947+
EEPROM.write(FACTORY_BACKUP_YN, 0x13); //Set Backup Y/N
948+
949+
for (unsigned int i = 0; i < 32; i++) //factory setting range
950+
EEPROM.write(FACTORY_VALUES + i, EEPROM.read(i)); //0~31 => 65~96
951+
}
952+
944953
EEPROM.get(CW_CAL, cwmCarrier);
945954

946955
//for Save VFO_A_MODE to eeprom
@@ -1216,6 +1225,40 @@ void initPorts(){
12161225
digitalWrite(CW_KEY, 0);
12171226
}
12181227

1228+
//Recovery Factory Setting Values
1229+
void factory_Recovery()
1230+
{
1231+
if (EEPROM.read(FACTORY_BACKUP_YN) != 0x13)
1232+
return;
1233+
1234+
if (digitalRead(PTT) == 0) //Do not proceed if PTT is pressed to prevent malfunction.
1235+
return;
1236+
1237+
printLineF2(F("Factory Recovery"));
1238+
delay(2000);
1239+
if (!btnDown())
1240+
return;
1241+
1242+
printLineF2(F("IF you continue"));
1243+
printLineF1(F("release the key"));
1244+
delay(2000);
1245+
if (btnDown())
1246+
return;
1247+
1248+
printLineF1(F("Press Key PTT"));
1249+
delay(2000);
1250+
if (digitalRead(PTT) == 0)
1251+
{
1252+
for (unsigned int i = 0; i < 32; i++) //factory setting range
1253+
EEPROM.write(i, EEPROM.read(FACTORY_VALUES + i)); //65~96 => 0~31
1254+
1255+
//printLineF2(F("CompleteRecovery"));
1256+
printLineF1(F("Power Reset!"));
1257+
while(1); //Hold
1258+
}
1259+
}
1260+
1261+
12191262
void setup()
12201263
{
12211264
/*
@@ -1266,6 +1309,11 @@ void setup()
12661309

12671310
initPorts();
12681311

1312+
#ifdef FACTORY_RECOVERY_BOOTUP
1313+
if (btnDown())
1314+
factory_Recovery();
1315+
#endif
1316+
12691317
byteToMode(vfoA_mode, 0);
12701318
initOscillators();
12711319

@@ -1278,6 +1326,7 @@ void setup()
12781326
if (btnDown())
12791327
factory_alignment();
12801328
#endif
1329+
12811330
}
12821331

12831332
//Auto save Frequency and Mode with Protected eeprom life by KD8CEC

ubitx_20/ubitx_eemap.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
// (Enabled if the EEProm address is insufficient)
4545
// Address : 64 ~ 100
4646
//==============================================================================
47-
#define RESERVE_FOR_FACTORY2 64
47+
#define RESERVE_FOR_FACTORY2 64 //use Factory backup from Version 1.075
48+
#define FACTORY_BACKUP_YN 64 //Check Backup //Magic : 0x13
49+
#define FACTORY_VALUES 65 //65 ~ 65 + 32
4850

4951
//==============================================================================
5052
// KD8CEC EEPROM MAP

ubitx_20/ubitx_menu.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,6 @@ void menuSetupKeyType(int btn){
11061106
}
11071107
*/
11081108

1109-
11101109
printLineF2(F("CW Key Type set!"));
11111110
cwKeyType = selectedKeyType;
11121111
EEPROM.put(CW_KEY_TYPE, cwKeyType);
@@ -1127,7 +1126,7 @@ void menuSetupKeyType(int btn){
11271126
}
11281127

11291128
//=====================================================
1130-
//END OF STANDARD Tune Setup for reduce Program Memory
1129+
//END OF STANDARD Set by Knob for reduce Program Memory
11311130
//=====================================================
11321131

11331132

0 commit comments

Comments
 (0)