aboutsummaryrefslogtreecommitdiff
path: root/ports/stm32/main.c
diff options
context:
space:
mode:
authorDamien George2018-02-02 19:04:36 +1100
committerDamien George2018-02-02 19:04:36 +1100
commit4b8e58756bf408f4a899d7cf787ed1961f6f9682 (patch)
treec91e8c9e9ac79718908e5920b91ff60bd2757312 /ports/stm32/main.c
parent5ddd1488bd5ac7a41d76e68b84ff858d7fa0aad7 (diff)
stm32/i2c: Allow I2C peripheral state to persist across a soft reset.
The I2C sub-system is independent from the uPy state (eg the heap) and so can safely persist across a soft reset.
Diffstat (limited to 'ports/stm32/main.c')
-rw-r--r--ports/stm32/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ports/stm32/main.c b/ports/stm32/main.c
index 7a530ff83..5617747e9 100644
--- a/ports/stm32/main.c
+++ b/ports/stm32/main.c
@@ -458,6 +458,9 @@ int main(void) {
switch_init0();
#endif
spi_init0();
+ #if MICROPY_HW_ENABLE_HW_I2C
+ i2c_init0();
+ #endif
#if defined(USE_DEVICE_MODE)
// default to internal flash being the usb medium
@@ -553,10 +556,6 @@ soft_reset:
can_init0();
#endif
- #if MICROPY_HW_ENABLE_HW_I2C
- i2c_init0();
- #endif
-
pyb_usb_init0();
// Initialise the local flash filesystem.