diff options
Diffstat (limited to 'stm/main.c')
-rw-r--r-- | stm/main.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/stm/main.c b/stm/main.c index b7d201cf02..5e2a3966d2 100644 --- a/stm/main.c +++ b/stm/main.c @@ -602,6 +602,27 @@ int main(void) { GPIO_Init(GPIOD, &GPIO_InitStructure); } #endif +#if defined(NETDUINO_PLUS_2) + { + GPIO_InitTypeDef GPIO_InitStructure; + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; + GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; + GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; + +#if MICROPY_HW_HAS_SDCARD + // Turn on the power enable for the sdcard (PB1) + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1; + GPIO_Init(GPIOB, &GPIO_InitStructure); + GPIO_WriteBit(GPIOB, GPIO_Pin_1, Bit_SET); +#endif + + // Turn on the power for the 5V on the expansion header (PB2) + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; + GPIO_Init(GPIOB, &GPIO_InitStructure); + GPIO_WriteBit(GPIOB, GPIO_Pin_2, Bit_SET); + } +#endif // basic sub-system init sys_tick_init(); |