Skip to content

Commit

Permalink
V 5.0.3 (bug fix release)
Browse files Browse the repository at this point in the history
  • Loading branch information
oe1wkl committed Sep 12, 2023
1 parent 74338ee commit b366ceb
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 18 deletions.
11 changes: 11 additions & 0 deletions Software/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ It is now quite straightforward to set up an environment to build the Morserino-

## Change History

### Changes V.5.0.2

#### Bug fixes:
* In V4.5 two more options were introduced for the feature „Word doubling“ (play each word 2x in Generator and File Player modes), to change a higher inter-character space value when the word is repeated: "ON (true WpM)" to ignore the higher inter-character space completely , and "ON (less ICS)" to add only half of the excess inter-character space. In V.5 this change was erroneously lost, and now it has been re-introduced.
* There was a problem with the serial protocol: even when there were 8 snapshots stored, the command „GET snapshots“ would only return 7. Fixed.
* The Parameters „Each Word 2x“ and „Stop/Next/Rep“ are mutually exclusive, so if you activate one, the other should be set to OFF. This did not happen, and strange effects occurred if you set both parameters to ON. Fixed.
* When stopping file player and then restarting it, it should continue with the next word after the interruption, but it always skipped another word. Fixed.
* Under certain circumstances a DEBUG message appeared on the serial output . Fixed.



### Changes V.5.0.1

