mirror of
https://github.com/espressif/openthread.git
synced 2026-07-27 14:27:47 +00:00
[nrf52840] signal event in usb cdc (#3715)
This commit is contained in:
committed by
Jonathan Hui
parent
81fd8a8b10
commit
88912d23ae
@@ -44,6 +44,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <common/logging.hpp>
|
||||
#include <openthread-system.h>
|
||||
#include <utils/code_utils.h>
|
||||
#include <openthread/platform/alarm-milli.h>
|
||||
#include <openthread/platform/diag.h>
|
||||
@@ -125,6 +126,14 @@ static void cdcAcmUserEventHandler(app_usbd_class_inst_t const *aCdcAcmInstance,
|
||||
}
|
||||
}
|
||||
|
||||
static void usbdIsrHandler(app_usbd_internal_evt_t const *const aEvent, bool aQueued)
|
||||
{
|
||||
(void)aEvent;
|
||||
(void)aQueued;
|
||||
|
||||
otSysEventSignalPending();
|
||||
}
|
||||
|
||||
static void usbdUserEventHandler(app_usbd_event_type_t aEvent)
|
||||
{
|
||||
switch (aEvent)
|
||||
@@ -253,7 +262,10 @@ static void processTransmit(void)
|
||||
|
||||
void nrf5UartInit(void)
|
||||
{
|
||||
static const app_usbd_config_t usbdConfig = {.ev_state_proc = usbdUserEventHandler};
|
||||
static const app_usbd_config_t usbdConfig = {
|
||||
.ev_state_proc = usbdUserEventHandler,
|
||||
.ev_isr_handler = usbdIsrHandler,
|
||||
};
|
||||
|
||||
memset((void *)&sUsbState, 0, sizeof(sUsbState));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user