[AFSK] Update to 5.0.0

This commit is contained in:
jgromes 2021-11-14 11:37:49 +01:00
parent 70d86f7eb6
commit fbdb3eb6a2
5 changed files with 14 additions and 12 deletions

View file

@ -51,7 +51,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 "));
@ -62,7 +62,7 @@ void setup() {
// initialize AFSK client
Serial.print(F("[AFSK] Initializing ... "));
state = audio.begin();
if(state == ERR_NONE) {
if(state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));

View file

@ -49,7 +49,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 "));
@ -60,7 +60,7 @@ void setup() {
// initialize AFSK client
Serial.print(F("[AFSK] Initializing ... "));
state = audio.begin();
if(state == ERR_NONE) {
if(state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));

View file

@ -46,7 +46,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 "));
@ -57,7 +57,7 @@ void setup() {
// initialize AFSK client
Serial.print(F("[AFSK] Initializing ... "));
state = audio.begin();
if(state == ERR_NONE) {
if(state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));
@ -68,7 +68,7 @@ void setup() {
// after that, set mode to OOK
Serial.print(F("[SX1278] Switching to OOK ... "));
state = radio.setOOK(true);
if(state == ERR_NONE) {
if(state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));

View file

@ -11,7 +11,7 @@ int16_t AFSKClient::begin() {
int16_t AFSKClient::tone(uint16_t freq, bool autoStart) {
if(freq == 0) {
return(ERR_INVALID_FREQUENCY);
return(RADIOLIB_ERR_INVALID_FREQUENCY);
}
if(autoStart) {
@ -19,12 +19,14 @@ int16_t AFSKClient::tone(uint16_t freq, bool autoStart) {
RADIOLIB_ASSERT(state);
}
Module::tone(_pin, freq);
return(ERR_NONE);
Module* mod = _phy->getMod();
mod->tone(_pin, freq);
return(RADIOLIB_ERR_NONE);
}
int16_t AFSKClient::noTone() {
Module::noTone(_pin);
Module* mod = _phy->getMod();
mod->noTone(_pin);
return(_phy->standby());
}

View file

@ -50,7 +50,7 @@ class AFSKClient {
*/
int16_t noTone();
#ifndef RADIOLIB_GODMODE
#if !defined(RADIOLIB_GODMODE)
private:
#endif
PhysicalLayer* _phy;