mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 00:03:45 +08:00
simpilify ui_read_params (#19585)
* simpilify ui_read_params * apply review old-commit-hash: e3ffa91d177d5e9ec8c9735a489b582e71a96e74
This commit is contained in:
+4
-8
@@ -243,14 +243,10 @@ static void ui_read_params(UIState *s) {
|
||||
if (frame % (5*UI_FREQ) == 0) {
|
||||
read_param(&s->is_metric, "IsMetric");
|
||||
} else if (frame % (6*UI_FREQ) == 0) {
|
||||
uint64_t last_athena_ping = 0;
|
||||
int param_read = read_param(&last_athena_ping, "LastAthenaPingTime");
|
||||
if (param_read != 0) { // Failed to read param
|
||||
s->scene.athenaStatus = NET_DISCONNECTED;
|
||||
} else if (nanos_since_boot() - last_athena_ping < 70e9) {
|
||||
s->scene.athenaStatus = NET_CONNECTED;
|
||||
} else {
|
||||
s->scene.athenaStatus = NET_ERROR;
|
||||
s->scene.athenaStatus = NET_DISCONNECTED;
|
||||
uint64_t last_ping = 0;
|
||||
if (read_param(&last_ping, "LastAthenaPingTime") == 0) {
|
||||
s->scene.athenaStatus = nanos_since_boot() - last_ping < 70e9 ? NET_CONNECTED : NET_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user