The `periph_flash_common` feature was only defined here to trigger
inclusion of a source file with common functions.
It even only defines private symbols `_lock` and `_unlock` so no reason
to expose it to the build system.
And in practice, all stm cpus providing `periph_flashpage` or
`periph_eeprom` were required to provide `periph_flash_common` to allow
including it.
The previous implementation was only parsing in the modules were in
`FEATURES_REQUIRED` wich did not take cases of `FEATURES_OPTIONAL` into
account.
And also, in the same time, as the dependencies was declared in
`Makefile.include` it was processed before `Makefile.dep` so never handled
cases where a module could depend on `periph_flashpage` or
`periph_eeprom` feature.
It is replaced by selecting the common source file when module using it
are included.
The now useless feature `periph_flash_common` is removed from
`FEATURES_PROVIDED`.
`cpu/stm32_common/Makefile.dep` was never included by the global
`Makefile.dep`, so declaring this `USEMODULE +=` here was never shown to
the build system and never exported as `MODULE_PERIPH_I2C_X` variables.
In fact, `USEMODULE` was only used to trigger the `periph.mk`/`SUBMODULES`
mechanism to add matching source files names to `SRC` and so select
the implementation for each CPU type.
It is replaced by just explicitly selecting the right source file.
- dont send stop if bus is busy and before any action is done on bus
- and bus check that looks for bus error, arbitration and nack events
- check for ACK (TXIS) before writing bytes on bus and not between each write
Moving the while loop in a separate function ensures no ordering
optimizations is applied silently by gcc.
This commit fixes the flashpage not working on iotlab-m3.
- improve debug messages
- fix missing space before comment
- use a comment instead of debug message (the same message is displayed by the function called after)
Now, MCU is able to go in stop mode if necessary when
periph_pm feature is activated.
Regarding LPSDSR bit that deactivates or not regulator in stop
mode, it is up to the user to set/clear this bit. In order
to save power, voltage regulator can be set in low power state
during stop mode but it increases wakeup time.
Signed-off-by: Aurelien Fillau <aurelien.fillau@gmail.com>