The nRF52840 USBD peripheral uses EVENTS registers to signal reasons for entering the USBD event handler. To complete the USB enumeration process, your application must check these registers and respond to the specific events.
In the provided starter code (firmware/src/bin/usb-1.rs), the main task is bound to the USBD interrupt signal. It uses usbd::next_event() to poll the event registers. If an event has occurred, next_event() returns Some(Event), where Event is an enum representing the specific USB event. This event is then passed to the on_event function for processing.
// Conceptual flow in firmware/src/bin/usb-1.rs
// The main task is bound to the USBD interrupt
// It calls usbd::next_event() to retrieve the event
if let Some(event) = usbd::next_event() {
on_event(event);
}