aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/stm32g0.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2022-12-15 10:23:37 -0500
committerKevin O'Connor <kevin@koconnor.net>2022-12-15 10:27:51 -0500
commitf31540b3571c211739cfad4c207309e222f25842 (patch)
tree3e677da08c185fb4da983d60de7ed8423cb34f7e /src/stm32/stm32g0.c
parente33b41abaabe7d2be2207c79d5ed59cb8ce7babc (diff)
downloadkutter-f31540b3571c211739cfad4c207309e222f25842.tar.gz
kutter-f31540b3571c211739cfad4c207309e222f25842.tar.xz
kutter-f31540b3571c211739cfad4c207309e222f25842.zip
stm32: Minor changes to stm32g0b0 ifdefs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/stm32g0.c')
-rw-r--r--src/stm32/stm32g0.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stm32/stm32g0.c b/src/stm32/stm32g0.c
index 84711709..f42ac777 100644
--- a/src/stm32/stm32g0.c
+++ b/src/stm32/stm32g0.c
@@ -60,8 +60,8 @@ lookup_clock_line(uint32_t periph_base)
return (struct cline){.en=&RCC->APBENR2,.rst=&RCC->APBRSTR2,.bit=1<<18};
if (periph_base == ADC1_BASE)
return (struct cline){.en=&RCC->APBENR2,.rst=&RCC->APBRSTR2,.bit=1<<20};
- if (periph_base >= APBPERIPH_BASE && periph_base < APBPERIPH_BASE + 0x8000)
- {
+ if (periph_base >= APBPERIPH_BASE
+ && periph_base < APBPERIPH_BASE + 32*0x400) {
uint32_t bit = 1 << ((periph_base - APBPERIPH_BASE) / 0x400);
return (struct cline){.en=&RCC->APBENR1, .rst=&RCC->APBRSTR1, .bit=bit};
}