mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
stac
02e0017cbb
stm32 lib: declare read-only parameters as const
Many of the STM32 library functions take a pointer to an initialization structure. In nearly every case, this struct is a read-only (ie. const) parameter. It is advantageous (and good coding practice) to actually declare read-only data as const so that the compiler can place the const data in the .rodata section which resides in flash and doesn't consume any RAM. This has the added bonus advantage that it is impossible for the running application to corrupt the read-only data. In order to allow passing pointers to const data into the library functions, it is essential that the function prototypes also declare their associated read-only parameters as const. This commit adds the const attribute to those parameters that are actually read-only. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@758 ebee16cc-31ac-478f-84a7-5cbb03baadba
Description
The LibrePilot open source project was founded in July 2015. It focuses on research and development of software and hardware to be used in a variety of applications including vehicle control and stabilization, unmanned autonomous vehicles and robotics.
Languages
C
60.6%
C++
30.8%
Fortran
2.6%
Rich Text Format
1.3%
Assembly
1.2%
Other
3.1%