It is considerede CamelCase but we do accept those as it makes the code
more readable knowing that the lower case x is a placeholder for a
number or letter in the define and the define applies to all "banks",
"buffers", "subsystems".
We should not add compiler extensions, it is not our job. We are not a
selfcontained project as kernel is so we should not introduce things
like this.
If we need to add some abstraction for this in the future to support
compilers doing these things differently then we will do that the same
way we dealt with the depricated attribute.
In places where we were defining memory mapped peripheral buffers we
were using directly a cast to "volatile int_type *". For consistency we
should use dereferenced accessor like: &MMIO32(address)
Added --terse and --mailback options to the make stylecheck target. It
also does continue even if it enounters a possible error.
We decided on two exceptions from the linux kernel coding standard:
- Empty wait while loops may end with ; on the same line.
- All blocks after while, if, for have to be in brackets even if they
only contain one statement. Otherwise it is easy to introduce an
error.
Checkpatch needs to be adapted to reflect those changes.
To make it easier on everyone to keep a uniform coding style throughout
the project we will be using this target to verify our code for
complience.
Currently a lot of files in the project don't fully follow the coding
style. We need to reach that spot over time though. :)
According to the reference manual, you are _forbidden_ from writing 00 to the
VOS[1:0] bits in PWR_CR. Writing a 00 is automatically turned into range 2,
or, 10. Attempting to then |= the bits for range 1 (01) results in the final
result of choosing voltage range 3 (11). This has fairly catastrophic effects
if you then attempt to switch to PLL clock at 32Mhz.
Oddly, the existing code was working fine on STM32L151C6 revision W, but
failing with revision V silicon. Regardless, the existing code was wrong and
not following the reference manual.
Further, attempting to change any power voltage range settings without the RCC
enabled will have no effect, so all the higher level helper routines
have added peripheral enable lines before attempting to set the range.
This switch to HSI was an attempt to run the setup code faster. However,
there's no real need for this, and it just confuses things by switching first
to one clock, and then to another. Just keep running on the existing clock
until switching to the clock actually chosen by the user's arguments.