Commit 17a0b3ea authored by Tomáš Juřena's avatar Tomáš Juřena Committed by Benjamin Cabé
Browse files

boards: iar: 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 a7d9a812
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@
};

&rtc {
	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
	clocks = <&rcc STM32_CLOCK(APB1, 28)>,
		 <&rcc STM32_SRC_LSI RTC_SEL(2)>;
	status = "okay";
};