[AFSK] Added check for zero tone frequency

This commit is contained in:
jgromes 2020-05-03 11:04:51 +02:00
parent ed0a6623a6
commit 79d8ff2ca0

View file

@ -6,6 +6,10 @@ AFSKClient::AFSKClient(PhysicalLayer* phy, RADIOLIB_PIN_TYPE pin) {
} }
int16_t AFSKClient::tone(uint16_t freq, bool autoStart) { int16_t AFSKClient::tone(uint16_t freq, bool autoStart) {
if(freq == 0) {
return(ERR_INVALID_FREQUENCY);
}
if(autoStart) { if(autoStart) {
int16_t state = _phy->transmitDirect(); int16_t state = _phy->transmitDirect();
RADIOLIB_ASSERT(state); RADIOLIB_ASSERT(state);