[fix][examples] modify dma control api

This commit is contained in:
jzlv 2022-03-15 10:46:56 +08:00
parent 50a9091e6d
commit 7ff8f12354
4 changed files with 8 additions and 8 deletions

View File

@ -110,7 +110,7 @@ void ATTR_TCM_SECTION cam_irq_callback(struct device *dev, void *args, uint32_t
}
*/
while (device_control(dma_cam, DMA_CHANNEL_GET_STATUS, NULL)) {
while (dma_channel_check_busy(dma_cam)) {
__asm volatile("nop");
__asm volatile("nop");
}
@ -142,7 +142,7 @@ void ATTR_TCM_SECTION cam_irq_callback(struct device *dev, void *args, uint32_t
}
*/
while (device_control(dma_cam, DMA_CHANNEL_GET_STATUS, NULL)) {
while (dma_channel_check_busy(dma_cam)) {
__asm volatile("nop");
__asm volatile("nop");
}

View File

@ -629,7 +629,7 @@ int main(void)
while (1) {
/* Waiting for record data update */
if (record_updata_flag) {
if (!device_control(dma_ch4_usb_tx, DMA_CHANNEL_GET_STATUS, NULL)) {
if (!dma_channel_check_busy(dma_ch4_usb_tx)) {
device_write(usb_fs, AUDIO_IN_EP, record_data_buff[!record_buff_using_num], BUFF_SIZE);
record_updata_flag = 0;
record_buff_using_num = !record_buff_using_num;
@ -638,7 +638,7 @@ int main(void)
}
if (play_updata_flag) {
device_control(dma_ch2_i2s_tx, DMA_CHANNEL_STOP, NULL);
dma_channel_stop(dma_ch2_i2s_tx);
play_buff_using_num = !play_buff_using_num;
device_write(i2s, 0, play_data_buff[play_buff_using_num], BUFF_SIZE);
play_updata_flag = 0;

View File

@ -763,7 +763,7 @@ int main(void)
MSG("frame_count:%d,last_frame_size:%d\r\n", frame_count, last_frame_size);
music_tx_flag = 1;
}
if (!device_control(dma_ch2, DMA_CHANNEL_GET_STATUS, NULL)) {
if (!dma_channel_check_busy(dma_ch2)) {
if (frame_cnt < frame_count) {
device_write(usb_fs, AUDIO_IN_EP, &music[audio_pos], 4064);
frame_cnt++;

View File

@ -545,7 +545,7 @@ int main(void)
usbd_video_add_interface(&video_class, &video_control_intf);
usbd_video_add_interface(&video_class, &video_stream_intf);
usbd_interface_add_endpoint(&video_stream_intf, &video_in_ep);
usbd_video_set_probe_and_commit_controls(&probe, &commit);
usb_fs = usb_dc_init();
if (usb_fs) {
@ -626,7 +626,7 @@ int main(void)
}
if (packets_cnt < (packets_in_frame - 1)) {
if (!device_control(dma_ch2, DMA_CHANNEL_GET_STATUS, NULL)) {
if (!dma_channel_check_busy(dma_ch2)) {
#ifdef USING_CAMERA
#else
@ -665,7 +665,7 @@ int main(void)
}
}
} else {
if (!device_control(dma_ch2, DMA_CHANNEL_GET_STATUS, NULL)) {
if (!dma_channel_check_busy(dma_ch2)) {
#ifdef USING_CAMERA
#else