1
1
/*
2
- * Copyright (c) 2019, 2021 Niklas Hauser
2
+ * Copyright (c) 2019, 2021, 2024, Niklas Hauser
3
3
*
4
4
* This file is part of the modm project.
5
5
*
@@ -123,13 +123,12 @@ Rcc::enable()
123
123
__DSB();
124
124
%% for peripheral, (st_per, bus) in rcc_enable.items() | sort
125
125
if constexpr (peripheral == Peripheral::{{ peripheral }})
126
- if (not Rcc::isEnabled<peripheral>()) {
127
- RCC->{{bus}} |= RCC_{{bus}}_{{st_per}}EN;{% if st_per in rcc_reset %} __DSB();
128
- RCC->{{rcc_reset[st_per] }} |= RCC_{{rcc_reset[st_per] }}_{{st_per }}RST; __DSB();
129
- RCC->{{rcc_reset[st_per] }} &= ~RCC_{{rcc_reset[st_per] }}_{{st_per }}RST;{% endif %}{% if peripheral == "Eth" %} __DSB();
126
+ {% if peripheral in rcc_reset %}if (not Rcc::isEnabled<peripheral>()) {% endif %} {
127
+ RCC->{{bus}} |= RCC_{{bus}}_{{st_per}}EN;{% if peripheral in rcc_reset %} __DSB();
128
+ RCC->{{rcc_reset[peripheral][1] }} |= RCC_{{rcc_reset[peripheral][1] }}_{{rcc_reset[peripheral][0] }}RST; __DSB();
129
+ RCC->{{rcc_reset[peripheral][1] }} &= ~RCC_{{rcc_reset[peripheral][1] }}_{{rcc_reset[peripheral][0] }}RST;{% endif %}{% if peripheral == "Eth" %} __DSB();
130
130
RCC->{{bus}} |= RCC_{{bus}}_{{st_per}}RXEN; __DSB();
131
- RCC->{{bus}} |= RCC_{{bus}}_{{st_per}}TXEN;{% elif peripheral == "Usbotghs" %} __DSB();
132
- RCC->{{bus}} |= RCC_{{bus}}_{{st_per}}ULPIEN;{% endif %}
131
+ RCC->{{bus}} |= RCC_{{bus}}_{{st_per}}TXEN;{% endif %}
133
132
}
134
133
%% endfor
135
134
__DSB();
@@ -147,8 +146,7 @@ Rcc::disable()
147
146
if constexpr (peripheral == Peripheral::{{ peripheral }}) {
148
147
RCC->{{bus}} &= ~RCC_{{bus}}_{{st_per}}EN;{% if peripheral == "Eth" %} __DSB();
149
148
RCC->{{bus}} &= ~RCC_{{bus}}_{{st_per}}RXEN; __DSB();
150
- RCC->{{bus}} &= ~RCC_{{bus}}_{{st_per}}TXEN;{% elif peripheral == "Usbotghs" %} __DSB();
151
- RCC->{{bus}} &= ~RCC_{{bus}}_{{st_per}}ULPIEN;{% endif %}
149
+ RCC->{{bus}} &= ~RCC_{{bus}}_{{st_per}}TXEN;{% endif %}
152
150
}
153
151
%% endfor
154
152
__DSB();
0 commit comments