aboutsummaryrefslogtreecommitdiff
path: root/stmhal/main.c
diff options
context:
space:
mode:
authorDamien George2014-03-25 23:33:47 +0000
committerDamien George2014-03-25 23:33:47 +0000
commit30216325010e198c2e73ea41811ae63ea5ee3991 (patch)
tree2f2d57e113adfbf149008419f5f30339b0856ad0 /stmhal/main.c
parent6cfda3084dfef44892e85b1c658f0ad9b0643641 (diff)
stmhal: Shuffle around some init functions in main().
Diffstat (limited to 'stmhal/main.c')
-rw-r--r--stmhal/main.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/stmhal/main.c b/stmhal/main.c
index e80841ea9..1da7a9a64 100644
--- a/stmhal/main.c
+++ b/stmhal/main.c
@@ -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();