[AFSK] Update to 5.0.0
This commit is contained in:
parent
70d86f7eb6
commit
fbdb3eb6a2
5 changed files with 14 additions and 12 deletions
|
@ -51,7 +51,7 @@ void setup() {
|
||||||
// (RF69, CC1101,, Si4432 etc.), use the basic begin() method
|
// (RF69, CC1101,, Si4432 etc.), use the basic begin() method
|
||||||
// int state = radio.begin();
|
// int state = radio.begin();
|
||||||
|
|
||||||
if(state == ERR_NONE) {
|
if(state == RADIOLIB_ERR_NONE) {
|
||||||
Serial.println(F("success!"));
|
Serial.println(F("success!"));
|
||||||
} else {
|
} else {
|
||||||
Serial.print(F("failed, code "));
|
Serial.print(F("failed, code "));
|
||||||
|
@ -62,7 +62,7 @@ void setup() {
|
||||||
// initialize AFSK client
|
// initialize AFSK client
|
||||||
Serial.print(F("[AFSK] Initializing ... "));
|
Serial.print(F("[AFSK] Initializing ... "));
|
||||||
state = audio.begin();
|
state = audio.begin();
|
||||||
if(state == ERR_NONE) {
|
if(state == RADIOLIB_ERR_NONE) {
|
||||||
Serial.println(F("success!"));
|
Serial.println(F("success!"));
|
||||||
} else {
|
} else {
|
||||||
Serial.print(F("failed, code "));
|
Serial.print(F("failed, code "));
|
||||||
|
|
|
@ -49,7 +49,7 @@ void setup() {
|
||||||
// (RF69, CC1101, Si4432 etc.), use the basic begin() method
|
// (RF69, CC1101, Si4432 etc.), use the basic begin() method
|
||||||
// int state = radio.begin();
|
// int state = radio.begin();
|
||||||
|
|
||||||
if(state == ERR_NONE) {
|
if(state == RADIOLIB_ERR_NONE) {
|
||||||
Serial.println(F("success!"));
|
Serial.println(F("success!"));
|
||||||
} else {
|
} else {
|
||||||
Serial.print(F("failed, code "));
|
Serial.print(F("failed, code "));
|
||||||
|
@ -60,7 +60,7 @@ void setup() {
|
||||||
// initialize AFSK client
|
// initialize AFSK client
|
||||||
Serial.print(F("[AFSK] Initializing ... "));
|
Serial.print(F("[AFSK] Initializing ... "));
|
||||||
state = audio.begin();
|
state = audio.begin();
|
||||||
if(state == ERR_NONE) {
|
if(state == RADIOLIB_ERR_NONE) {
|
||||||
Serial.println(F("success!"));
|
Serial.println(F("success!"));
|
||||||
} else {
|
} else {
|
||||||
Serial.print(F("failed, code "));
|
Serial.print(F("failed, code "));
|
||||||
|
|
|
@ -46,7 +46,7 @@ void setup() {
|
||||||
// (RF69, CC1101, Si4432 etc.), use the basic begin() method
|
// (RF69, CC1101, Si4432 etc.), use the basic begin() method
|
||||||
// int state = radio.begin();
|
// int state = radio.begin();
|
||||||
|
|
||||||
if(state == ERR_NONE) {
|
if(state == RADIOLIB_ERR_NONE) {
|
||||||
Serial.println(F("success!"));
|
Serial.println(F("success!"));
|
||||||
} else {
|
} else {
|
||||||
Serial.print(F("failed, code "));
|
Serial.print(F("failed, code "));
|
||||||
|
@ -57,7 +57,7 @@ void setup() {
|
||||||
// initialize AFSK client
|
// initialize AFSK client
|
||||||
Serial.print(F("[AFSK] Initializing ... "));
|
Serial.print(F("[AFSK] Initializing ... "));
|
||||||
state = audio.begin();
|
state = audio.begin();
|
||||||
if(state == ERR_NONE) {
|
if(state == RADIOLIB_ERR_NONE) {
|
||||||
Serial.println(F("success!"));
|
Serial.println(F("success!"));
|
||||||
} else {
|
} else {
|
||||||
Serial.print(F("failed, code "));
|
Serial.print(F("failed, code "));
|
||||||
|
@ -68,7 +68,7 @@ void setup() {
|
||||||
// after that, set mode to OOK
|
// after that, set mode to OOK
|
||||||
Serial.print(F("[SX1278] Switching to OOK ... "));
|
Serial.print(F("[SX1278] Switching to OOK ... "));
|
||||||
state = radio.setOOK(true);
|
state = radio.setOOK(true);
|
||||||
if(state == ERR_NONE) {
|
if(state == RADIOLIB_ERR_NONE) {
|
||||||
Serial.println(F("success!"));
|
Serial.println(F("success!"));
|
||||||
} else {
|
} else {
|
||||||
Serial.print(F("failed, code "));
|
Serial.print(F("failed, code "));
|
||||||
|
|
|
@ -11,7 +11,7 @@ int16_t AFSKClient::begin() {
|
||||||
|
|
||||||
int16_t AFSKClient::tone(uint16_t freq, bool autoStart) {
|
int16_t AFSKClient::tone(uint16_t freq, bool autoStart) {
|
||||||
if(freq == 0) {
|
if(freq == 0) {
|
||||||
return(ERR_INVALID_FREQUENCY);
|
return(RADIOLIB_ERR_INVALID_FREQUENCY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(autoStart) {
|
if(autoStart) {
|
||||||
|
@ -19,12 +19,14 @@ int16_t AFSKClient::tone(uint16_t freq, bool autoStart) {
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
Module::tone(_pin, freq);
|
Module* mod = _phy->getMod();
|
||||||
return(ERR_NONE);
|
mod->tone(_pin, freq);
|
||||||
|
return(RADIOLIB_ERR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t AFSKClient::noTone() {
|
int16_t AFSKClient::noTone() {
|
||||||
Module::noTone(_pin);
|
Module* mod = _phy->getMod();
|
||||||
|
mod->noTone(_pin);
|
||||||
return(_phy->standby());
|
return(_phy->standby());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ class AFSKClient {
|
||||||
*/
|
*/
|
||||||
int16_t noTone();
|
int16_t noTone();
|
||||||
|
|
||||||
#ifndef RADIOLIB_GODMODE
|
#if !defined(RADIOLIB_GODMODE)
|
||||||
private:
|
private:
|
||||||
#endif
|
#endif
|
||||||
PhysicalLayer* _phy;
|
PhysicalLayer* _phy;
|
||||||
|
|
Loading…
Add table
Reference in a new issue