oe1wkl / Morserino-32

Morserino-32 multi-functional Morse code machine, based on ESP32

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Koch sequence not memorized !

philgerm opened this issue · comments

On version 3.02 the Koch sequence LCWO can't memorized on snapshoot, after recall a snapshot the Koch sequence go to M32/ JLMC. the code looks correct in Write and readPreferences !

looks like that in the writePreferences function something got mixed up ..

the lcwoKochSeq is only saved to the morserino savestate - but never to a snapshot

if (morserino) {
    if (MorsePreferences::kochFilter != pref.getUChar("kochFilter")) {
        pref.putUChar("kochFilter", MorsePreferences::kochFilter);
        if (!MorsePreferences::useCustomCharSet)                          // we update these only if we do not use a custom character set!
          koch.setup();
    }

    if (MorsePreferences::lcwoKochSeq != pref.getBool("lcwoKochSeq")) {
        pref.putBool("lcwoKochSeq", MorsePreferences::lcwoKochSeq);
        koch.setKochChars(MorsePreferences::lcwoKochSeq);
        if (!MorsePreferences::useCustomCharSet)
            koch.setup();
    }
}

it should be changed to this (like in v2.4) i think:

if (morserino) {
    if (MorsePreferences::kochFilter != pref.getUChar("kochFilter")) {
        pref.putUChar("kochFilter", MorsePreferences::kochFilter);
        if (!MorsePreferences::useCustomCharSet)                          // we update these only if we do not use a custom character set!
          koch.setup();
    }
}
if (MorsePreferences::lcwoKochSeq != pref.getBool("lcwoKochSeq")) {
    pref.putBool("lcwoKochSeq", MorsePreferences::lcwoKochSeq);
    **if (morserino) {
        koch.setKochChars(MorsePreferences::lcwoKochSeq);
        if (!MorsePreferences::useCustomCharSet)
            koch.setup();
    }**
}

tried it out yesterday evening and it seems to work ..

thanks

73 de OE9RIR