altos/stm: Add casts to reduce -Wconversion warnings No bugs identified Signed-off-by: Keith Packard <keithp@keithp.com>
altos/stm: Make ao_eeprom_total a #define instead of a const variable This is unused outside of ao_eeprom_stm.c, and as global const takes up space in flash. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Remove 8051 address space specifiers Signed-off-by: Keith Packard <keithp@keithp.com>
altos/arm: Align data so that gcc 5.4 doesn't do byte-accesses. Add -Wcast-align Gcc 5.4.1 tracks alignment of data through assignments, so that a uint32_t pointer which comes from byte-aligned uint8_t data: extern uint8_t foo[]; uint32_t *q = (void *) foo; Fetches and stores through this pointer are done bytewise. This is slow (meh), but if q references a device register, things to bad very quickly. This patch works around this bug in the compiler by adding __attribute__((aligned(4))) tags to some variables, or changing them from uint8_t to uint32_t. Places doing this will now be caught as I've added -Wcast-align to the compiler flags. That required adding (void *) casts, after the relevant code was checked to make sure the compiler could tell that the addresses were aligned. Signed-off-by: Keith Packard <keithp@keithp.com>
Switch from GPLv2 to GPLv2+ Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Allow use of internal EEPROM for config storage This stops exposing eeprom as 'storage' and instead exposes it with a separate eeprom API so that it can be used for config storage without also using it for flight log storage. The config code has been changed to allow it to either use storage for configuration data or eeprom. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Use FTDW, clear DATA bit. Disable backup write protection The newer(?) chips in telegps didn't like the previous programming scheme, so go back to fixed time for write, which does an implicit erase before every write. Also clear the DATA bit, which is only needed for double word erase/programming. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Explicitly erase memory in STM eeprom driver. This seems to make the STM32L152 happier Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Add driver for STM internal flash Signed-off-by: Keith Packard <keithp@keithp.com>