altos: Allow setting telemetry interval to zero without crashing
authorKeith Packard <keithp@keithp.com>
Fri, 28 Oct 2022 00:43:08 +0000 (17:43 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 28 Oct 2022 00:44:59 +0000 (17:44 -0700)
commita81f5a78172663376ad9687976b9821a755d5e31
treeeb44cac275b1761c0c323d15cdb9e159cde91972
parent48a8ae2d38ecad5aa84b2158045c6a2fd8abe5ab
altos: Allow setting telemetry interval to zero without crashing

Setting telemetry interval to zero means disable telemetry, but the
code was using the zero value to compute a bunch of packet delays,
which involved dividing by the interval value causing a crash when it
was zero. Skip those subsequent computations as they won't be used
anyways.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel/ao_telemetry.c