Commit 3c94f273 authored by Lucas Russo's avatar Lucas Russo

chips/sm_ch_si57x.c: check for division by 0

parent 9bdaa06f
......@@ -169,6 +169,8 @@ smch_err_e smch_si57x_set_freq (smch_si57x_t *self, double frequency)
assert (self);
smch_err_e err = SMCH_SUCCESS;
ASSERT_TEST(frequency > 0, "Invalid frequency (0 Hz)", err_exit);
DBE_DEBUG (DBG_SM_CH | DBG_LVL_TRACE, "[sm_ch:si57x_set_freq] Configuring "
"frequency to %f Hz\n", frequency);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment