summaryrefslogtreecommitdiff
path: root/tinyusb
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-04-12 13:14:59 +0700
committerhathach <[email protected]>2018-04-12 13:14:59 +0700
commit08a24ee2246dee6701d1bf074e3f307215379a91 (patch)
treee80b8c3d0181abdbe94e423bb210e14a11d4ea48 /tinyusb
parente1272159d8b32e2f5478b35fa0e727cfc5c417e3 (diff)
refactor nrf5x mcu macro
Diffstat (limited to 'tinyusb')
-rw-r--r--tinyusb/class/cdc/cdc_device.c2
-rw-r--r--tinyusb/device/usbd.c2
-rw-r--r--tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c4
-rw-r--r--tinyusb/portable/nordic/nrf5x/hal_nrf5x.c4
-rw-r--r--tinyusb/tusb_option.h1
5 files changed, 8 insertions, 5 deletions
diff --git a/tinyusb/class/cdc/cdc_device.c b/tinyusb/class/cdc/cdc_device.c
index da38b15fe..c0a5ff6cf 100644
--- a/tinyusb/class/cdc/cdc_device.c
+++ b/tinyusb/class/cdc/cdc_device.c
@@ -66,7 +66,7 @@ typedef struct {
}cdcd_data_t;
// TODO multiple rhport
-#ifdef NRF52840_XXAA
+#if CFG_TUSB_MCU == OPT_MCU_NRF5X
// FIXME nrf52 OUT bug ( Controller ACK data even we didn't prepare transfer )
CFG_TUSB_ATTR_USBRAM CFG_TUSB_MEM_ALIGN uint8_t _tmp_rx_buf[1024];
#else
diff --git a/tinyusb/device/usbd.c b/tinyusb/device/usbd.c
index a1886b9b4..c11d1fe42 100644
--- a/tinyusb/device/usbd.c
+++ b/tinyusb/device/usbd.c
@@ -344,7 +344,7 @@ static tusb_error_t proc_control_request_st(uint8_t rhport, tusb_control_request
dcd_set_address(rhport, (uint8_t) p_request->wValue);
usbd_devices[rhport].state = TUSB_DEVICE_STATE_ADDRESSED;
- #ifndef NRF52840_XXAA // nrf52 auto handle set address, we must not return status
+ #if CFG_TUSB_MCU != OPT_MCU_NRF5X // nrf5x auto handle set address, we must not return status
dcd_control_status(rhport, p_request->bmRequestType_bit.direction);
#endif
}
diff --git a/tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c b/tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c
index 072086b38..2f7d97172 100644
--- a/tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c
+++ b/tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c
@@ -34,7 +34,9 @@
*/
/**************************************************************************/
-#ifdef NRF52840_XXAA
+#include "tusb_option.h"
+
+#if MODE_DEVICE_SUPPORTED && CFG_TUSB_MCU == OPT_MCU_NRF5X
// TODO remove
#include "nrf.h"
diff --git a/tinyusb/portable/nordic/nrf5x/hal_nrf5x.c b/tinyusb/portable/nordic/nrf5x/hal_nrf5x.c
index 473ebf138..47ce9f945 100644
--- a/tinyusb/portable/nordic/nrf5x/hal_nrf5x.c
+++ b/tinyusb/portable/nordic/nrf5x/hal_nrf5x.c
@@ -34,7 +34,9 @@
*/
/**************************************************************************/
-#ifdef NRF52840_XXAA
+#include "tusb_option.h"
+
+#if MODE_DEVICE_SUPPORTED && CFG_TUSB_MCU == OPT_MCU_NRF5X
#include <stdbool.h>
#include "nrf.h"
diff --git a/tinyusb/tusb_option.h b/tinyusb/tusb_option.h
index 6d0156ee1..62b3a1a72 100644
--- a/tinyusb/tusb_option.h
+++ b/tinyusb/tusb_option.h
@@ -45,7 +45,6 @@
#define TUSB_VERSION_NAME "alpha"
#define TUSB_VERSION XSTRING_(TUSB_VERSION_YEAR) "." XSTRING_(TUSB_VERSION_MONTH)
-// TODO remove, use vendor specific flag
/** \defgroup group_mcu Supported MCU
* \ref CFG_TUSB_MCU must be defined to one of these
* @{ */