[Morse] Fix possible overflow
This commit is contained in:
parent
10c38164f2
commit
c538cac769
2 changed files with 2 additions and 1 deletions
|
@ -56,7 +56,7 @@ char MorseClient::decode(uint8_t symbol, uint8_t len) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// nothing found
|
// nothing found
|
||||||
return(RADIOLIB_MORSE_UNSUPPORTED);
|
return(RADIOLIB_MORSE_UNKNOWN_SYMBOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !RADIOLIB_EXCLUDE_AFSK
|
#if !RADIOLIB_EXCLUDE_AFSK
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#define RADIOLIB_MORSE_INTER_SYMBOL 0x00
|
#define RADIOLIB_MORSE_INTER_SYMBOL 0x00
|
||||||
#define RADIOLIB_MORSE_CHAR_COMPLETE 0x01
|
#define RADIOLIB_MORSE_CHAR_COMPLETE 0x01
|
||||||
#define RADIOLIB_MORSE_WORD_COMPLETE 0x02
|
#define RADIOLIB_MORSE_WORD_COMPLETE 0x02
|
||||||
|
#define RADIOLIB_MORSE_UNKNOWN_SYMBOL '*'
|
||||||
|
|
||||||
// Morse character table: - using codes defined in ITU-R M.1677-1
|
// Morse character table: - using codes defined in ITU-R M.1677-1
|
||||||
// - Morse code representation is saved LSb first, using additional bit as guard
|
// - Morse code representation is saved LSb first, using additional bit as guard
|
||||||
|
|
Loading…
Add table
Reference in a new issue