mirror of
https://github.com/CovidBraceletPrj/CovidBracelet.git
synced 2024-12-05 00:55:43 +01:00
Adding main tracing and sync calls again
This commit is contained in:
parent
2f955851e1
commit
5f0496558f
35
src/main.c
35
src/main.c
@ -160,4 +160,39 @@ void main(void) {
|
|||||||
bloom_test();
|
bloom_test();
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Initialize the Bluetooth Subsystem */
|
||||||
|
err = bt_enable(NULL);
|
||||||
|
if (err) {
|
||||||
|
printk("Bluetooth init failed (err %d)\n", err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialize the Tracing Subsystem */
|
||||||
|
err = tracing_init();
|
||||||
|
if (err) {
|
||||||
|
printk("Tracing init failed (err %d)\n", err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialize the Gatt Subsystem */
|
||||||
|
err = sync_service_init();
|
||||||
|
if (err) {
|
||||||
|
printk("Sync Service init failed (err %d)\n", err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
printk("Components initialized! Starting Tracing and Gatt...\n");
|
||||||
|
|
||||||
|
// We sleep just for one second
|
||||||
|
k_sleep(K_MSEC(1000));
|
||||||
|
|
||||||
|
do {
|
||||||
|
uint32_t tracing_sleep_ms = tracing_run();
|
||||||
|
uint32_t sync_sleep_ms = sync_service_run();
|
||||||
|
|
||||||
|
uint32_t sleep_ms = MIN(tracing_sleep_ms, sync_sleep_ms);
|
||||||
|
//printk("Sleeping a bit (%u ms)...\n", sleep_ms);
|
||||||
|
k_sleep(K_MSEC(sleep_ms)); // TODO: what to put here?
|
||||||
|
} while (1);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user