examples: Fixes for new USB driver which does not use SYS.

This commit is contained in:
NIIBE Yutaka
2019-05-16 11:43:08 +09:00
parent 4f46af7557
commit 128cd508b6
5 changed files with 4 additions and 62 deletions

View File

@@ -672,24 +672,8 @@ tty_main (void *arg)
struct usb_dev dev;
int e;
#if defined(OLDER_SYS_H)
/*
* Historically (before sys < 3.0), NVIC priority setting for USB
* interrupt was done in usb_lld_sys_init for free standing
* application. Thus this compatibility code.
*
* We can't call usb_lld_init after chopstx_claim_irq, as
* usb_lld_init does its own setting for NVIC, which is incompatible
* to Chopstx's interrupt handling. Calling chopstx_claim_irq after
* usb_lld_init overrides that for Chopstx.
*
*/
usb_lld_init (&dev, VCOM_FEATURE_BUS_POWERED);
chopstx_claim_irq (&usb_intr, INTR_REQ_USB);
#else
chopstx_claim_irq (&usb_intr, INTR_REQ_USB);
usb_lld_init (&dev, VCOM_FEATURE_BUS_POWERED);
#endif
while (1)
{
@@ -697,9 +681,7 @@ tty_main (void *arg)
if (usb_intr.ready)
{
uint8_t ep_num;
#if defined(OLDER_SYS_H)
event_handle:
#endif
/*
* When interrupt is detected, call usb_lld_event_handler.
* The event may be one of following: