Files
CherryUSB/tests/espressif/host/main/main.c
2025-12-15 20:53:45 +08:00

38 lines
861 B
C

/*
* SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: CC0-1.0
*/
#include <stdio.h>
#include <inttypes.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_netif.h"
#include "esp_event.h"
#include "esp_log.h"
#include "usbd_core.h"
#include "usbh_core.h"
#define CONFIG_TEST_USBH_SERIAL
#define CONFIG_TEST_USBH_HID
#include "demo/usb_host.c"
void app_main(void)
{
USB_LOG_INFO("Hello CherryUSB!\n");
// Initialize TCP/IP network interface aka the esp-netif (should be called only once in application)
ESP_ERROR_CHECK(esp_netif_init());
// Create default event loop that running in background
ESP_ERROR_CHECK(esp_event_loop_create_default());
usbh_initialize(0, 0x60080000, NULL);
while(1)
{
vTaskDelay(10);
}
}