File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
libraries/Dragino/examples/LoRa/LoRaWAN/single_pkt_fwd_v004 Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ static long BW, preLen;
11
11
static long old_time = millis();
12
12
static long new_time;
13
13
static unsigned long newtime;
14
- const long sendpkt_interval = 10000 ; // 10 seconds for replay.
14
+ const long sendpkt_interval = 15000 ; // 15 seconds for replay.
15
15
const long interval = 60000 ; // 1min for feeddog.
16
16
unsigned long previousMillis = millis();
17
-
17
+ unsigned long previousMillis_1 = millis();
18
18
19
19
void getRadioConf ();// Get LoRa Radio Configure from LG01
20
20
void setLoRaRadio ();// Set LoRa Radio
@@ -229,12 +229,13 @@ void receivepacket() {
229
229
// try to parse packet
230
230
LoRa.setSpreadingFactor (SF);
231
231
LoRa.receive (0 );
232
- // old_time = millis();
233
-
234
- while (new_time - old_time < sendpkt_interval) {
235
- new_time = millis ();
232
+
233
+ unsigned long currentMillis_1 = millis ();
234
+ if ((currentMillis_1 - previousMillis_1 ) >= sendpkt_interval ){
235
+
236
+ previousMillis_1 = currentMillis_1;
236
237
packetSize = LoRa.parsePacket ();
237
-
238
+
238
239
if (packetSize) { // Received a packet
239
240
if ( debug > 0 ) {
240
241
Console.println ();
You can’t perform that action at this time.
0 commit comments