diff --git a/examples/FSK4/FSK4_Transmit/FSK4_Transmit.ino b/examples/FSK4/FSK4_Transmit/FSK4_Transmit.ino index 4f7319bc..9cd4d40c 100644 --- a/examples/FSK4/FSK4_Transmit/FSK4_Transmit.ino +++ b/examples/FSK4/FSK4_Transmit/FSK4_Transmit.ino @@ -68,7 +68,7 @@ void setup() { // (RF69, CC1101, Si4432 etc.), use the basic begin() method // int state = radio.begin(); - if(state == ERR_NONE) { + if(state == RADIOLIB_ERR_NONE) { Serial.println(F("success!")); } else { Serial.print(F("failed, code ")); @@ -92,7 +92,7 @@ void setup() { // frequency shift: 270 Hz // baud rate: 100 baud state = fsk4.begin(434.0, 270, 100); - if(state == ERR_NONE) { + if(state == RADIOLIB_ERR_NONE) { Serial.println(F("success!")); } else { Serial.print(F("failed, code ")); diff --git a/examples/FSK4/FSK4_Transmit_AFSK/FSK4_Transmit_AFSK.ino b/examples/FSK4/FSK4_Transmit_AFSK/FSK4_Transmit_AFSK.ino index d3e40074..f4b4ccea 100644 --- a/examples/FSK4/FSK4_Transmit_AFSK/FSK4_Transmit_AFSK.ino +++ b/examples/FSK4/FSK4_Transmit_AFSK/FSK4_Transmit_AFSK.ino @@ -69,7 +69,7 @@ void setup() { // (RF69, CC1101, Si4432 etc.), use the basic begin() method // int state = radio.begin(); - if(state == ERR_NONE) { + if(state == RADIOLIB_ERR_NONE) { Serial.println(F("success!")); } else { Serial.print(F("failed, code ")); @@ -85,7 +85,7 @@ void setup() { // frequency shift: 270 Hz // baud rate: 100 baud state = fsk4.begin(400, 270, 100); - if(state == ERR_NONE) { + if(state == RADIOLIB_ERR_NONE) { Serial.println(F("success!")); } else { Serial.print(F("failed, code ")); diff --git a/src/protocols/FSK4/FSK4.cpp b/src/protocols/FSK4/FSK4.cpp index d1d4eb84..5e34c014 100644 --- a/src/protocols/FSK4/FSK4.cpp +++ b/src/protocols/FSK4/FSK4.cpp @@ -28,7 +28,7 @@ int16_t FSK4Client::begin(float base, uint32_t shift, uint16_t rate) { // check minimum shift value if(shift < step / 2) { - return(ERR_INVALID_RTTY_SHIFT); + return(RADIOLIB_ERR_INVALID_RTTY_SHIFT); } // round shift to multiples of frequency step size @@ -78,7 +78,7 @@ size_t FSK4Client::write(uint8_t b) { // Modulate FSK4Client::tone(symbol); - + // Shift to next symbol b = b << 2; } @@ -87,10 +87,11 @@ size_t FSK4Client::write(uint8_t b) { } void FSK4Client::tone(uint8_t i) { - uint32_t start = Module::micros(); + Module* mod = _phy->getMod(); + uint32_t start = mod->micros(); transmitDirect(_base + _tones[i], _baseHz + _tonesHz[i]); - while(Module::micros() - start < _bitDuration) { - Module::yield(); + while(mod->micros() - start < _bitDuration) { + mod->yield(); } } diff --git a/src/protocols/FSK4/FSK4.h b/src/protocols/FSK4/FSK4.h index 4bd703b1..049453bc 100644 --- a/src/protocols/FSK4/FSK4.h +++ b/src/protocols/FSK4/FSK4.h @@ -56,7 +56,7 @@ class FSK4Client { size_t write(uint8_t b); -#ifndef RADIOLIB_GODMODE +#if !defined(RADIOLIB_GODMODE) private: #endif PhysicalLayer* _phy;