esp32: Use time_ms instead of ticks

This commit is contained in:
Matt Kelly 2017-02-21 23:32:56 -05:00 committed by Matthias Ringwald
parent e4eb95214f
commit e9421616b0
4 changed files with 9 additions and 31 deletions

View File

@ -6,7 +6,7 @@
#define __BTSTACK_CONFIG
// Port related features
#define HAVE_EMBEDDED_TICK
#define HAVE_EMBEDDED_TIME_MS
#define HAVE_MALLOC
// BTstack features that can be enabled

View File

@ -11,8 +11,6 @@ BTSTACK_ROOT := ../../..
# Examples
#include ${BTSTACK_ROOT}/example/Makefile.inc
#COMPONENT_ADD_LDFLAGS := -l$(COMPONENT_NAME) $(COMPONENT_PATH)/../components/libbtdm_app/libbtdm_app.a $(COMPONENT_PATH)/../components/libcoexist/libcoexist.a $(COMPONENT_PATH)/../components/libphy/libphy.a
COMPONENT_ADD_INCLUDEDIRS := $(BTSTACK_ROOT)/src/ble $(BTSTACK_ROOT)/src $(BTSTACK_ROOT)/platform/embedded .
COMPONENT_SRCDIRS := $(BTSTACK_ROOT)/src/ble $(BTSTACK_ROOT)/src/ $(BTSTACK_ROOT)/platform/embedded .

View File

@ -1,28 +0,0 @@
#include "hal_tick.h"
#include <stdio.h>
#include <stdlib.h>
#include "freertos/FreeRTOS.h"
static void dummy_handler(void){};
static void (*tick_handler)(void) = &dummy_handler;
void hal_tick_init(void){
printf("hal_tick_init\n");
}
void hal_tick_set_handler(void (*handler)(void)){
printf("hal_tick_set_handler\n");
if (handler == NULL){
tick_handler = &dummy_handler;
return;
}
tick_handler = handler;
}
int hal_tick_get_tick_period_in_ms(void){
printf("hal_tick_get_tick_period_in_ms\n");
return portTICK_PERIOD_MS;
}

View File

@ -0,0 +1,8 @@
#include "hal_time_ms.h"
uint32_t esp_log_timestamp();
uint32_t hal_time_ms(void) {
// super hacky way to get ms
return esp_log_timestamp();
}