Skip to content

Commit

Permalink
4.5.2. Bug fix
Browse files Browse the repository at this point in the history
* Through a stupid mistake of mine, a nasty bug was introduced into 4.5.1: a few vital bits of information were not written into non-volatile storage, and therefore not preserved through a power-off or re-boot. The information affected by the bug is the selected Koch lesson, and WiFi information. This has been fixed in this maintenance release. It might mean that you need to update from 4.5.1. by USB, unless you had a WiFi setup with a previous version!
  • Loading branch information
oe1wkl committed Apr 4, 2023
1 parent 61bed3b commit 35d7a77
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
5 changes: 5 additions & 0 deletions Software/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ It is now quite straightforward to set up an environment to build the Morserino-

## Change History

### Changes V.4.5.2

#### Bug Fix(es):
* Through a stupid mistake of mine, a nasty bug was introduced into 4.5.1: a few vital bits of information were not written into non-volatile storage, and therefore not preserved through a power-off or re-boot. The information affected by the bug is the selected **Koch lesson**, and **WiFi information**. This has been fixed in this maintenance release. <b>It might mean that you need to update from 4.5.1. by USB</b>, unless you had a WiFi setup with a previous version!

### Changes V.4.5.1

#### Bug Fix(es):
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions Software/binary/m32_v4.5.2.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e0a3566f64c870b202550f282d463be1
19 changes: 6 additions & 13 deletions Software/src/Version 4/MorsePreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,6 @@ void internal::displayAutoStop() {

void internal::displaySerialOut() {
String option;
DEBUG(String(MorsePreferences::serialOut));
switch (MorsePreferences::serialOut) {
case 0: option = "Nothing ";
break;
Expand Down Expand Up @@ -1156,7 +1155,6 @@ void MorsePreferences::readPreferences(String repository) {
morserino = true;

repository.toCharArray(repName, l);
// DEBUG("Reading from repository: " + String(repName));
// read preferences from non-volatile storage
// if version cannot be read, we have a new ESP32 and need to write the preferences first

Expand All @@ -1173,12 +1171,10 @@ void MorsePreferences::readPreferences(String repository) {
if ((temp = pref.getUChar("version_minor")) != MorsePreferences::version_minor)
pref.putUChar("version_minor", MorsePreferences::version_minor);

if ((temp = pref.getUChar("kochFilter")))
if ((temp = pref.getUChar("kochFilter")))
MorsePreferences::kochFilter = temp;
else
pref.putUChar("kochFilter", MorsePreferences::kochFilter);


if (temp = pref.getUChar("vAdjust"))
MorsePreferences::vAdjust = temp;

Expand Down Expand Up @@ -1382,7 +1378,7 @@ void MorsePreferences::readPreferences(String repository) {
MorsePreferences::echoConf = pref.getBool("echoConf", true);
//MorsePreferences::wordDoubler = pref.getBool("wordDoubler");
MorsePreferences::speedAdapt = pref.getBool("speedAdapt");
MorsePreferences::extAudioOnDecode = pref.getBool("extAudioOnDecode");
MorsePreferences::extAudioOnDecode = pref.getBool("extAudioOnDecod");


MorsePreferences::cwacKochSeq = pref.getBool("cwacKochSeq");
Expand All @@ -1407,12 +1403,10 @@ void MorsePreferences::writePreferences(String repository) {
boolean morserino = false;

if (repository == "morserino")
morserino = true;
//DEBUG("Writing to repository: " + repository);
morserino = true;
repository.toCharArray(repName, l);

pref.begin(repName, false); // open namespace in read/write mode

if (MorsePreferences::sidetoneFreq != pref.getUChar("sidetoneFreq"))
pref.putUChar("sidetoneFreq", MorsePreferences::sidetoneFreq);
if (MorsePreferences::didah != pref.getBool("didah"))
Expand Down Expand Up @@ -1544,11 +1538,11 @@ void MorsePreferences::writePreferences(String repository) {

if (! morserino) {
pref.putUChar("lastExecuted", MorsePreferences::menuPtr); // store last executed command in snapshots

}
/// the following not stored into snapshots


if (morserino) {
if (morserino) {
pref.putUChar("brightness", MorsePreferences::oledBrightness); // if not snapshots, store current screen brightness

if (MorsePreferences::serialOut != pref.getUChar("serialOut"))
Expand All @@ -1559,6 +1553,7 @@ void MorsePreferences::writePreferences(String repository) {
if (!MorsePreferences::useCustomCharSet) // we update these only if we do not use a custom character set!
koch.setup();
}

if (MorsePreferences::wlanSSID != pref.getString("wlanSSID"))
pref.putString("wlanSSID", MorsePreferences::wlanSSID);
if (MorsePreferences::wlanPassword != pref.getString("wlanPassword"))
Expand Down Expand Up @@ -1587,8 +1582,6 @@ void MorsePreferences::writePreferences(String repository) {
if (MorsePreferences::wlanTRXPeer3 != pref.getString("wlanTRXPeer3"))
pref.putString("wlanTRXPeer3", MorsePreferences::wlanTRXPeer3);
} //// end if (morserino)
}


pref.end();
}
Expand Down
2 changes: 1 addition & 1 deletion Software/src/Version 4/morsedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const String PROJECTNAME = "Morserino-32";

#define VERSION_MAJOR 4
#define VERSION_MINOR 5
#define VERSION_PATCH 1
#define VERSION_PATCH 2

#define BETA false

Expand Down

0 comments on commit 35d7a77

Please sign in to comment.