diff options
| author | hathach <[email protected]> | 2018-07-26 16:12:09 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-07-26 16:12:09 +0700 |
| commit | 86c445cd71133e2c6c659707845fe6b088b0cf6f (patch) | |
| tree | c0cd3ab8244e2e8d59d1b38cc6e129a550149483 | |
| parent | 20929f2ad9690fc1da0911f9fc231d21c9f1686e (diff) | |
move nrf_drv_usbd_errata to portable folder
| -rw-r--r-- | examples/device/nrf52840/segger/nrf52840.emProject | 1 | ||||
| -rw-r--r-- | src/portable/nordic/nrf5x/hal_nrf5x.c | 48 | ||||
| -rw-r--r-- | src/portable/nordic/nrf5x/nrf_drv_usbd_errata.h (renamed from hw/mcu/nordic/nrf_drv_usbd_errata.h) | 0 |
3 files changed, 1 insertions, 48 deletions
diff --git a/examples/device/nrf52840/segger/nrf52840.emProject b/examples/device/nrf52840/segger/nrf52840.emProject index 7c1ef38d7..571a6bb80 100644 --- a/examples/device/nrf52840/segger/nrf52840.emProject +++ b/examples/device/nrf52840/segger/nrf52840.emProject @@ -97,7 +97,6 @@ <file file_name="../../../../hw/mcu/nordic/nrfx/soc/nrfx_irqs_nrf52840.h" /> </folder> </folder> - <file file_name="../../../../hw/mcu/nordic/nrf_drv_usbd_errata.h" /> <file file_name="../../../../hw/mcu/nordic/nrfx_config.h" /> <file file_name="../../../../hw/mcu/nordic/nrfx_glue.h" /> </folder> diff --git a/src/portable/nordic/nrf5x/hal_nrf5x.c b/src/portable/nordic/nrf5x/hal_nrf5x.c index f04867676..870f8899a 100644 --- a/src/portable/nordic/nrf5x/hal_nrf5x.c +++ b/src/portable/nordic/nrf5x/hal_nrf5x.c @@ -42,6 +42,7 @@ #include "nrf_gpio.h" #include "nrf_clock.h" #include "nrf_usbd.h" +#include "nrf_drv_usbd_errata.h" #ifdef SOFTDEVICE_PRESENT #include "nrf_sdm.h" @@ -64,55 +65,8 @@ enum { *------------------------------------------------------------------*/ #define USB_NVIC_PRIO 7 -/*------------------------------------------------------------------*/ -/* FUNCTION DECLARATION - *------------------------------------------------------------------*/ void tusb_hal_nrf_power_event(uint32_t event); - -/*------------------------------------------------------------------*/ -/* Errata check from nrf_drv_usbd_errata.h - *------------------------------------------------------------------*/ - -/** - * @brief Internal auxiliary function to check if the program is running on NRF52840 chip - * @retval true It is NRF52480 chip - * @retval false It is other chip - */ -static inline bool nrf_drv_usbd_errata_type_52840(void) -{ - return ((((*(uint32_t *)0xF0000FE0) & 0xFF) == 0x08) && - (((*(uint32_t *)0xF0000FE4) & 0x0F) == 0x0)); -} - -/** - * @brief Internal auxiliary function to check if the program is running on first final product of - * NRF52840 chip - * @retval true It is NRF52480 chip and it is first final product - * @retval false It is other chip - */ -static inline bool nrf_drv_usbd_errata_type_52840_fp1(void) -{ - return ( nrf_drv_usbd_errata_type_52840() && - ( ((*(uint32_t *)0xF0000FE8) & 0xF0) == 0x20 ) && - ( ((*(uint32_t *)0xF0000FEC) & 0xF0) == 0x00 ) ); -} - -static inline bool nrf_drv_usbd_errata_166(void) -{ - return true; -} - -static inline bool nrf_drv_usbd_errata_171(void) -{ - return true; -} - -static inline bool nrf_drv_usbd_errata_187(void) -{ - return nrf_drv_usbd_errata_type_52840_fp1(); -} - /*------------------------------------------------------------------*/ /* HFCLK helper *------------------------------------------------------------------*/ diff --git a/hw/mcu/nordic/nrf_drv_usbd_errata.h b/src/portable/nordic/nrf5x/nrf_drv_usbd_errata.h index f8c554f08..f8c554f08 100644 --- a/hw/mcu/nordic/nrf_drv_usbd_errata.h +++ b/src/portable/nordic/nrf5x/nrf_drv_usbd_errata.h |
