diff options
author | Damien George <damien.p.george@gmail.com> | 2014-02-04 14:11:32 -0800 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-02-04 14:11:32 -0800 |
commit | e0723497b3dbce94e6ce2a2dcd59af510f094fa4 (patch) | |
tree | 982b1bffa524add87b76d4fe1fd7344f05a490ee /stm/main.c | |
parent | e5a15cb7a5a548e6e38cd82661af181fda038206 (diff) | |
parent | 1570a96cad0b886f21a07eb13c3377a0f79abc1e (diff) | |
download | micropython-e0723497b3dbce94e6ce2a2dcd59af510f094fa4.tar.gz micropython-e0723497b3dbce94e6ce2a2dcd59af510f094fa4.zip |
Merge pull request #259 from dhylands/netduino
Initial support for Netduino
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(); |