nrf5x usb init before sd works

This commit is contained in:
hathach 2019-01-29 15:39:47 +07:00
parent d8b361fdaa
commit c81b56eb45
No known key found for this signature in database
GPG Key ID: 2FA891220FBFD581
3 changed files with 17 additions and 3 deletions

View File

@ -0,0 +1,5 @@
<!DOCTYPE Board_Memory_Definition_File>
<root name="nRF52840_xxAA_s140v6">
<MemorySegment name="FLASH" start="0x00026000" size="0x000C7000" access="ReadOnly" />
<MemorySegment name="RAM" start="0x20004000" size="0x0003C000" access="Read/Write" />
</root>

View File

@ -116,7 +116,7 @@
<configuration
Name="pca10056 s140v6"
build_treat_warnings_as_errors="No"
c_preprocessor_definitions="SOFTDEVICE_PRESENT"
c_preprocessor_definitions="SOFTDEVICE_PRESENT;S140;NO_VTOR_CONFIG"
c_user_include_directories="$(nrfxDir)/../nrf5x/s140_nrf52_6.1.1_API/include;$(nrfxDir)/../nrf5x/s140_nrf52_6.1.1_API/include/nrf52"
linker_memory_map_file="nRF52840_xxAA_s140v6_MemoryMap.xml" />
</project>

View File

@ -198,7 +198,7 @@ void board_init(void)
sd_power_usbregstatus_get(&usb_reg);
}else
#else
#endif
{
// Power module init
const nrfx_power_config_t pwr_cfg = { 0 };
@ -212,7 +212,6 @@ void board_init(void)
usb_reg = NRF_POWER->USBREGSTATUS;
}
#endif
if ( usb_reg & POWER_USBREGSTATUS_VBUSDETECT_Msk ) {
tusb_hal_nrf_power_event(NRFX_POWER_USB_EVT_DETECTED);
@ -251,4 +250,14 @@ void board_uart_putchar(uint8_t c)
(void) c;
}
#ifdef SOFTDEVICE_PRESENT
void SD_EVT_IRQHandler(void)
{
}
void SVC_Handler( void )
{
}
#endif
#endif