#### Bug fixes:
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions Software/binary/m32_v5.0.2.ino.wifi_lora_32_V2.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aa1b5757c1d7f8d13cfb517daaac94cf
4 changes: 2 additions & 2 deletions Software/src/Version 5/MorseMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ boolean MorseMenu::menuExec() { // retu
MorsePreferences::setCurrentOptions(MorsePreferences::playerOptions, MorsePreferences::playerOptionsSize);
file = SPIFFS.open("/player.txt"); // open file
//skip p_fileWordPointer words, as they have been played before
wcount = MorsePreferences::fileWordPointer;
wcount = MorsePreferences::fileWordPointer-1;
MorsePreferences::fileWordPointer = 0;
skipWords(wcount);

Expand Down Expand Up @@ -350,7 +350,7 @@ boolean MorseMenu::menuExec() { // retu
MorsePreferences::setCurrentOptions(MorsePreferences::echoPlayerOptions, MorsePreferences::echoPlayerOptionsSize);
file = SPIFFS.open("/player.txt"); // open file
//skip p_fileWordPointer words, as they have been played before
wcount = MorsePreferences::fileWordPointer;
wcount = MorsePreferences::fileWordPointer-1;
MorsePreferences::fileWordPointer = 0;
skipWords(wcount);
startEcho:
Expand Down
32 changes: 23 additions & 9 deletions Software/src/Version 5/MorsePreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ parameter MorsePreferences::pliste[] = {
{"Display off", "Char by char", "Word by word"}
},
{
0, 0, 1, 1, // in CW trainer mode: repeat each word?
0, 0, 3, 1, // in CW trainer mode: repeat each word?
"Each Word 2x",
"Repeat each generated word",
true,
{"OFF", "ON"}
{"OFF", "ON", "ON (less ICS)", "ON (true WpM)"}
},
{
1, 1, 3, 1, // 1 = CODE_ONLY 2 = DISP_ONLY 3 = CODE_AND_DISP
Expand Down Expand Up @@ -604,21 +604,22 @@ void MorsePreferences::displayKeyerPreferencesMenu(prefPos pos) {
itemLine = (pos <= posSerialOut ? MorsePreferences::pliste[pos].parName : extraItems[pos-posKochFilter]);
itemLine += emptyLine.substring(0,maxLength - itemLine.length());
MorseOutput::printOnScroll(1, BOLD, 0, itemLine);
displayValueLine(pos);
displayValueLine(pos, itemLine, false);
}

/// posKochFilter, posLoraBand, posLoraQRG, posSnapRecall, posSnapStore, posVAdjust, posHwConf



void MorsePreferences::displayValueLine(prefPos pos) {
void MorsePreferences::displayValueLine(prefPos pos, String itemText, boolean jsonOnly) {
String valueLine; valueLine.reserve(20);
const String emptyLine = " ";
const int maxLength = 14;
String jsonValueLine; jsonValueLine.reserve(48);
String item; item.reserve(18);
int value;


value = pos <= posSerialOut ? (int) pliste[pos].value : getValue(pos);
valueLine = (pos <= posSerialOut ? (pliste[pos].isMapped ? pliste[pos].mapping[pliste[pos].value] : String(pliste[pos].value)) : getValueLine(pos));
if (pos == posMaxSequence && pliste[pos].value == 0) /// we do a "mapping" for 0 here
Expand All @@ -639,17 +640,19 @@ void MorsePreferences::displayValueLine(prefPos pos) {
item = "Store Snapshot";
break;
default:
item = itemLine;
item = itemText;
item.trim();
break;
}
if (pos < posKochFilter || pos == posSnapRecall || pos == posSnapStore)
if (pos < posKochFilter || pos == posSnapRecall || pos == posSnapStore) {
jsonConfigShort(item, value, jsonValueLine);
}
else if (pos == posKochFilter)
jsonMenu(MorseMenu::getMenuPath(MorsePreferences::menuPtr) + "/" + jsonValueLine, (unsigned int) MorsePreferences::menuPtr,
(m32state == menu_loop ? false : true), MorseMenu::isRemotelyExecutable(MorsePreferences::menuPtr));
}
MorseOutput::printOnScroll(2, REGULAR, 1, valueLine);
if (! jsonOnly)
MorseOutput::printOnScroll(2, REGULAR, 1, valueLine);
}

int MorsePreferences::getValue(prefPos pos) { /// a value to return for m32protocol
Expand Down Expand Up @@ -796,6 +799,17 @@ boolean MorsePreferences::adjustKeyerPreference(prefPos pos) { /// rotati
if (mini == 0) {
temp = val + maxi + vstep + t*vstep;
pliste[pos].value = temp % (maxi + vstep);

if (pliste[pos].value != 0) {
if (pos == posWordDoubler) {
pliste[posAutoStop].value = 0;
displayValueLine(posAutoStop, MorsePreferences::pliste[posAutoStop].parName, true);
}
else if (pos == posAutoStop) {
pliste[posWordDoubler].value = 0;
displayValueLine(posWordDoubler, MorsePreferences::pliste[posWordDoubler].parName, true);
}
}
} else {
temp = val + maxi - 2*mini + vstep + t*vstep;
pliste[pos].value = (temp % (maxi - mini +vstep)) + mini;
Expand Down Expand Up @@ -853,7 +867,7 @@ boolean MorsePreferences::adjustKeyerPreference(prefPos pos) { /// rotati
break;
}
}
displayValueLine(pos); /// now display the value
displayValueLine(pos, itemLine, false); /// now display the value
Heltec.display -> display(); // update the display
} // end if (checkEncoder)
checkShutDown(false); // check for time out
Expand Down Expand Up @@ -1466,7 +1480,7 @@ void Koch::createAbbr(uint8_t maxl, uint8_t koch) { // this fun

//DEBUG("ptr: " + String(maxl));
for (int i = Abbrev::ABBREV_POINTER[maxl]; i< Abbrev::ABBREV_NUMBER_OF_ELEMENTS; ++i) { // do this for all words with max length maxl
DEBUG(Abbrev::abbreviations[i]);
// DEBUG(Abbrev::abbreviations[i]);
if (wordIsKoch(Abbrev::abbreviations[i]) <= koch)
abbrIndices[numberOfAbbr++] = i;
}
Expand Down
2 changes: 1 addition & 1 deletion Software/src/Version 5/MorsePreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ namespace MorsePreferences
boolean storeSnapshot(uint8_t);
boolean setupPreferences(uint8_t);
void displayKeyerPreferencesMenu(prefPos);
void displayValueLine(prefPos);
void displayValueLine(prefPos, String, bool);
String getValueLine(prefPos);
int getValue(prefPos);
boolean adjustKeyerPreference(prefPos);
Expand Down
23 changes: 18 additions & 5 deletions Software/src/Version 5/m32_v5.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2792,8 +2792,8 @@ void m32Put(String type, String token, String value) { /// PU
}
}
else if (token == "clear" || token == "recall") {
int i = value.toInt() - 1; // i must == 0..7 (input was 1..8)
if (i >= 0 && i <= 7 && MorsePreferences::memCounter > 0) { /// and memCouner must > 0
int i = value.toInt() - 1; // i must be == 0..7 (input was 1..8)
if (i >= 0 && i <= 7 && MorsePreferences::memCounter > 0) { /// and memCounter must be > 0
for (uint8_t y = 0; y < MorsePreferences::memCounter; ++y) { // we look if snapshot number i does exist within existing snapshot
if (MorsePreferences::memories[y] == i) { // we found the correct snapshot
if (token == "clear") // so we either clear
Expand Down Expand Up @@ -3043,6 +3043,19 @@ boolean setParameter(String token, String value) { // change a parameter, r
if (v < MorsePreferences::pliste[i].minimum || v > MorsePreferences::pliste[i].maximum) // error: value out of range!
return true;
MorsePreferences::pliste[i].value = v;

if (v != 0) { // wordDoubler and Autostop are mutually exclusive!
if (i == posWordDoubler) {
MorsePreferences::pliste[posAutoStop].value = 0;
MorsePreferences::displayValueLine(posAutoStop, MorsePreferences::pliste[posAutoStop].parName, true);
}
else if (i == posAutoStop) {
MorsePreferences::pliste[posWordDoubler].value = 0;
MorsePreferences::displayValueLine(posWordDoubler, MorsePreferences::pliste[posWordDoubler].parName, true);
}
}


if (i == posKochSeq)
MorsePreferences::handleKochSequence();
else if (i == posCarouselStart)
Expand Down Expand Up @@ -3152,12 +3165,12 @@ void jsonControls() {


void jsonSnapshots() {
DynamicJsonDocument doc(144);
StaticJsonDocument <128> arr;
DynamicJsonDocument doc(164);
StaticJsonDocument <164> arr;
JsonObject conf = doc.createNestedObject("snapshots");
JsonArray array = arr.to<JsonArray>();

// DEBUG("memCounter: " + String(MorsePreferences::memCounter));
//DEBUG("memCounter: " + String(MorsePreferences::memCounter));
for (int i = 0; i < MorsePreferences::memCounter; ++i) {
array.add((int) MorsePreferences::memories[i] +1 );
}
Expand Down
2 changes: 1 addition & 1 deletion Software/src/Version 5/morsedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const String PROJECTNAME = "Morserino-32";

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

#define BETA false

Expand Down

0 comments on commit b366ceb

Please sign in to comment.