From 55fa39ed211637df46c2442a8418457e9a1f0059 Mon Sep 17 00:00:00 2001 From: PU2REO - Edson Date: Sun, 19 May 2024 16:59:10 -0300 Subject: [PATCH] =?UTF-8?q?1.1=20=E2=80=93=20New=20pictures=20into=20the?= =?UTF-8?q?=20manual,=20minor=20correction=20to=20the=20schematics;=20Impr?= =?UTF-8?q?ovement=20on=20EEPROM=20saving=20routine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PU2REO_DVFO.ino | 21 +++++++++++++++++---- README.md | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/PU2REO_DVFO.ino b/PU2REO_DVFO.ino index 799a1b2..fc0436e 100644 --- a/PU2REO_DVFO.ino +++ b/PU2REO_DVFO.ino @@ -10,7 +10,9 @@ // - Adjustables IF Frequency, LSB & USB offset, Voice Lock Range, RogerBeep // - Channels and VFO Modes // - S-Meter on display, via Analogic Input -// +// v1.1 +// - addeded tmpNeedSaving var to manage EEPROM savings +// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Adrduino Nano Pinout ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -49,6 +51,10 @@ // 2 - Define: #define SSD1306_NO_SPLASH at the beggining of the file. // Repeat these steps after every update for "Adafruit_SSD1306" library ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// To use a cheap USBasp programmer plenty availabe on e-commerce: +// 1 - Use Zadig (https://zadig.akeo.ie/) to install driver "libusbK (v3.1.0.0)". Other LibUSB drivers won't work. +// 2 - On ArduinoIDE select: Tools > Programmer > USBasp +///////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// // How to calculate proper interrupt timings @@ -74,7 +80,7 @@ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Definitions ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#define DVFO_VERSION "DVFO v1.0" // Current DDS Version +#define DVFO_VERSION "DVFO v1.1" // Current DDS Version #define IF_MODE // enables IF mode (Adds ACT.EE_Values[EE_INDEX_INTFREQ] to the output - to use with a real radio) #define DIGITAL_ROGER_BEEP // Enable Digital Roger Beep (tone function in arduino) // #define PROTEUS // enable initial setup of EEPROM values for Proteus @@ -718,6 +724,9 @@ void loop() // check if it's time to save if (TimerDown[TIMERDOWN_CHANNEL_SAVE].Counter == 0) { + // temp - just to avoid unecessary savings to EEPROM. + bool tmpNeedSaving = false; // variable does not retain its value between function calls + // Check menu type switch(MenuType) { @@ -729,6 +738,8 @@ void loop() // store index to the vector and save ACT.OldChannelIndex = VFO.ChannelIndex; ACT.EE_Values[EE_INDEX_SAVED_CHANNEL_IDX] = VFO.ChannelIndex; + // needs saving + tmpNeedSaving = true; } break; @@ -740,12 +751,14 @@ void loop() // store index to the vector and save ACT.OldDispFreq = VFO.DispFreq; ACT.EE_Values[EE_INDEX_SAVED_FREQUENCY] = VFO.DispFreq; + // needs saving + tmpNeedSaving = true; } break; } // save values - SaveValuesToEEPROM(); + if (tmpNeedSaving) SaveValuesToEEPROM(); // digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); // reset timer anyway @@ -1275,7 +1288,7 @@ void ShowLogo(void) display.println(F(DVFO_VERSION)); display.setTextSize(1); display.setCursor(8, 54); - display.println(F("Built Jan 1st, 2024")); + display.println(F("Built May 19th, 2024")); display.display(); delay(1000); display.clearDisplay(); diff --git a/README.md b/README.md index c799423..37979e0 100644 --- a/README.md +++ b/README.md @@ -61,4 +61,4 @@ These are the implemented features so far, taylored for my old [Cobra 148GTL](ht # History - 1.0 – Initial version - - 1.0.1 – New pictures into the manual, minor correction to the schematics. + - 1.1 – New pictures into the manual, minor correction to the schematics; Improvement on EEPROM saving routine \ No newline at end of file