mirror of
https://github.com/espressif/esp-idf.git
synced 2024-09-20 00:36:01 -04:00
ble_mesh: Fix next_period computation
If the duration to publish is roughly the same as the period, we might end up with elapsed == period, which returns 0 and cancel the periodic publication. Instead 1 should be returned, just like when the elapsed time is greater than the period.
This commit is contained in:
parent
7d7bbec5fe
commit
fc80d107ad
@ -227,7 +227,7 @@ static s32_t next_period(struct bt_mesh_model *mod)
|
||||
|
||||
BT_DBG("Publishing took %ums", elapsed);
|
||||
|
||||
if (elapsed > period) {
|
||||
if (elapsed >= period) {
|
||||
BT_WARN("Publication sending took longer than the period");
|
||||
/* Return smallest positive number since 0 means disabled */
|
||||
return K_MSEC(1);
|
||||
|
Loading…
Reference in New Issue
Block a user