diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-22 11:56:24 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-22 11:56:24 +0000 |
commit | 8ae1c1beacc56d440b2cc1e4bd010b100ad4fdd0 (patch) | |
tree | 89f873e8bb5f53e95edf51eaad8aadf064d9292d /stm/main.c | |
parent | e6a4ab4be1e01797b1df410a0643aadb9ae13f26 (diff) | |
parent | 72a31162e9c05cee48d8e48f3fa44588e4cb49e9 (diff) | |
download | micropython-8ae1c1beacc56d440b2cc1e4bd010b100ad4fdd0.tar.gz micropython-8ae1c1beacc56d440b2cc1e4bd010b100ad4fdd0.zip |
Merge branch 'fix-stm-discovery' of github.com:dhylands/micropython into dhylands-fix-stm-discovery
Conflicts:
stm/main.c
Diffstat (limited to 'stm/main.c')
-rw-r--r-- | stm/main.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/stm/main.c b/stm/main.c index 1bf8fc18ae..990450202b 100644 --- a/stm/main.c +++ b/stm/main.c @@ -715,7 +715,11 @@ int main(void) { NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4); // enable the CCM RAM and the GPIO's - RCC->AHB1ENR |= RCC_AHB1ENR_CCMDATARAMEN | RCC_AHB1ENR_GPIOAEN | RCC_AHB1ENR_GPIOBEN | RCC_AHB1ENR_GPIOCEN; + RCC->AHB1ENR |= RCC_AHB1ENR_CCMDATARAMEN | RCC_AHB1ENR_GPIOAEN | RCC_AHB1ENR_GPIOBEN | RCC_AHB1ENR_GPIOCEN +#if defined(STM32F4DISC) + | RCC_AHB1ENR_GPIODEN +#endif + ; // configure SDIO pins to be high to start with (apparently makes it more robust) { @@ -794,9 +798,11 @@ soft_reset: rt_store_attr(m, MP_QSTR_switch, (mp_obj_t)&pyb_switch_obj); rt_store_attr(m, MP_QSTR_servo, rt_make_function_n(2, pyb_servo_set)); rt_store_attr(m, MP_QSTR_pwm, rt_make_function_n(2, pyb_pwm_set)); +#if BOARD_HAS_MMA7660 rt_store_attr(m, MP_QSTR_accel, (mp_obj_t)&pyb_mma_read_obj); rt_store_attr(m, MP_QSTR_mma_read, (mp_obj_t)&pyb_mma_read_all_obj); rt_store_attr(m, MP_QSTR_mma_mode, (mp_obj_t)&pyb_mma_write_mode_obj); +#endif rt_store_attr(m, MP_QSTR_hid, rt_make_function_n(1, pyb_hid_send_report)); rt_store_attr(m, MP_QSTR_time, rt_make_function_n(0, pyb_rtc_read)); rt_store_attr(m, MP_QSTR_rand, rt_make_function_n(0, pyb_rng_get)); @@ -911,10 +917,11 @@ soft_reset: // USB host; not working! //pyb_usbh_init(); - // MMA if (first_soft_reset) { - // init and reset address to zero +#if BOARD_HAS_MMA7660 + // MMA: init and reset address to zero mma_init(); +#endif } // turn boot-up LED off @@ -941,6 +948,8 @@ soft_reset: vstr_free(vstr); } + +#if BOARD_HAS_MMA7660 // HID example if (0) { uint8_t data[4]; @@ -969,6 +978,7 @@ soft_reset: sys_tick_delay_ms(15); } } +#endif // wifi //pyb_wlan_init(); |