Fix sysinfo test false alarm on uptime

This commit is contained in:
Hui, Chunyang 2021-02-04 08:56:16 +00:00 committed by Zongmin.Gu
parent 8c5e6ff20a
commit 58bddcb89d

@ -31,7 +31,8 @@ int test_sysinfo() {
printf ("free RAM: %5.1f MB\n", info.freeram / MEGABYTE); printf ("free RAM: %5.1f MB\n", info.freeram / MEGABYTE);
printf ("process count: %d\n", info.procs); printf ("process count: %d\n", info.procs);
if (info.uptime % MIN < 3) { // make sure update is in a valid range (1s ~ 5min)
if (info.uptime < 1 || info.uptime / MIN > 5 ) {
THROW_ERROR("system uptime error"); THROW_ERROR("system uptime error");
} }