stm32-rs / stm32l0xx-hal

A hardware abstraction layer (HAL) for the STM32L0 series microcontrollers written in Rust
BSD Zero Clause License
96 stars 60 forks source link

Simplify flash.c #136

Closed dbrgn closed 3 years ago

dbrgn commented 3 years ago

The manual for-loop looked a bit funny :)

(A memcpy would probably work as well, but is less easy to read and also results in a larger binary.)

dbrgn commented 3 years ago

On master:

$ ./compile.sh && sha1sum libflash.a
0f720d2f86e55e2fe2e05bc639c18eef595a45fa  libflash.a

On this branch:

$ ./compile.sh && sha1sum libflash.a
0f720d2f86e55e2fe2e05bc639c18eef595a45fa  libflash.a

...so I didn't commit the rebuilt binary, especially considering that the checked-in binary is 896 bytes, while the one my compiler generates is 900 bytes. Probably because a different gcc version was used.

hannobraun commented 3 years ago

Makes sense, thank you.