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

boards: makerbase: 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 17a0b3ea
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@
};

stm32_lp_tick_source: &lptim1 {
	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x80000000>,
	clocks = <&rcc STM32_CLOCK(APB1, 31)>,
		 <&rcc STM32_SRC_LSE LPTIM1_SEL(3)>;
	status = "okay";
};