nrfx power

This commit is contained in:
hathach
2018-08-07 13:33:44 +07:00
parent 2847b319f2
commit c1c43b3c83
3 changed files with 13 additions and 20 deletions

View File

@ -34,6 +34,9 @@
*/
/**************************************************************************/
#include "nrfx.h"
#include "nrfx_power.h"
#ifdef SOFTDEVICE_PRESENT
#include "nrf_sdm.h"
#include "nrf_soc.h"
@ -42,13 +45,6 @@
#include "nrf_usbd.h"
#include "tusb.h"
// 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. */
};
//--------------------------------------------------------------------+
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
//--------------------------------------------------------------------+
@ -78,7 +74,6 @@ void usb_init(void)
}else
#endif
{
#if 0 // TODO enable
// Power module init
const nrfx_power_config_t pwr_cfg = { 0 };
nrfx_power_init(&pwr_cfg);
@ -90,7 +85,6 @@ void usb_init(void)
nrfx_power_usbevt_enable();
usb_reg = NRF_POWER->USBREGSTATUS;
#endif
}
if ( usb_reg & POWER_USBREGSTATUS_VBUSDETECT_Msk ) {