diff --git a/cores/arduino/ch32/pinmap.c b/cores/arduino/ch32/pinmap.c index f58dc22..8e5f510 100644 --- a/cores/arduino/ch32/pinmap.c +++ b/cores/arduino/ch32/pinmap.c @@ -166,7 +166,11 @@ void pin_function(PinName pin, int function) } +#if defined(CH32X035) + GPIO_InitStructure.GPIO_Pin = ch_pinx; // fixed by Ngo Hung Cuong: pin_16, 17, ..., 23 +#else GPIO_InitStructure.GPIO_Pin = (uint16_t) ch_pinx; +#endif GPIO_Init(gpio, &GPIO_InitStructure); }