Skip to content
Commit 55d47660 authored by Tomáš Juřena's avatar Tomáš Juřena Committed by Benjamin Cabé
Browse files

boards: blues: Use STM32_CLOCK macro in all boards



Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: default avatarTomáš Juřena <jurenatomas@gmail.com>
parent 2856c767
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment