@pnru_gitlab How do you think we should implement sleep in the lcc library?
See here for some ideas. Untested code.
#include <stdio.h>
extern int sleep(int sec);
extern int usleep(int usec);
int main() {
printf("Sleep for 2 seconds\n");
sleep(2);
printf("Sleep for 1M microseconds\n");
usleep(1000000);
return 0;
}
root@buildroot:~# time ./a.out
Sleep for 2 seconds
Sleep for 1M microseconds
real 0m 3.02s
user 0m 0.00s
sys 0m 0.01s
self._i2c.writeto_mem(MCP7940.ADDRESS, 0x03, bytes([0x07 | 8])) # weekday | battery_backup