mirror of
https://github.com/synthetos/g2.git
synced 2026-09-21 18:56:31 +08:00
Minor cleanup is status reports
This commit is contained in:
+7
-4
@@ -267,7 +267,7 @@ stat_t sr_request_status_report(cmStatusReportRequest request_type)
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
sr.status_report_systick = SysTickTimer.getValue();
|
||||
sr.status_report_systick.set(0);
|
||||
if (request_type == SR_REQUEST_IMMEDIATE) {
|
||||
sr.status_report_request = SR_FILTERED; // will trigger a filtered or verbose report depending on verbosity setting
|
||||
|
||||
@@ -276,11 +276,11 @@ stat_t sr_request_status_report(cmStatusReportRequest request_type)
|
||||
|
||||
} else if (request_type == SR_REQUEST_TIMED) {
|
||||
sr.status_report_request = sr.status_report_verbosity;
|
||||
sr.status_report_systick += sr.status_report_interval;
|
||||
sr.status_report_systick.set(sr.status_report_interval);
|
||||
|
||||
} else {
|
||||
sr.status_report_request = SR_VERBOSE;
|
||||
sr.status_report_systick += sr.status_report_interval;
|
||||
sr.status_report_systick.set(sr.status_report_interval);
|
||||
}
|
||||
return (STAT_OK);
|
||||
}
|
||||
@@ -293,10 +293,13 @@ stat_t sr_status_report_callback() // called by controller dispatcher
|
||||
// conditions where autogenerated SRs will not be returned
|
||||
if ((sr.status_report_request == SR_OFF) ||
|
||||
(sr.status_report_verbosity == SR_OFF) ||
|
||||
(SysTickTimer.getValue() < sr.status_report_systick) ) {
|
||||
(!sr.status_report_systick.isPast()) ||
|
||||
(cs.controller_state != CONTROLLER_READY) ) {
|
||||
return (STAT_NOOP);
|
||||
}
|
||||
|
||||
sr.status_report_systick.clear();
|
||||
|
||||
// don't send an SR if you the planner is experiencing a time constraint
|
||||
if (!mp_is_phat_city_time()) {
|
||||
if (++sr.throttle_counter != SR_THROTTLE_COUNT) {
|
||||
|
||||
Reference in New Issue
Block a user