From 182a9688cb934d5f720564dfbbc58d4c6dd41ad2 Mon Sep 17 00:00:00 2001
From: jgromes <jgromes@users.noreply.github.com>
Date: Sat, 1 Aug 2020 16:36:11 +0200
Subject: [PATCH] [Morse] Added Module overrides for all Arduino core functions

---
 src/protocols/Morse/Morse.cpp | 14 +++++++-------
 src/protocols/Morse/Morse.h   |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/protocols/Morse/Morse.cpp b/src/protocols/Morse/Morse.cpp
index 80a44d46..593d6278 100644
--- a/src/protocols/Morse/Morse.cpp
+++ b/src/protocols/Morse/Morse.cpp
@@ -64,12 +64,12 @@ size_t MorseClient::write(uint8_t b) {
   if(b == ' ') {
     RADIOLIB_DEBUG_PRINTLN(F("space"));
     standby();
-    delay(4 * _dotLength);
+    Module::delay(4 * _dotLength);
     return(1);
   }
 
   // get morse code from lookup table
-  uint8_t code = pgm_read_byte(&MorseTable[(uint8_t)(toupper(b) - 32)]);
+  uint8_t code = RADIOLIB_PROGMEM_READ_BYTE(&MorseTable[(uint8_t)(toupper(b) - 32)]);
 
   // check unsupported characters
   if(code == MORSE_UNSUPORTED) {
@@ -83,16 +83,16 @@ size_t MorseClient::write(uint8_t b) {
     if (code & MORSE_DASH) {
       RADIOLIB_DEBUG_PRINT('-');
       transmitDirect(_base, _baseHz);
-      delay(3 * _dotLength);
+      Module::delay(3 * _dotLength);
     } else {
       RADIOLIB_DEBUG_PRINT('.');
       transmitDirect(_base, _baseHz);
-      delay(_dotLength);
+      Module::delay(_dotLength);
     }
 
     // symbol space
     standby();
-    delay(_dotLength);
+    Module::delay(_dotLength);
 
     // move onto the next bit
     code >>= 1;
@@ -100,7 +100,7 @@ size_t MorseClient::write(uint8_t b) {
 
   // letter space
   standby();
-  delay(2 * _dotLength);
+  Module::delay(2 * _dotLength);
   RADIOLIB_DEBUG_PRINTLN();
 
   return(1);
@@ -110,7 +110,7 @@ size_t MorseClient::print(__FlashStringHelper* fstr) {
   PGM_P p = reinterpret_cast<PGM_P>(fstr);
   size_t n = 0;
   while(true) {
-    char c = pgm_read_byte(p++);
+    char c = RADIOLIB_PROGMEM_READ_BYTE(p++);
     if(c == '\0') {
       break;
     }
diff --git a/src/protocols/Morse/Morse.h b/src/protocols/Morse/Morse.h
index d94fad0d..caeec47e 100644
--- a/src/protocols/Morse/Morse.h
+++ b/src/protocols/Morse/Morse.h
@@ -14,7 +14,7 @@
 //                        - Morse code representation is saved LSb first, using additional bit as guard
 //                        - position in array corresponds ASCII code minus MORSE_ASCII_OFFSET
 //                        - ASCII characters marked MORSE_UNSUPORTED do not have ITU-R M.1677-1 equivalent
-static const uint8_t MorseTable[] PROGMEM = {
+static const uint8_t MorseTable[] RADIOLIB_PROGMEM = {
     0b00,                   // space
     0b110101,               // ! (unsupported)
     0b1010010,              // "