diff options
| author | hathach <[email protected]> | 2018-11-29 21:41:09 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-11-29 21:41:09 +0700 |
| commit | 57b85262b21333b3fe59f8abaeddda59c86b808b (patch) | |
| tree | 4443ddb0fd7e0bc7197f7f9a101b4f3494731388 /src | |
| parent | 15e4b97e363280f646732a4f4b8ead82d67561fb (diff) | |
added & tested lpc17xx freertos device example
- add USB priority check for freeRTOS config
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/nxp/lpc17xx/dcd_lpc175x_6x.c | 12 | ||||
| -rw-r--r-- | src/portable/nxp/lpc17xx/hal_lpc175x_6x.c | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/portable/nxp/lpc17xx/dcd_lpc175x_6x.c b/src/portable/nxp/lpc17xx/dcd_lpc175x_6x.c index 562bc33aa..517f037d0 100644 --- a/src/portable/nxp/lpc17xx/dcd_lpc175x_6x.c +++ b/src/portable/nxp/lpc17xx/dcd_lpc175x_6x.c @@ -44,6 +44,8 @@ #include "dcd_lpc175x_6x.h"
#include "LPC17xx.h"
+#include "osal/osal.h"
+
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
@@ -196,6 +198,16 @@ bool dcd_init(uint8_t rhport) sie_write(SIE_CMDCODE_DEVICE_STATUS, 1, 1); // connect
+ // USB IRQ priority should be set by application previously
+ // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
+#if CFG_TUSB_OS == OPT_OS_FREERTOS
+ if ( NVIC_GetPriority(USB_IRQn) < configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY )
+ {
+ NVIC_SetPriority(USB_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
+ }
+#endif
+
+ NVIC_ClearPendingIRQ(USB_IRQn);
NVIC_EnableIRQ(USB_IRQn);
return TUSB_ERROR_NONE;
diff --git a/src/portable/nxp/lpc17xx/hal_lpc175x_6x.c b/src/portable/nxp/lpc17xx/hal_lpc175x_6x.c index cfe392e46..13cb178f2 100644 --- a/src/portable/nxp/lpc17xx/hal_lpc175x_6x.c +++ b/src/portable/nxp/lpc17xx/hal_lpc175x_6x.c @@ -41,6 +41,7 @@ #if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X
#include "LPC17xx.h"
+#include "lpc17xx_pinsel.h"
void tusb_hal_int_enable(uint8_t rhport)
{
|
