WIP: System Events

This commit is contained in:
Joe Kearney 2025-11-22 14:18:35 -06:00
parent 1c2f281579
commit c979c38fd7
46 changed files with 647 additions and 470 deletions

View file

@ -22,6 +22,7 @@
// From https://github.com/espressif/esp-idf/blob/master/examples/peripherals/usb/host/msc/main/msc_example_main.c
#include <SystemK.h>
#include <System_Events.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@ -262,13 +263,11 @@ static void usb_host_task(void *args)
if (usb_host_device_free_all() == ESP_OK)
{
KLOG_INFO(TAG, "USB_HOST_LIB_EVENT_FLAGS_NO_CLIENTS");
// break;
};
}
if (event_flags & USB_HOST_LIB_EVENT_FLAGS_ALL_FREE)
{
KLOG_INFO(TAG, "USB_HOST_LIB_EVENT_FLAGS_ALL_FREE");
// break;
}
}
}
@ -356,6 +355,7 @@ static void app_usb_task(void *args)
else
{
Current_State = USB_STATE_VFS_REGISTERED;
xEventGroupSetBits(Get_System_Events(), SYS_USB_FS_PRESENT);
xSemaphoreGive(init_complete);
}
}
@ -371,6 +371,7 @@ static void app_usb_task(void *args)
if (msg.id == USB_DEVICE_DISCONNECTED)
{
Current_State = USB_STATE_PROCESSING_DISCONNECTION;
xEventGroupClearBits(Get_System_Events(), SYS_USB_FS_PRESENT);
}
}
vTaskDelay(pdMS_TO_TICKS(1000));