В
Size: a a a
В
В
В
EG
I
void loop()Данные из порта:
{
unsigned long milisNOW = millis();
if ((unsigned long)(milisNOW - time2) > 3600000)
{
Serial.println(F("Long time no commands"));
Serial.print(F("time2="));
Serial.println(time2);
Serial.print(F("milisNOW="));
Serial.println(milisNOW);
Serial.print(F("Diff="));
Serial.println((milisNOW - time2));
EEPROM.update(7, 2);
radio.stopListening();
radio.flush_tx();
radio.flush_rx();
radio.powerDown();
delay(500);
Serial.println(F("Rebooting ......"));
delay(1000);
reboot();
}
.......
}
Long time no commands
time2=1222470
milisNOW=1222470
Diff=0
Rebooting ......I
I
AK
I
void intHandler()unsigned long started_waiting_at = millis();
{
bool tx, fail, rx;
radio.whatHappened(tx, fail, rx);
if (rx)
{
// Set up a timeout period, get the current microsecondsif (millis() - started_waiting_at > 200)
bool timeout = false; // Set up a variable to indicate if a response was received or not
byte tempdata[ch_len];
while (radio.available())
{ // While nothing is received
{ // If waited longer than 200ms, indicate timeout and exit while loop
timeout = true;
break;
}
radio.read(&tempdata, ch_len);
}
if (timeout)
Собственно вопрос, как это исправитьAK
AK
I
I
DB
DB
D
AK
AK
D
D