Skip to content

Commit

Permalink
Add mgos_uptime_micros(), fix sleep issues on CC32x and STM32
Browse files Browse the repository at this point in the history
`mgos_uptime_micros()` provides a reliable, microsecond-accurate monotonic counter on all our supported platforms:

 * On ESP32 we have esp_timer_get_time()
 * On ESP8266 we have system_get_time() (plus overflow handling)
 * On ARM-based platforms we use FreeRTOS xTaskGetTickCount() + SYSTICK for fractional ticks

CL: Add mgos_uptime_micros(), fix sleep issues on CC32x and STM32

PUBLISHED_FROM=fb548dc351b24de0f0ceb1b0f974be3b495264d3
  • Loading branch information
Deomid Ryabkov authored and cesantabot committed Jan 19, 2019
1 parent b713e39 commit 59c02b9
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/mgos_core.c
Expand Up @@ -37,7 +37,6 @@ static const char *dt = STRINGIZE(MGOS_ROOT_DEVTAB);
#include "mgos_gpio_internal.h"
#include "mgos_net_internal.h"
#include "mgos_sys_config_internal.h"
#include "mgos_time_internal.h"

extern int mg_ssl_if_mbed_random(void *ctx, unsigned char *buf, size_t len);

Expand Down Expand Up @@ -78,7 +77,6 @@ bool mgos_core_init(void) {
srand(seed);

mgos_event_register_base(MGOS_EVENT_SYS, "mos");
mgos_uptime_init();

r = mgos_net_init();
if (r != MGOS_INIT_OK) {
Expand Down

0 comments on commit 59c02b9

Please sign in to comment.