Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
30216325
Commit
30216325
authored
Mar 25, 2014
by
Damien George
Browse files
stmhal: Shuffle around some init functions in main().
parent
6cfda308
Changes
3
Hide whitespace changes
Inline
Side-by-side
stmhal/accel.h
View file @
30216325
extern
I2C_HandleTypeDef
I2cHandle
;
extern
const
mp_obj_type_t
pyb_accel_type
;
void
accel_init
(
void
);
stmhal/main.c
View file @
30216325
...
...
@@ -26,12 +26,12 @@
#include
"exti.h"
#include
"usrsw.h"
#include
"usb.h"
#include
"rng.h"
#include
"rtc.h"
#include
"storage.h"
#include
"sdcard.h"
#include
"ff.h"
#include
"lcd.h"
#include
"rng.h"
#include
"i2c.h"
#include
"accel.h"
#include
"servo.h"
...
...
@@ -221,28 +221,6 @@ soft_reset:
lcd_init
();
#endif
#if MICROPY_HW_ENABLE_RNG
// RNG
rng_init
();
#endif
#if MICROPY_HW_ENABLE_SERVO
// servo
servo_init
();
#endif
#if 0
#if MICROPY_HW_ENABLE_TIMER
// timer
timer_init();
#endif
#endif
#if MICROPY_HW_ENABLE_DAC
// DAC
dac_init
();
#endif
pin_map_init
();
// check if user switch held (initiates reset of filesystem)
...
...
@@ -376,6 +354,12 @@ soft_reset:
pyb_usb_dev_init
(
USBD_DEVICE_CDC_MSC
,
usbd_medium_kind
);
#endif
#if MICROPY_HW_ENABLE_RNG
// RNG
rng_init
();
#endif
// I2C
i2c_init
();
#if MICROPY_HW_HAS_MMA7660
...
...
@@ -383,6 +367,23 @@ soft_reset:
accel_init
();
#endif
#if MICROPY_HW_ENABLE_SERVO
// servo
servo_init
();
#endif
#if 0
#if MICROPY_HW_ENABLE_TIMER
// timer
timer_init();
#endif
#endif
#if MICROPY_HW_ENABLE_DAC
// DAC
dac_init
();
#endif
// run main script
{
vstr_t
*
vstr
=
vstr_new
();
...
...
stmhal/modpyb.c
View file @
30216325
...
...
@@ -253,13 +253,6 @@ STATIC const mp_map_elem_t pyb_module_globals_table[] = {
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_SD
),
(
mp_obj_t
)
&
pyb_sdcard_obj
},
#endif
#if MICROPY_HW_HAS_MMA7660
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_Accel
),
(
mp_obj_t
)
&
pyb_accel_type
},
#endif
#if 0
{ MP_OBJ_NEW_QSTR(MP_QSTR_hid), (mp_obj_t)&pyb_hid_send_report_obj },
#endif
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_Led
),
(
mp_obj_t
)
&
pyb_led_type
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_I2C
),
(
mp_obj_t
)
&
pyb_i2c_type
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_Usart
),
(
mp_obj_t
)
&
pyb_Usart_obj
},
...
...
@@ -271,6 +264,14 @@ STATIC const mp_map_elem_t pyb_module_globals_table[] = {
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_DAC
),
(
mp_obj_t
)
&
pyb_dac_type
},
#endif
#if MICROPY_HW_HAS_MMA7660
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_Accel
),
(
mp_obj_t
)
&
pyb_accel_type
},
#endif
#if 0
{ MP_OBJ_NEW_QSTR(MP_QSTR_hid), (mp_obj_t)&pyb_hid_send_report_obj },
#endif
// input
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_input
),
(
mp_obj_t
)
&
pyb_input_obj
},
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment