From a62570d7e7dcb84a1072ed5cd14c6c78178ace15 Mon Sep 17 00:00:00 2001 From: Jannis Konrad <kabel42@gmail.com> Date: Mon, 22 May 2023 11:56:39 +0200 Subject: [PATCH] DYN_GPIO -> DYN_REG we don't need DYN_WRITE for gpio as the fiels don't line up but we will need if for other regs in the future --- ch32v003fun/ch32v003fun.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch32v003fun/ch32v003fun.h b/ch32v003fun/ch32v003fun.h index f2b392a..1ac7e19 100644 --- a/ch32v003fun/ch32v003fun.h +++ b/ch32v003fun/ch32v003fun.h @@ -321,7 +321,7 @@ typedef struct static inline void GPIOset(GPIO_TypeDef *gpio, uint8_t pins) {gpio->BSHR = pins;} static inline void GPIOreset(GPIO_TypeDef *gpio, uint8_t pins) {gpio->BCR = pins;} static inline void GPIOsetReset(GPIO_TypeDef *gpio, uint8_t set_pins, uint8_t reset_pins) {gpio->BSHR = set_pins|(reset_pins<<16);} -#define DYN_GPIO_WRITE(gpio, reg, field, value) { const struct reg##_t tmp = {.##field = value ,}; gpio##->##reg = tmp;} +#define DYN_REG_WRITE(basereg, reg, field, value) { const struct reg##_t tmp = {.##field = value ,}; basereg##->##reg = tmp;} /* Alternate Function I/O */ typedef struct -- GitLab