Skip to content

Commit

Permalink
[STM32WLx] Added missing interrupt actions (#844)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgromes committed Oct 14, 2023
1 parent f4f0053 commit 0d43891
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/modules/SX126x/STM32WLx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,28 @@ void STM32WLx::clearDio1Action() {
SubGhz.detachInterrupt();
}

void STM32WLx::setPacketReceivedAction(void (*func)(void)) {
this->setDio1Action(func);
}

void STM32WLx::clearPacketReceivedAction() {
this->clearDio1Action();
}

void STM32WLx::setPacketSentAction(void (*func)(void)) {
this->setDio1Action(func);
}

void STM32WLx::clearPacketSentAction() {
this->clearDio1Action();
}

void STM32WLx::setChannelScanAction(void (*func)(void)) {
this->setDio1Action(func);
}

void STM32WLx::clearChannelScanAction() {
this->clearDio1Action();
}

#endif // !defined(RADIOLIB_EXCLUDE_STM32WLX)
33 changes: 33 additions & 0 deletions src/modules/SX126x/STM32WLx.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,39 @@ class STM32WLx : public SX1262 {
*/
void clearDio1Action();

/*!
\brief Sets interrupt service routine to call when a packet is received.
\param func ISR to call.
*/
void setPacketReceivedAction(void (*func)(void));

/*!
\brief Clears interrupt service routine to call when a packet is received.
*/
void clearPacketReceivedAction();

/*!
\brief Sets interrupt service routine to call when a packet is sent.
\param func ISR to call.
*/
void setPacketSentAction(void (*func)(void));

/*!
\brief Clears interrupt service routine to call when a packet is sent.
*/
void clearPacketSentAction();

/*!
\brief Sets interrupt service routine to call when a channel scan is finished.
\param func ISR to call.
*/
void setChannelScanAction(void (*func)(void));

/*!
\brief Clears interrupt service routine to call when a channel scan is finished.
*/
void clearChannelScanAction();

#if !defined(RADIOLIB_GODMODE)
protected:
#endif
Expand Down

0 comments on commit 0d43891

Please sign in to comment.