summaryrefslogtreecommitdiff
path: root/tests/espressif/host/main/main.c
blob: e67052f63f8831c23411525b0f2dfc28efbb4de5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * 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);
    }
}