summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-03-05 05:45:42 -0800
committerGitHub <[email protected]>2019-03-05 05:45:42 -0800
commit8418cb816bbc0b760c102921875016a8ba31167d (patch)
treec9c0e1718779d889aaa47979f3c5b3c4d423297b /src/portable
parent49aa6ec2516eddb2202c82a415b89be919bf1dd1 (diff)
parenta19455d1ff2581b07b1ace00f5a2820165bd8e98 (diff)
Merge branch 'master' into stm32f4
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/microchip/samd21/dcd_samd21.c2
-rw-r--r--src/portable/nordic/nrf5x/hal_nrf5x.c14
2 files changed, 3 insertions, 13 deletions
diff --git a/src/portable/microchip/samd21/dcd_samd21.c b/src/portable/microchip/samd21/dcd_samd21.c
index 7b2a57eeb..6140812bc 100644
--- a/src/portable/microchip/samd21/dcd_samd21.c
+++ b/src/portable/microchip/samd21/dcd_samd21.c
@@ -296,7 +296,7 @@ void maybe_transfer_complete(void) {
uint32_t epintflag = ep->EPINTFLAG.reg;
- uint16_t total_transfer_size;
+ uint16_t total_transfer_size = 0;
// Handle IN completions
if ((epintflag & USB_DEVICE_EPINTFLAG_TRCPT1) != 0) {
diff --git a/src/portable/nordic/nrf5x/hal_nrf5x.c b/src/portable/nordic/nrf5x/hal_nrf5x.c
index f0a0b9632..52743ce6f 100644
--- a/src/portable/nordic/nrf5x/hal_nrf5x.c
+++ b/src/portable/nordic/nrf5x/hal_nrf5x.c
@@ -49,16 +49,9 @@
#ifdef SOFTDEVICE_PRESENT
#include "nrf_sdm.h"
#include "nrf_soc.h"
+#endif
-// TODO fully move to nrfx
-enum {
- NRFX_POWER_USB_EVT_DETECTED, /**< USB power detected on the connector (plugged in). */
- NRFX_POWER_USB_EVT_REMOVED, /**< USB power removed from the connector. */
- NRFX_POWER_USB_EVT_READY /**< USB power regulator ready. */
-};
-#else
#include "nrfx_power.h"
-#endif
#include "tusb_hal.h"
#include "device/dcd.h"
@@ -66,8 +59,6 @@ enum {
/*------------------------------------------------------------------*/
/* MACRO TYPEDEF CONSTANT ENUM
*------------------------------------------------------------------*/
-#define USB_NVIC_PRIO 7
-
void tusb_hal_nrf_power_event(uint32_t event);
/*------------------------------------------------------------------*/
@@ -239,8 +230,7 @@ void tusb_hal_nrf_power_event (uint32_t event)
NRF_USBD->INTENSET = USBD_INTEN_USBRESET_Msk | USBD_INTEN_USBEVENT_Msk | USBD_INTEN_EPDATA_Msk |
USBD_INTEN_EP0SETUP_Msk | USBD_INTEN_EP0DATADONE_Msk | USBD_INTEN_ENDEPIN0_Msk | USBD_INTEN_ENDEPOUT0_Msk;
- // Enable interrupt, Priorities 0,1,4,5 (nRF52) are reserved for SoftDevice
- NVIC_SetPriority(USBD_IRQn, USB_NVIC_PRIO);
+ // Enable interrupt, priorities should be set by application
NVIC_ClearPendingIRQ(USBD_IRQn);
NVIC_EnableIRQ(USBD_IRQn);