summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/bouffalolab/inc/FreeRTOSConfig.h24
-rw-r--r--tests/bouffalolab/src/main.c38
-rw-r--r--tests/hpmicro/src/main.c2
-rw-r--r--tests/hpmicro/src/uvc2lcd.c2
4 files changed, 37 insertions, 29 deletions
diff --git a/tests/bouffalolab/inc/FreeRTOSConfig.h b/tests/bouffalolab/inc/FreeRTOSConfig.h
index dd3d55c6..eb7b21d2 100644
--- a/tests/bouffalolab/inc/FreeRTOSConfig.h
+++ b/tests/bouffalolab/inc/FreeRTOSConfig.h
@@ -37,18 +37,18 @@
*
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
-#if defined(BL602) || defined(BL702) || defined(BL702L)
-#define configMTIME_BASE_ADDRESS (0x02000000UL + 0xBFF8UL)
-#define configMTIMECMP_BASE_ADDRESS (0x02000000UL + 0x4000UL)
-#else
-#if __riscv_xlen == 64
-#define configMTIME_BASE_ADDRESS (0)
-#define configMTIMECMP_BASE_ADDRESS ((0xE4000000UL) + 0x4000UL)
-#else
-#define configMTIME_BASE_ADDRESS ((0xE0000000UL) + 0xBFF8UL)
-#define configMTIMECMP_BASE_ADDRESS ((0xE0000000UL) + 0x4000UL)
-#endif
-#endif
+// #if defined(BL602) || defined(BL702) || defined(BL702L)
+// #define configMTIME_BASE_ADDRESS (0x02000000UL + 0xBFF8UL)
+// #define configMTIMECMP_BASE_ADDRESS (0x02000000UL + 0x4000UL)
+// #else
+// #if __riscv_xlen == 64
+// #define configMTIME_BASE_ADDRESS (0)
+// #define configMTIMECMP_BASE_ADDRESS ((0xE4000000UL) + 0x4000UL)
+// #else
+// #define configMTIME_BASE_ADDRESS ((0xE0000000UL) + 0xBFF8UL)
+// #define configMTIMECMP_BASE_ADDRESS ((0xE0000000UL) + 0x4000UL)
+// #endif
+// #endif
#define configSUPPORT_STATIC_ALLOCATION 1
#define configUSE_PREEMPTION 1
diff --git a/tests/bouffalolab/src/main.c b/tests/bouffalolab/src/main.c
index c74d1d8f..70654df4 100644
--- a/tests/bouffalolab/src/main.c
+++ b/tests/bouffalolab/src/main.c
@@ -17,17 +17,11 @@ static struct bflb_device_s *uart0;
extern void shell_init_with_task(struct bflb_device_s *shell);
#ifdef CONFIG_USB_EHCI_ISO
-static ATTR_NOINIT_PSRAM_SECTION USB_MEM_ALIGNX uint8_t frame_buffer1[640 * 480 * 2];
-static ATTR_NOINIT_PSRAM_SECTION USB_MEM_ALIGNX uint8_t frame_buffer2[640 * 480 * 2];
+static ATTR_NOINIT_PSRAM_SECTION USB_MEM_ALIGNX uint8_t frame_buffer[2][640 * 480 * 2];
static struct usbh_videoframe frame_pool[2];
-#define AUDIP_MIC_POOL_SIZE (16)
-static ATTR_NOINIT_PSRAM_SECTION USB_MEM_ALIGNX uint8_t frame_mic_buffer[AUDIO_MIC_EP_MAX_MPS * AUDIO_MIC_ISO_PACKETS * AUDIP_MIC_POOL_SIZE];
-static struct usbh_audioframe frame_mic_pool[AUDIP_MIC_POOL_SIZE];
-
void usbh_video_run(struct usbh_video *video_class)
{
- usbh_video_stream_start(640, 480, USBH_VIDEO_FORMAT_MJPEG);
}
void usbh_video_stop(struct usbh_video *video_class)
@@ -45,13 +39,25 @@ static void usbh_video_frame_thread(void *argument)
if (ret < 0) {
continue;
}
-
USB_LOG_RAW("frame buf:%p,frame len:%d\r\n", frame->frame_buf, frame->frame_size);
-
usbh_video_stream_enqueue(frame);
}
}
+#define AUDIP_MIC_POOL_SIZE (16)
+static ATTR_NOINIT_PSRAM_SECTION USB_MEM_ALIGNX uint8_t frame_mic_buffer[AUDIO_MIC_EP_MAX_MPS * AUDIO_MIC_ISO_PACKETS * AUDIP_MIC_POOL_SIZE];
+static struct usbh_audioframe frame_mic_pool[AUDIP_MIC_POOL_SIZE];
+
+void usbh_audio_run(struct usbh_audio *audio_class)
+{
+ //usbh_audio_mic_stream_start(16000);
+}
+
+void usbh_audio_stop(struct usbh_audio *audio_class)
+{
+ usbh_audio_mic_stream_stop();
+}
+
static void usbh_audio_mic_frame_thread(void *argument)
{
int ret;
@@ -68,6 +74,7 @@ static void usbh_audio_mic_frame_thread(void *argument)
usbh_audio_mic_stream_enqueue(frame);
}
}
+
#endif
int main(void)
@@ -82,16 +89,14 @@ int main(void)
printf("Starting usb host task...\r\n");
#ifdef CONFIG_USB_EHCI_ISO
- frame_pool[0].frame_buf = frame_buffer1;
+ frame_pool[0].frame_buf = frame_buffer[0];
frame_pool[0].frame_bufsize = 640 * 480 * 2;
- frame_pool[1].frame_buf = frame_buffer2;
+ frame_pool[1].frame_buf = frame_buffer[1];
frame_pool[1].frame_bufsize = 640 * 480 * 2;
usbh_video_stream_create(frame_pool, 2);
- usb_osal_thread_create("uvc_frame", 3072, 5, usbh_video_frame_thread, NULL);
- extern void usbh_video_fps_init(void);
- usbh_video_fps_init();
+ usb_osal_thread_create("uvc_frame", 2048, CONFIG_USBHOST_PSC_PRIO - 2, usbh_video_frame_thread, NULL);
for (uint8_t i = 0; i < AUDIP_MIC_POOL_SIZE; i++) {
frame_mic_pool[i].frame_buf = frame_mic_buffer + i * AUDIO_MIC_EP_MAX_MPS * AUDIO_MIC_ISO_PACKETS;
@@ -99,7 +104,10 @@ int main(void)
}
usbh_audio_mic_stream_create(frame_mic_pool, AUDIP_MIC_POOL_SIZE);
- usb_osal_thread_create("uac_mic", 3072, 5, usbh_audio_mic_frame_thread, NULL);
+ usb_osal_thread_create("uac_mic", 2048, CONFIG_USBHOST_PSC_PRIO - 1, usbh_audio_mic_frame_thread, NULL);
+
+ extern void usbh_video_fps_init(void);
+ usbh_video_fps_init();
#endif
vTaskStartScheduler();
diff --git a/tests/hpmicro/src/main.c b/tests/hpmicro/src/main.c
index 7fec12ab..f3b7ce3c 100644
--- a/tests/hpmicro/src/main.c
+++ b/tests/hpmicro/src/main.c
@@ -84,7 +84,7 @@ int main(void)
}
usbh_audio_mic_stream_create(frame_mic_pool, AUDIP_MIC_POOL_SIZE);
- usb_osal_thread_create("uac_mic", 3072, 5, usbh_audio_mic_frame_thread, NULL);
+ usb_osal_thread_create("uac_mic", 2048, CONFIG_USBHOST_PSC_PRIO - 1, usbh_audio_mic_frame_thread, NULL);
#endif
#ifndef CONFIG_USB_OTG_ENABLE
diff --git a/tests/hpmicro/src/uvc2lcd.c b/tests/hpmicro/src/uvc2lcd.c
index b93ec2aa..ab1eadd6 100644
--- a/tests/hpmicro/src/uvc2lcd.c
+++ b/tests/hpmicro/src/uvc2lcd.c
@@ -163,7 +163,7 @@ void uvc2lcd_init(void)
usbh_video_stream_create(frame_pool, 2);
- usb_osal_thread_create("uvc_frame", 3072, 5, usbh_video_frame_thread, NULL);
+ usb_osal_thread_create("uvc_frame", 2048, CONFIG_USBHOST_PSC_PRIO - 2, usbh_video_frame_thread, NULL);
extern void usbh_video_fps_init(void);
usbh_video_fps_init();
} \ No newline at end of file