提交 d568d9bc 编写于 作者: CharlesGuo11's avatar CharlesGuo11

最新AED(BOX)代码,剩图片传输

上级 af93726f
......@@ -118,15 +118,13 @@ static esp_err_t play_mp3(const char *path)
unsigned char *read_ptr = read_buf;
do {
/* Process audio event sent from other task */
printf("start\n");
if (pdPASS == xQueueReceive(audio_event_queue, &audio_event, 0)) {
if (AUDIO_EVENT_PAUSE == audio_event) {
printf("start_ok\n");
g_player_state = PLAYER_STATE_PAUSE;
i2s_zero_dma_buffer(I2S_NUM_0);
xQueuePeek(audio_event_queue, &audio_event, portMAX_DELAY);
goto clean_up;
//continue;
//goto clean_up;
continue;
}
if (AUDIO_EVENT_CHANGE == audio_event ||
......@@ -150,7 +148,6 @@ static esp_err_t play_mp3(const char *path)
/* Find MP3 sync word from read buffer */
int offset = MP3FindSyncWord(read_buf, MAINBUF_SIZE);
printf("nooooo");
if (offset >= 0) {
read_ptr += offset; /*!< Data start point */
......@@ -160,7 +157,6 @@ static esp_err_t play_mp3(const char *path)
/* Get MP3 frame info and configure I2S clock */
MP3GetLastFrameInfo(mp3_decoder, &frame_info);
printf("not");
/* Configure I2S clock if sample rate changed. Always reconfigure at first frame */
if (sample_rate != frame_info.samprate ||
......@@ -176,7 +172,6 @@ static esp_err_t play_mp3(const char *path)
}
/* Write decoded data to audio decoder */
printf("not ok");
size_t i2s_bytes_written = 0;
size_t output_size = frame_info.outputSamps * nChans;
i2s_write(I2S_NUM_0, output, output_size, &i2s_bytes_written, portMAX_DELAY);
......
......@@ -279,6 +279,14 @@ void picture_ctrl_start(void)//heart help -> picture
lv_obj_set_style_text_color(lab_btn_text, lv_color_make(158, 158, 158), LV_STATE_DEFAULT);
lv_obj_center(lab_btn_text);
lv_obj_add_event_cb(btn_return, ui_dev_ctrl_page_return_click_cb, LV_EVENT_CLICKED, page);//return event
//image display
lv_obj_t *img = lv_img_create(page);
const char *file_name_with_path = "S:/spiffs/picture.jpg";
if (NULL != file_name_with_path)
{
lv_img_set_src(img, file_name_with_path);
lv_obj_align(img, LV_ALIGN_CENTER, 80, 0);
ESP_LOGI(TAG, "Display image file : %s", file_name_with_path);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册