[Morse] Cppcheck fixes
This commit is contained in:
parent
1357d672c7
commit
208f4f8ad4
2 changed files with 6 additions and 4 deletions
|
@ -48,7 +48,8 @@ char MorseClient::decode(uint8_t symbol, uint8_t len) {
|
|||
|
||||
// iterate over the table
|
||||
for(uint8_t i = 0; i < sizeof(MorseTable); i++) {
|
||||
uint8_t code = RADIOLIB_NONVOLATILE_READ_BYTE(&MorseTable[i]);
|
||||
uint8_t* ptr = const_cast<uint8_t*>(&MorseTable[i]);
|
||||
uint8_t code = RADIOLIB_NONVOLATILE_READ_BYTE(ptr);
|
||||
if(code == symbol) {
|
||||
// match, return the index + ASCII offset
|
||||
return((char)(i + RADIOLIB_MORSE_ASCII_OFFSET));
|
||||
|
@ -129,7 +130,8 @@ size_t MorseClient::write(uint8_t b) {
|
|||
}
|
||||
|
||||
// get morse code from lookup table
|
||||
uint8_t code = RADIOLIB_NONVOLATILE_READ_BYTE(&MorseTable[(uint8_t)(toupper(b) - RADIOLIB_MORSE_ASCII_OFFSET)]);
|
||||
uint8_t* ptr = const_cast<uint8_t*>(&MorseTable[(uint8_t)(toupper(b) - RADIOLIB_MORSE_ASCII_OFFSET)]);
|
||||
uint8_t code = RADIOLIB_NONVOLATILE_READ_BYTE(ptr);
|
||||
|
||||
// check unsupported characters
|
||||
if(code == RADIOLIB_MORSE_UNSUPPORTED) {
|
||||
|
|
|
@ -172,8 +172,8 @@ class MorseClient: public RadioLibPrint {
|
|||
uint32_t pauseCounter = 0;
|
||||
RadioLibTime_t pauseStart = 0;
|
||||
|
||||
size_t printNumber(unsigned long, uint8_t);
|
||||
size_t printFloat(double, uint8_t);
|
||||
size_t printNumber(unsigned long, uint8_t) override;
|
||||
size_t printFloat(double, uint8_t) override;
|
||||
|
||||
int16_t transmitDirect(uint32_t freq = 0, uint32_t freqHz = 0);
|
||||
int16_t standby();
|
||||
|
|
Loading…
Add table
Reference in a new issue