File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,31 @@ void board_init(void)
82
82
neopixel_init ();
83
83
#endif
84
84
85
+ #if ENABLE_DCDC_0 == 1
86
+ NRF_POWER -> DCDCEN0 = 1 ;
87
+ #endif
88
+ #if ENABLE_DCDC_1 == 1
89
+ NRF_POWER -> DCDCEN = 1 ;
90
+ #endif
91
+
92
+ // When board is supplied on VDDH (and not VDD), this specifies what voltage the GPIO should run at
93
+ // and what voltage is output at VDD. The default (0xffffffff) is 1.8V; typically you'll want
94
+ // #define UICR_REGOUT0_VALUE UICR_REGOUT0_VOUT_3V3
95
+ // in board.h when using that power configuration.
96
+ #ifdef UICR_REGOUT0_VALUE
97
+ if (NRF_UICR -> REGOUT0 != UICR_REGOUT0_VALUE )
98
+ {
99
+ NRF_NVMC -> CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos ;
100
+ while (NRF_NVMC -> READY == NVMC_READY_READY_Busy ){}
101
+ NRF_UICR -> REGOUT0 = UICR_REGOUT0_VALUE ;
102
+
103
+ NRF_NVMC -> CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos ;
104
+ while (NRF_NVMC -> READY == NVMC_READY_READY_Busy ){}
105
+
106
+ NVIC_SystemReset ();
107
+ }
108
+ #endif
109
+
85
110
// Init scheduler
86
111
APP_SCHED_INIT (SCHED_MAX_EVENT_DATA_SIZE , SCHED_QUEUE_SIZE );
87
112
Original file line number Diff line number Diff line change 61
61
#define BOARD_RGB_BRIGHTNESS 0x101010
62
62
#endif
63
63
64
+ // Power configuration - should we enable DC/DC converters? (requires inductors on board)
65
+ #ifndef ENABLE_DCDC_0
66
+ #define ENABLE_DCDC_0 0
67
+ #endif
68
+ #ifndef ENABLE_DCDC_1
69
+ #define ENABLE_DCDC_1 0
70
+ #endif
71
+
64
72
// Helper function
65
73
#define memclr (buffer , size ) memset(buffer, 0, size)
66
74
#define varclr (_var ) memclr(_var, sizeof(*(_var)))
You can’t perform that action at this time.
0 commit comments