Is there a reason this never sleeps more than a second?
This would be the more obvious code for that function, actually assigning something to the sleep seconds?
void _sleep(uint32_t t_ms)
{
struct timespec ts;
ts.tv_sec = t_ms / 1000;
/* mod because nsec must be in the range 0 to 999999999 */
ts.tv_nsec = (t_ms % 1000) * 1000000LL;
nanosleep(&ts, NULL);
}
https://github.com/alexh-name/bsec_bme680_linux/blob/aca3e1f21845f45dd0157b53163ce26de57f60e9/bsec_bme680.c#L139
Is there a reason this never sleeps more than a second? This would be the more obvious code for that function, actually assigning something to the sleep seconds?