examples: Fixes for new USB driver which does not use SYS.
This commit is contained in:
@@ -669,9 +669,7 @@ tty_main (void *arg)
|
|||||||
if (usb_intr.ready)
|
if (usb_intr.ready)
|
||||||
{
|
{
|
||||||
uint8_t ep_num;
|
uint8_t ep_num;
|
||||||
#if defined(OLDER_SYS_H)
|
|
||||||
event_handle:
|
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
* When interrupt is detected, call usb_lld_event_handler.
|
* When interrupt is detected, call usb_lld_event_handler.
|
||||||
* The event may be one of following:
|
* The event may be one of following:
|
||||||
|
|||||||
@@ -672,24 +672,8 @@ tty_main (void *arg)
|
|||||||
struct usb_dev dev;
|
struct usb_dev dev;
|
||||||
int e;
|
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);
|
chopstx_claim_irq (&usb_intr, INTR_REQ_USB);
|
||||||
usb_lld_init (&dev, VCOM_FEATURE_BUS_POWERED);
|
usb_lld_init (&dev, VCOM_FEATURE_BUS_POWERED);
|
||||||
#endif
|
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
@@ -697,9 +681,7 @@ tty_main (void *arg)
|
|||||||
if (usb_intr.ready)
|
if (usb_intr.ready)
|
||||||
{
|
{
|
||||||
uint8_t ep_num;
|
uint8_t ep_num;
|
||||||
#if defined(OLDER_SYS_H)
|
|
||||||
event_handle:
|
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
* When interrupt is detected, call usb_lld_event_handler.
|
* When interrupt is detected, call usb_lld_event_handler.
|
||||||
* The event may be one of following:
|
* The event may be one of following:
|
||||||
|
|||||||
@@ -173,7 +173,6 @@ usb_main (void *arg)
|
|||||||
(void)arg;
|
(void)arg;
|
||||||
chopstx_claim_irq (&interrupt, INTR_REQ_USB);
|
chopstx_claim_irq (&interrupt, INTR_REQ_USB);
|
||||||
usb_lld_init (&dev, FEATURE_BUS_POWERED);
|
usb_lld_init (&dev, FEATURE_BUS_POWERED);
|
||||||
goto event_handle; /* For old SYS < 3.0 */
|
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
@@ -183,7 +182,6 @@ usb_main (void *arg)
|
|||||||
{
|
{
|
||||||
uint8_t ep_num;
|
uint8_t ep_num;
|
||||||
|
|
||||||
event_handle:
|
|
||||||
e = usb_lld_event_handler (&dev);
|
e = usb_lld_event_handler (&dev);
|
||||||
chopstx_intr_done (&interrupt);
|
chopstx_intr_done (&interrupt);
|
||||||
ep_num = USB_EVENT_ENDP (e);
|
ep_num = USB_EVENT_ENDP (e);
|
||||||
|
|||||||
@@ -657,24 +657,8 @@ tty_main (void *arg)
|
|||||||
struct usb_dev dev;
|
struct usb_dev dev;
|
||||||
int e;
|
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);
|
chopstx_claim_irq (&usb_intr, INTR_REQ_USB);
|
||||||
usb_lld_init (&dev, VCOM_FEATURE_BUS_POWERED);
|
usb_lld_init (&dev, VCOM_FEATURE_BUS_POWERED);
|
||||||
#endif
|
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
@@ -685,9 +669,7 @@ tty_main (void *arg)
|
|||||||
if (usb_intr.ready)
|
if (usb_intr.ready)
|
||||||
{
|
{
|
||||||
uint8_t ep_num;
|
uint8_t ep_num;
|
||||||
#if defined(OLDER_SYS_H)
|
|
||||||
event_handle:
|
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
* When interrupt is detected, call usb_lld_event_handler.
|
* When interrupt is detected, call usb_lld_event_handler.
|
||||||
* The event may be one of following:
|
* The event may be one of following:
|
||||||
|
|||||||
@@ -722,24 +722,8 @@ cdc_main (void *arg)
|
|||||||
|
|
||||||
(void)arg;
|
(void)arg;
|
||||||
|
|
||||||
#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);
|
chopstx_claim_irq (&usb_intr, INTR_REQ_USB);
|
||||||
usb_lld_init (&dev, VCOM_FEATURE_BUS_POWERED);
|
usb_lld_init (&dev, VCOM_FEATURE_BUS_POWERED);
|
||||||
#endif
|
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
@@ -747,9 +731,7 @@ cdc_main (void *arg)
|
|||||||
if (usb_intr.ready)
|
if (usb_intr.ready)
|
||||||
{
|
{
|
||||||
uint8_t ep_num;
|
uint8_t ep_num;
|
||||||
#if defined(OLDER_SYS_H)
|
|
||||||
event_handle:
|
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
* When interrupt is detected, call usb_lld_event_handler.
|
* When interrupt is detected, call usb_lld_event_handler.
|
||||||
* The event may be one of following:
|
* The event may be one of following:
|
||||||
|
|||||||
Reference in New Issue
Block a user