File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/portable/nordic/nrf5x Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 38
38
#include "device/usbd.h"
39
39
#include "device/usbd_pvt.h" // to use defer function helper
40
40
41
+ #if CFG_TUSB_OS == OPT_OS_MYNEWT
42
+ #include "mcu/mcu.h"
43
+ #endif
44
+
41
45
/*------------------------------------------------------------------*/
42
46
/* MACRO TYPEDEF CONSTANT ENUM
43
47
*------------------------------------------------------------------*/
@@ -891,6 +895,11 @@ static bool hfclk_running(void)
891
895
892
896
static void hfclk_enable (void )
893
897
{
898
+ #if CFG_TUSB_OS == OPT_OS_MYNEWT
899
+ usb_clock_request ();
900
+ return ;
901
+ #else
902
+
894
903
// already running, nothing to do
895
904
if ( hfclk_running () ) return ;
896
905
@@ -904,10 +913,16 @@ static void hfclk_enable(void)
904
913
905
914
nrf_clock_event_clear (NRF_CLOCK , NRF_CLOCK_EVENT_HFCLKSTARTED );
906
915
nrf_clock_task_trigger (NRF_CLOCK , NRF_CLOCK_TASK_HFCLKSTART );
916
+ #endif
907
917
}
908
918
909
919
static void hfclk_disable (void )
910
920
{
921
+ #if CFG_TUSB_OS == OPT_OS_MYNEWT
922
+ usb_clock_release ();
923
+ return ;
924
+ #else
925
+
911
926
#ifdef SOFTDEVICE_PRESENT
912
927
if ( is_sd_enabled () )
913
928
{
@@ -917,6 +932,7 @@ static void hfclk_disable(void)
917
932
#endif
918
933
919
934
nrf_clock_task_trigger (NRF_CLOCK , NRF_CLOCK_TASK_HFCLKSTOP );
935
+ #endif
920
936
}
921
937
922
938
// Power & Clock Peripheral on nRF5x to manage USB
You can’t perform that action at this time.
0 commit comments