main.c 798 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: CC0-1.0
  5. */
  6. #include <stdio.h>
  7. #include <inttypes.h>
  8. #include "sdkconfig.h"
  9. #include "freertos/FreeRTOS.h"
  10. #include "freertos/task.h"
  11. #include "esp_netif.h"
  12. #include "esp_event.h"
  13. #include "esp_log.h"
  14. #include "usbd_core.h"
  15. #include "usbh_core.h"
  16. #include "demo/usb_host.c"
  17. void app_main(void)
  18. {
  19. USB_LOG_INFO("Hello CherryUSB!\n");
  20. // Initialize TCP/IP network interface aka the esp-netif (should be called only once in application)
  21. ESP_ERROR_CHECK(esp_netif_init());
  22. // Create default event loop that running in background
  23. ESP_ERROR_CHECK(esp_event_loop_create_default());
  24. usbh_initialize(0, 0x60080000, NULL);
  25. while(1)
  26. {
  27. vTaskDelay(10);
  28. }
  29. }