kopia lustrzana https://github.com/jgromes/RadioLib
[STM32WLx] Fixed order of ISR functions in examples
rodzic
12d81e6d0f
commit
0a6d6a26e1
|
@ -33,6 +33,18 @@ static const Module::RfSwitchMode_t rfswitch_table[] = {
|
||||||
END_OF_MODE_TABLE,
|
END_OF_MODE_TABLE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// flag to indicate that a packet was detected or CAD timed out
|
||||||
|
volatile bool scanFlag = false;
|
||||||
|
|
||||||
|
// this function is called when a complete packet
|
||||||
|
// is received by the module
|
||||||
|
// IMPORTANT: this function MUST be 'void' type
|
||||||
|
// and MUST NOT have any arguments!
|
||||||
|
void setFlag(void) {
|
||||||
|
// something happened, set the flag
|
||||||
|
scanFlag = true;
|
||||||
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
|
||||||
|
@ -66,18 +78,6 @@ void setup() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// flag to indicate that a packet was detected or CAD timed out
|
|
||||||
volatile bool scanFlag = false;
|
|
||||||
|
|
||||||
// this function is called when a complete packet
|
|
||||||
// is received by the module
|
|
||||||
// IMPORTANT: this function MUST be 'void' type
|
|
||||||
// and MUST NOT have any arguments!
|
|
||||||
void setFlag(void) {
|
|
||||||
// something happened, set the flag
|
|
||||||
scanFlag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
// check if the flag is set
|
// check if the flag is set
|
||||||
if(scanFlag) {
|
if(scanFlag) {
|
||||||
|
|
|
@ -43,6 +43,18 @@ static const Module::RfSwitchMode_t rfswitch_table[] = {
|
||||||
END_OF_MODE_TABLE,
|
END_OF_MODE_TABLE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// flag to indicate that a packet was received
|
||||||
|
volatile bool receivedFlag = false;
|
||||||
|
|
||||||
|
// this function is called when a complete packet
|
||||||
|
// is received by the module
|
||||||
|
// IMPORTANT: this function MUST be 'void' type
|
||||||
|
// and MUST NOT have any arguments!
|
||||||
|
void setFlag(void) {
|
||||||
|
// we got a packet, set the flag
|
||||||
|
receivedFlag = true;
|
||||||
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
|
||||||
|
@ -97,18 +109,6 @@ void setup() {
|
||||||
// radio.scanChannel();
|
// radio.scanChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
// flag to indicate that a packet was received
|
|
||||||
volatile bool receivedFlag = false;
|
|
||||||
|
|
||||||
// this function is called when a complete packet
|
|
||||||
// is received by the module
|
|
||||||
// IMPORTANT: this function MUST be 'void' type
|
|
||||||
// and MUST NOT have any arguments!
|
|
||||||
void setFlag(void) {
|
|
||||||
// we got a packet, set the flag
|
|
||||||
receivedFlag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
// check if the flag is set
|
// check if the flag is set
|
||||||
if(receivedFlag) {
|
if(receivedFlag) {
|
||||||
|
|
Ładowanie…
Reference in New Issue