component/bt: implement classic Bluetooth profiles A2DP(sink) and AVRCP(controller)

This commit is contained in:
wangmengyang
2017-04-10 16:12:21 +08:00
50 changed files with 1349 additions and 238 deletions

View File

@@ -55,6 +55,7 @@
#include "esp_task_wdt.h"
#include "esp_phy_init.h"
#include "esp_coexist.h"
#include "esp_panic.h"
#include "esp_core_dump.h"
#include "trax.h"
@@ -92,6 +93,11 @@ static const char* TAG = "cpu_start";
void IRAM_ATTR call_start_cpu0()
{
#if CONFIG_FREERTOS_UNICORE
RESET_REASON rst_reas[1];
#else
RESET_REASON rst_reas[2];
#endif
cpu_configure_region_protection();
//Move exception vectors to IRAM
@@ -99,10 +105,25 @@ void IRAM_ATTR call_start_cpu0()
"wsr %0, vecbase\n" \
::"r"(&_init_start));
rst_reas[0] = rtc_get_reset_reason(0);
#if !CONFIG_FREERTOS_UNICORE
rst_reas[1] = rtc_get_reset_reason(1);
#endif
// from panic handler we can be reset by RWDT or TG0WDT
if (rst_reas[0] == RTCWDT_SYS_RESET || rst_reas[0] == TG0WDT_SYS_RESET
#if !CONFIG_FREERTOS_UNICORE
|| rst_reas[1] == RTCWDT_SYS_RESET || rst_reas[1] == TG0WDT_SYS_RESET
#endif
) {
// stop wdt in case of any
ESP_EARLY_LOGI(TAG, "Stop panic WDT");
esp_panic_wdt_stop();
}
memset(&_bss_start, 0, (&_bss_end - &_bss_start) * sizeof(_bss_start));
/* Unless waking from deep sleep (implying RTC memory is intact), clear RTC bss */
if (rtc_get_reset_reason(0) != DEEPSLEEP_RESET) {
if (rst_reas[0] != DEEPSLEEP_RESET) {
memset(&_rtc_bss_start, 0, (&_rtc_bss_end - &_rtc_bss_start) * sizeof(_rtc_bss_start));
}
@@ -206,9 +227,7 @@ void start_cpu0_default(void)
#if CONFIG_TASK_WDT
esp_task_wdt_init();
#endif
#if !CONFIG_FREERTOS_UNICORE
esp_crosscore_int_init();
#endif
esp_ipc_init();
spi_flash_init();
/* init default OS-aware flash access critical section */