typedef bool BOOLEAN;
#define PACKED __packed
-#define INLINE __inline
+// #define INLINE __inline
#define BCM_STRCPY_S(x1,x2,x3) strcpy((x1),(x3))
#define BCM_STRNCPY_S(x1,x2,x3,x4) strncpy((x1),(x3),(x4))
#define COUNTER_STOP(counter) \
do{ \
s_flash_stats.counter.count++; \
- s_flash_stats.counter.time += (xthal_get_ccount() - ts_begin) / (XT_CLOCK_FREQ / 1000000); \\
+ s_flash_stats.counter.time += (xthal_get_ccount() - ts_begin) / (XT_CLOCK_FREQ / 1000000); \
} while(0)
#define COUNTER_ADD_BYTES(counter, size) \
*****************************************************************************/
#include <stddef.h>
#include "uipc.h"
-
+#include "esp_system.h"
+#include "EspAudio.h"
+#include "EspAudioCom.h"
+#include "bt_trace.h"
/*****************************************************************************
** Constants & Macros
******************************************************************************/
*******************************************************************************/
void UIPC_Init(void *dummy)
{
+ LOG_ERROR("Free memory: %d bytes\n", system_get_free_heap_size());
+ EspAudio_Init();
return;
}
*******************************************************************************/
BOOLEAN UIPC_Open(tUIPC_CH_ID ch_id, tUIPC_RCV_CBACK *p_cback)
{
+ if (ch_id == UIPC_CH_ID_AV_AUDIO) {
+ // TODO: review the stream param config parameter here
+ EspAudioPlayerStreamCfg(StreamSampleRate_44k, StreamChannel_Two, StreamBitLen_16BIT);
+ EspAudio_SetupStream("stream.pcm", InputSrcType_Stream);
+ }
+
+ /*
+ if (p_cback) {
+ p_cback(ch_id, UIPC_OPEN_EVT);
+ }
+ */
return TRUE;
}
*******************************************************************************/
BOOLEAN UIPC_Send(tUIPC_CH_ID ch_id, UINT16 msg_evt, UINT8 *p_buf, UINT16 msglen)
{
+ if (ch_id == UIPC_CH_ID_AV_AUDIO) {
+ EspAudioPlayerStreamWrite(p_buf, msglen);
+ }
return TRUE;
}
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
#include "bt.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
-#include "string.h"
+#include "nvs_flash.h"
+#include "esp_system.h"
extern void bte_main_boot_entry(void *);
extern void bt_app_task_start_up(void);
extern void bt_app_core_start(void);
-void pingTask(void *pvParameters)
-{
- while (1) {
- vTaskDelay(1000 / portTICK_PERIOD_MS);
- printf("ping\n");
- }
-}
-
void app_main()
{
+ nvs_flash_init();
+ system_init();
+ printf("Free memory: %d bytes\n", system_get_free_heap_size());
bt_controller_init();
- xTaskCreatePinnedToCore(&pingTask, "pingTask", 2048, NULL, 5, NULL, 0);
bt_app_task_start_up();
// bte_main_boot_entry(bt_app_core_start);
}