A272R版本优化
This commit is contained in:
@ -343,5 +343,3 @@ int ark_network_init()
|
||||
|
||||
return (int)ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -582,12 +582,15 @@ eDHCPCallbackAnswer_t xApplicationDHCPHook( eDHCPCallbackPhase_t eDHCPPhase,
|
||||
|
||||
static BaseType_t carlink_wifi_init()
|
||||
{
|
||||
int status;
|
||||
static int wifi_sdio_status = MMCSD_HOST_UNPLUGED;
|
||||
|
||||
if (wifi_sdio_status == MMCSD_HOST_PLUGED)
|
||||
return 0;
|
||||
WIFI_Context_init();
|
||||
WIFI_RegisterEvent(eWiFiEventMax, carlink_wifi_event_handler);
|
||||
for (;;) {
|
||||
status = mmcsd_wait_sdio_ready((int32_t)portMAX_DELAY);
|
||||
if (status == MMCSD_HOST_PLUGED) {
|
||||
wifi_sdio_status = mmcsd_wait_sdio_ready((int32_t)portMAX_DELAY);
|
||||
if (wifi_sdio_status == MMCSD_HOST_PLUGED) {
|
||||
printf("detect sdio device\r\n");
|
||||
break;
|
||||
}
|
||||
@ -613,8 +616,14 @@ static void bt_set_support_carplay_android_auto()//auto + cp
|
||||
console_send_atcmd(cmd_str, strlen(cmd_str));
|
||||
}
|
||||
|
||||
static void taskInitCarlinkWlanThread(void* param)
|
||||
{
|
||||
carlink_start_wlan();
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
int carlink_bt_wifi_init()
|
||||
{
|
||||
int retry_count = 0;
|
||||
pthread_mutex_lock(&btwifiLocker);
|
||||
if (g_bt_wifi_init_flag) {
|
||||
pthread_mutex_unlock(&btwifiLocker);
|
||||
@ -627,14 +636,24 @@ int carlink_bt_wifi_init()
|
||||
//bt_set_support_carplay();
|
||||
bt_set_support_carplay_android_auto();
|
||||
carlink_bt_open_nolock();
|
||||
carlink_start_wlan();
|
||||
g_bt_wifi_init_flag = 1;
|
||||
lwip_tcpip_init_done_flag = 0;
|
||||
xTaskCreate(taskInitCarlinkWlanThread, "initThread", 2048 * 4, NULL, 1, NULL);
|
||||
|
||||
while(lwip_tcpip_init_done_flag == 0) {
|
||||
if (retry_count++ > 50)
|
||||
break;
|
||||
vTaskDelay(pdMS_TO_TICKS(300));
|
||||
}
|
||||
|
||||
if (lwip_tcpip_init_done_flag) {
|
||||
g_bt_wifi_init_flag = 1;
|
||||
printf("bt wlan init ok\r\n");
|
||||
} else {
|
||||
g_bt_wifi_init_flag = 0;
|
||||
printf("bt wlan init failed\r\n");
|
||||
}
|
||||
pthread_mutex_unlock(&btwifiLocker);
|
||||
printf("bt wlan init is ok\r\n");
|
||||
|
||||
// app_wifi_update_demo();
|
||||
wifi_update_init();
|
||||
printf("app wlan update init ok\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ void carlink_register_event_callbacks(const struct ICalinkEventCallbacks *pcb)
|
||||
|
||||
int carlink_common_init()
|
||||
{
|
||||
FF_Disk_t *sfdisk = NULL;
|
||||
//FF_Disk_t *sfdisk = NULL;
|
||||
BaseType_t ret = -1;
|
||||
|
||||
pthread_mutex_lock(&carlink_com_locker);
|
||||
@ -120,14 +120,14 @@ int carlink_common_init()
|
||||
}
|
||||
|
||||
pthread_key_system_init();
|
||||
|
||||
#if 0
|
||||
sfdisk = FF_SFDiskInit("/sf");
|
||||
if (!sfdisk) {
|
||||
printf("FF_SFDiskInit fail.\r\n");
|
||||
//return;
|
||||
}
|
||||
|
||||
ret = xTaskCreate(carlink_event_proc, "cl_ev_proc", 2048, NULL, configMAX_PRIORITIES / 5, NULL);
|
||||
#endif
|
||||
ret = xTaskCreate(carlink_event_proc, "cl_ev_proc", 2048, NULL, configMAX_PRIORITIES - 1, NULL);
|
||||
g_comm_init_flag = 1;
|
||||
|
||||
exit:
|
||||
|
@ -31,6 +31,11 @@ void set_carlink_display_info(int x, int y, int w, int h);//set carlink show are
|
||||
void set_carlink_display_state(int on); // on: 1.display carlink; 0. display native ui
|
||||
void set_carlink_active_video_info(int x, int y);//for android auto
|
||||
|
||||
|
||||
void* h264_video_player_init();
|
||||
void h264_video_player_uninit(void* h264_Handle);
|
||||
int h264_video_player_proc(void* h264_Handle, const char *h264_buf, int h264_buf_len);
|
||||
|
||||
#define WRITE_BE32(ptr, val) \
|
||||
do { \
|
||||
uint8_t* __ptr = (uint8_t*)(ptr); \
|
||||
|
@ -131,6 +131,19 @@ typedef struct __carplay_cfg_info
|
||||
|
||||
}carplay_cfg_info;
|
||||
|
||||
typedef struct _carlink_flash_io
|
||||
{
|
||||
uint32_t (*get_data_arae_size)(void* ctx);
|
||||
uint32_t (*get_flash_block_erase_size)(void* ctx);
|
||||
int32_t (*op_flash)(void* flash_handle, void* ctx, int open);
|
||||
int32_t (*read_data)(void* flash_handle, void *data, uint32_t length, uint32_t offset, void* ctx);
|
||||
int32_t (*write_data)(void* flash_handle, void *data, uint32_t length, uint32_t offset, void* ctx);
|
||||
void* ctx;
|
||||
void* flash_handle;
|
||||
} carlink_flash_io;
|
||||
void register_carlink_flash_io_interface(carlink_flash_io *handle);
|
||||
|
||||
#if 0
|
||||
typedef struct __auto_cfg_info
|
||||
{
|
||||
short width;//pixel
|
||||
@ -142,10 +155,10 @@ typedef struct __auto_cfg_info
|
||||
bool disable_carplay_audio;
|
||||
|
||||
} auto_cfg_info;
|
||||
|
||||
#endif
|
||||
|
||||
extern carplay_cfg_info *g_link_info;
|
||||
extern auto_cfg_info *g_auto_link_info;
|
||||
//extern auto_cfg_info *g_auto_link_info;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user