Update RadioLib to V6.0.0
This commit is contained in:
parent
735b55b76b
commit
04f65f1392
166 changed files with 15126 additions and 10136 deletions
|
|
@ -49,7 +49,7 @@ void setup() {
|
|||
|
||||
// set the function that will be called
|
||||
// when new packet is received
|
||||
radio.setGdo0Action(setFlag);
|
||||
radio.setGdo0Action(setFlag, RISING);
|
||||
|
||||
// start listening for packets
|
||||
Serial.print(F("[CC1101] Starting to listen ... "));
|
||||
|
|
@ -75,9 +75,6 @@ void setup() {
|
|||
// flag to indicate that a packet was received
|
||||
volatile bool receivedFlag = false;
|
||||
|
||||
// disable interrupt when it's not needed
|
||||
volatile bool enableInterrupt = true;
|
||||
|
||||
// this function is called when a complete packet
|
||||
// is received by the module
|
||||
// IMPORTANT: this function MUST be 'void' type
|
||||
|
|
@ -86,11 +83,6 @@ volatile bool enableInterrupt = true;
|
|||
ICACHE_RAM_ATTR
|
||||
#endif
|
||||
void setFlag(void) {
|
||||
// check if the interrupt is enabled
|
||||
if(!enableInterrupt) {
|
||||
return;
|
||||
}
|
||||
|
||||
// we got a packet, set the flag
|
||||
receivedFlag = true;
|
||||
}
|
||||
|
|
@ -98,10 +90,6 @@ void setFlag(void) {
|
|||
void loop() {
|
||||
// check if the flag is set
|
||||
if(receivedFlag) {
|
||||
// disable the interrupt service routine while
|
||||
// processing the data
|
||||
enableInterrupt = false;
|
||||
|
||||
// reset flag
|
||||
receivedFlag = false;
|
||||
|
||||
|
|
@ -147,10 +135,6 @@ void loop() {
|
|||
|
||||
// put module back to listen mode
|
||||
radio.startReceive();
|
||||
|
||||
// we're ready to receive more packets,
|
||||
// enable interrupt service routine
|
||||
enableInterrupt = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue