kopia lustrzana https://github.com/espressif/esp-idf
component/bt : modify some files adapt to new master
1. fix some header files include 2. modify demopull/111/merge
rodzic
0b37621438
commit
1c877be609
|
@ -24,8 +24,8 @@
|
|||
#include "hci_hal.h"
|
||||
#include "hci_internals.h"
|
||||
#include "hci_layer.h"
|
||||
|
||||
#include "thread.h"
|
||||
#include "bt.h"
|
||||
|
||||
#define HCI_HAL_SERIAL_BUFFER_SIZE 1026
|
||||
#define HCI_BLE_EVENT 0x3e
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
******************************************************************************/
|
||||
#include <string.h>
|
||||
|
||||
#include "bt.h"
|
||||
#include "bt_defs.h"
|
||||
#include "bt_trace.h"
|
||||
#include "hcidefs.h"
|
||||
|
|
|
@ -69,7 +69,7 @@ inline uint32_t swap_byte_32(uint32_t x) {
|
|||
((x & 0x00ff0000UL) >> 8) |
|
||||
((x & 0xff000000UL) >> 24));
|
||||
}
|
||||
|
||||
#ifndef ntohs
|
||||
inline uint16_t ntohs(uint16_t x) {
|
||||
#ifdef CPU_LITTLE_ENDIAN
|
||||
return swap_byte_16(x);
|
||||
|
@ -77,14 +77,6 @@ inline uint16_t ntohs(uint16_t x) {
|
|||
return x;
|
||||
#endif
|
||||
}
|
||||
|
||||
typedef struct vhci_host_callback {
|
||||
void (*notify_host_send_available)(void);
|
||||
int (*notify_host_recv)(uint8_t *data, uint16_t len);
|
||||
} vhci_host_callback_t;
|
||||
|
||||
bool API_vhci_host_check_send_available(void);
|
||||
void API_vhci_host_send_packet(uint8_t *data, uint16_t len);
|
||||
void API_vhci_host_register_callback(const vhci_host_callback_t *callback);
|
||||
#endif
|
||||
|
||||
#endif /* _BT_DEFS_H_ */
|
||||
|
|
|
@ -24,7 +24,9 @@
|
|||
#include "rom/ets_sys.h"
|
||||
//extern void ets_printf(const char *fmt, ...);
|
||||
|
||||
#ifndef assert
|
||||
#define assert(x) do { if (!(x)) ets_printf("bt host error %s %u\n", __FILE__, __LINE__); } while (0)
|
||||
#endif
|
||||
|
||||
inline void trc_dump_buffer(uint8_t *prefix, uint8_t *data, uint16_t len)
|
||||
{
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#define __BT_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "esp_err.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -1,123 +0,0 @@
|
|||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# Espressif IoT Development Framework Configuration
|
||||
#
|
||||
|
||||
#
|
||||
# SDK tool configuration
|
||||
#
|
||||
CONFIG_TOOLPREFIX="xtensa-esp32-elf-"
|
||||
CONFIG_PYTHON="python"
|
||||
|
||||
#
|
||||
# Bootloader config
|
||||
#
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set
|
||||
CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set
|
||||
CONFIG_LOG_BOOTLOADER_LEVEL=2
|
||||
|
||||
#
|
||||
# Serial flasher config
|
||||
#
|
||||
CONFIG_ESPTOOLPY_PORT="/dev/tty.usbserial-AK05BX2L"
|
||||
# CONFIG_ESPTOOLPY_BAUD_115200B is not set
|
||||
# CONFIG_ESPTOOLPY_BAUD_230400B is not set
|
||||
CONFIG_ESPTOOLPY_BAUD_921600B=y
|
||||
# CONFIG_ESPTOOLPY_BAUD_2MB is not set
|
||||
# CONFIG_ESPTOOLPY_BAUD_OTHER is not set
|
||||
CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200
|
||||
CONFIG_ESPTOOLPY_BAUD=921600
|
||||
CONFIG_ESPTOOLPY_COMPRESSED=y
|
||||
# CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set
|
||||
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
|
||||
# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set
|
||||
CONFIG_ESPTOOLPY_FLASHMODE="dio"
|
||||
# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set
|
||||
CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
|
||||
# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
|
||||
CONFIG_ESPTOOLPY_FLASHFREQ="40m"
|
||||
|
||||
#
|
||||
# Partition Table
|
||||
#
|
||||
CONFIG_PARTITION_TABLE_SINGLE_APP=y
|
||||
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
|
||||
# CONFIG_PARTITION_TABLE_CUSTOM is not set
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET=0x10000
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv"
|
||||
CONFIG_APP_OFFSET=0x10000
|
||||
|
||||
#
|
||||
# Component config
|
||||
#
|
||||
|
||||
#
|
||||
# BT config
|
||||
#
|
||||
CONFIG_BT_ENABLED=y
|
||||
|
||||
#
|
||||
# ESP32-specific config
|
||||
#
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_80=y
|
||||
# CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set
|
||||
# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=80
|
||||
# CONFIG_ESP32_ENABLE_STACK_WIFI is not set
|
||||
CONFIG_ESP32_ENABLE_STACK_BT=y
|
||||
# CONFIG_ESP32_ENABLE_STACK_NONE is not set
|
||||
CONFIG_MEMMAP_BT=y
|
||||
CONFIG_MEMMAP_SMP=y
|
||||
# CONFIG_MEMMAP_TRACEMEM is not set
|
||||
# CONFIG_MEMMAP_SPISRAM is not set
|
||||
CONFIG_NEWLIB_STDOUT_ADDCR=y
|
||||
|
||||
#
|
||||
# FreeRTOS
|
||||
#
|
||||
# CONFIG_FREERTOS_UNICORE is not set
|
||||
CONFIG_FREERTOS_CORETIMER_0=y
|
||||
# CONFIG_FREERTOS_CORETIMER_1 is not set
|
||||
# CONFIG_FREERTOS_CORETIMER_2 is not set
|
||||
CONFIG_FREERTOS_HZ=100
|
||||
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE=y
|
||||
# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set
|
||||
# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY is not set
|
||||
CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1
|
||||
# CONFIG_FREERTOS_PANIC_PRINT_HALT is not set
|
||||
CONFIG_FREERTOS_PANIC_PRINT_REBOOT=y
|
||||
# CONFIG_FREERTOS_PANIC_SILENT_REBOOT is not set
|
||||
# CONFIG_FREERTOS_PANIC_GDBSTUB is not set
|
||||
CONFIG_FREERTOS_DEBUG_OCDAWARE=y
|
||||
CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y
|
||||
# CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set
|
||||
# CONFIG_FREERTOS_ASSERT_DISABLE is not set
|
||||
CONFIG_FREERTOS_BREAK_ON_SCHEDULER_START_JTAG=y
|
||||
# CONFIG_ENABLE_MEMORY_DEBUG is not set
|
||||
# CONFIG_FREERTOS_DEBUG_INTERNALS is not set
|
||||
|
||||
#
|
||||
# Log output
|
||||
#
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
|
||||
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
|
||||
CONFIG_LOG_DEFAULT_LEVEL=3
|
||||
CONFIG_LOG_COLORS=y
|
||||
|
||||
#
|
||||
# LWIP
|
||||
#
|
||||
CONFIG_LWIP_MAX_SOCKETS=4
|
||||
CONFIG_LWIP_THREAD_LOCAL_STORAGE_INDEX=0
|
||||
# CONFIG_LWIP_SO_REUSE is not set
|
|
@ -1,6 +1,10 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include "bt.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "string.h"
|
||||
|
||||
|
||||
extern void bte_main_boot_entry(void *);
|
||||
|
@ -15,8 +19,9 @@ void pingTask(void *pvParameters)
|
|||
}
|
||||
}
|
||||
|
||||
void bt_app_main()
|
||||
void app_main()
|
||||
{
|
||||
bt_controller_init();
|
||||
xTaskCreatePinnedToCore(&pingTask, "pingTask", 2048, NULL, 5, NULL, 0);
|
||||
bt_app_task_start_up();
|
||||
bte_main_boot_entry(bt_app_core_start);
|
Ładowanie…
Reference in New Issue