[SX127x] Added methods to clear DIO actions
This commit is contained in:
parent
95e9de6759
commit
d00d07fe9c
2 changed files with 21 additions and 0 deletions
|
@ -432,10 +432,21 @@ void SX127x::setDio0Action(void (*func)(void)) {
|
|||
attachInterrupt(digitalPinToInterrupt(_mod->getIrq()), func, RISING);
|
||||
}
|
||||
|
||||
void SX127x::clearDio0Action() {
|
||||
detachInterrupt(digitalPinToInterrupt(_mod->getIrq()));
|
||||
}
|
||||
|
||||
void SX127x::setDio1Action(void (*func)(void)) {
|
||||
attachInterrupt(digitalPinToInterrupt(_mod->getGpio()), func, RISING);
|
||||
}
|
||||
|
||||
void SX127x::clearDio1Action() {
|
||||
if(_mod->getGpio() != RADIOLIB_PIN_UNUSED) {
|
||||
return;
|
||||
}
|
||||
detachInterrupt(digitalPinToInterrupt(_mod->getGpio()));
|
||||
}
|
||||
|
||||
int16_t SX127x::startTransmit(uint8_t* data, size_t len, uint8_t addr) {
|
||||
// set mode to standby
|
||||
int16_t state = setMode(SX127X_STANDBY);
|
||||
|
|
|
@ -672,6 +672,11 @@ class SX127x: public PhysicalLayer {
|
|||
*/
|
||||
void setDio0Action(void (*func)(void));
|
||||
|
||||
/*!
|
||||
\brief Clears interrupt service routine to call when DIO0 activates.
|
||||
*/
|
||||
void clearDio0Action();
|
||||
|
||||
/*!
|
||||
\brief Set interrupt service routine function to call when DIO1 activates.
|
||||
|
||||
|
@ -679,6 +684,11 @@ class SX127x: public PhysicalLayer {
|
|||
*/
|
||||
void setDio1Action(void (*func)(void));
|
||||
|
||||
/*!
|
||||
\brief Clears interrupt service routine to call when DIO1 activates.
|
||||
*/
|
||||
void clearDio1Action();
|
||||
|
||||
/*!
|
||||
\brief Interrupt-driven binary transmit method. Will start transmitting arbitrary binary data up to 255 bytes long using %LoRa or up to 63 bytes using FSK modem.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue