Use RCC_CFGR_SW helper function to set software clock

This commit is contained in:
Alexander Heldt
2024-12-30 11:48:38 +01:00
parent 11f469564f
commit 3aad7271a1
6 changed files with 141 additions and 150 deletions

View File

@@ -2302,8 +2302,7 @@ static void system_clock_init(void) {
((struct rcc *) (0x40023800U))->CFGR |= ((0x0111) << 0);
((struct rcc *) (0x40023800U))->CFGR &= ~((0b11) << 0);
((struct rcc *) (0x40023800U))->CFGR |= ((0b10) << 0);
((struct rcc *) (0x40023800U))->CFGR |= (((0b10) & (0b11)) << 0);
@@ -2322,13 +2321,13 @@ int main(void) {
uint16_t counter = ((struct timer *) (0x40000800U))->CNT;
# 87 "src/main.c" 3 4
# 86 "src/main.c" 3 4
_Bool
# 87 "src/main.c"
# 86 "src/main.c"
led_on =
# 87 "src/main.c" 3 4
# 86 "src/main.c" 3 4
((_Bool)+0u)
# 87 "src/main.c"
# 86 "src/main.c"
;
while(1) {
if ((((struct timer *) (0x40000800U))->CNT - counter) >= 250) {