Created
December 3, 2017 14:26
-
-
Save kzyapkov/4b8f6d6479f9d9cdd7e238caaafd9012 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mgos.h" | |
void sayit(void *arg) { | |
LOG(LL_INFO, ("TICK!")); | |
} | |
IRAM void _timer_cb(void *arg) { | |
static uint32_t count = 0; | |
if (((++count) % 1000) == 0) { | |
mgos_invoke_cb(sayit, NULL, true); | |
} | |
(void) arg; | |
} | |
enum mgos_app_init_result mgos_app_init(void) { | |
mgos_set_hw_timer(1000, 1, _timer_cb, NULL); | |
return MGOS_APP_INIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment