add max nrfreceivedelay to display
This commit is contained in:
parent
85f200da22
commit
3a04a12713
|
@ -166,6 +166,7 @@ nrfdata lastnrfdata;
|
|||
long last_nrfreceive = 0; //last time values were received and checksum ok
|
||||
unsigned long nrf_delay = 0;
|
||||
unsigned long last_nrfreceive_delay=0;
|
||||
unsigned long max_last_nrfreceive_delay=0; //maximum value (used for display)
|
||||
#define MAX_NRFDELAY 100 //ms. maximum time delay at which vehicle will disarm
|
||||
|
||||
boolean radiosendOk=false;
|
||||
|
@ -441,6 +442,7 @@ void loop() {
|
|||
if (lastnrfdata.checksum == calcchecksum) { //checksum ok?
|
||||
lastpacketOK = true;
|
||||
last_nrfreceive_delay=loopmillis-last_nrfreceive; //for display purpose
|
||||
max_last_nrfreceive_delay=max(last_nrfreceive_delay,max_last_nrfreceive_delay);
|
||||
last_nrfreceive = loopmillis;
|
||||
|
||||
watchdogtimer=loopmillis; //reset watchdog
|
||||
|
@ -670,6 +672,7 @@ void updateInputs(unsigned long loopmillis) {
|
|||
}
|
||||
if (button_down_click) {
|
||||
displaymode=DISPLAY_STATS3;
|
||||
max_last_nrfreceive_delay=0; //reset when switching to this display
|
||||
}
|
||||
break;
|
||||
case DISPLAY_MENU:
|
||||
|
@ -876,7 +879,7 @@ void display_show_stats3() {
|
|||
display.print(F("looptime=")); display.println(loopmillis-last_loopmillis);
|
||||
display.print(F("feedback=")); display.println(esc.getFeedbackInterval());
|
||||
|
||||
display.print(F("nrf_delay=")); display.println(last_nrfreceive_delay);
|
||||
display.print(F("nrf_delay=")); display.println(last_nrfreceive_delay); display.print(F(" max=")); display.println(max_last_nrfreceive_delay);
|
||||
display.print(F("maxdiff=")); display.println(raw_length_maxdiff);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue