-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This was previously hardcoded to 4k, which is intended for devices with 6k of EEPROM reserving 2k for the LoRaWAN library. For devices like the L053, that only has 2k of EEPROM, this would result in an invalid EEPROM size. Now, this reserved value is more explicit and is configured on a per-board basis in variant.h using the new `STM32L0_CONFIG_EEPROM_RESERVED` macro. This is set to 2048 for all boards that have an embedded LoRaWAN transceiver and left undefined for the more generic boards. Then the full EEPROM size is autodetected using the STM32 CMSIS header files and exposed as `REAL_E2END`, and the reserved area is subtracted from that and exposed as `E2END` (and also through `EEPROM.length()`). This also changes `Arduino.h` to move the `avr/*.h` includes down to below the `variant.h` include (just moving `avr/io.h` would have been enough, but this is more consistent), so `variant.h` can be used in io.h. This also includes `Arduino.h` from `io.h`, in case `io.h` is included directly by a sketch. Note that the autodetection uses macros that include a typecast, so the resulting `E2END` macro cannot be examined by the preprocessor (e.g. an `#if` statement), which is why this uses a `static_assert` instead to check that `STM32L0_CONFIG_EEPROM_RESERVED` is not too big. The resulting expression is a valid constant expression in both C and C++ contexts, though.
- Loading branch information
1 parent
65b6883
commit b98a094
Showing
10 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters