Skip to content

Commit a111514

Browse files
authored
Update SDK #176
Update board's SDK. Also, CH32X035 doesn't seem to support manually config open-drain mode. (GPIO will be open-drain in I2C connection automatically.) #if !defined(CH32X035) case CH_CNF_OUTPUT_OD: GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD; break; #endif case CH_CNF_OUTPUT_AFPP: GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; break; #if !defined(CH32X035) case CH_CNF_OUTPUT_AFOD: GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_OD; break; #endif And AFIO_Remap_SWJ_NONJTRST and AFIO_Remap_SWJ_NOJTAG were removed from variants\CH32V20x\PinAF_CH32V20x.h because they don't exist. - AFIO_Remap_SWJ_NONJTRST, - AFIO_Remap_SWJ_NOJTAG, - - case AFIO_Remap_SWJ_NONJTRST: - GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST,ENABLE); - break; - case AFIO_Remap_SWJ_NOJTAG: - GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE); - break; Update SDK log Copy from official SDK Disable _write in debug.c. /********************************************************************* * @fn _write * * @brief Support Printf Function * * @param *buf - UART send Data. * size - Data length. * * @return size - Data length */ + #if 0 __attribute__((used)) int _write(int fd, char *buf, int size) { } + #endif Add _fini and _init in end of debug.c. + void _fini() {} + void _init() {} Comment out #define SYSCLK_FREQ_XXXX in system_ch32xxxx.c. Debug Memo (SDK's bug) In ch32l103_usb.h #ifdef __cplusplus extern "C" { #endif - #ifdef __cplusplus - extern "C" { - #endif In ch32v10x_misc.h + #ifdef __cplusplus + } + #endif Some boards use MHZ instead for MHz in system_ch32xxxx.c.
1 parent 2f60f69 commit a111514

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

variants/CH32V20x/PinAF_CH32V20x.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ enum {
102102
AFIO_Remap_ADC2_ETRGREG_ENABLE,
103103
AFIO_Remap_ADC2_ETRGREG_DISABLE,
104104

105-
AFIO_Remap_SWJ_NONJTRST,
106-
AFIO_Remap_SWJ_NOJTAG,
107105
AFIO_Remap_SWJ_DISABLE,
108106

109107
AFIO_Remap_SPI3_ENABLE,
@@ -314,12 +312,6 @@ static inline void pin_SetV32AFPin(uint32_t afnum)
314312
GPIO_PinRemapConfig(GPIO_Remap_ADC2_ETRGREG,DISABLE);
315313
break;
316314

317-
case AFIO_Remap_SWJ_NONJTRST:
318-
GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST,ENABLE);
319-
break;
320-
case AFIO_Remap_SWJ_NOJTAG:
321-
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE);
322-
break;
323315
case AFIO_Remap_SWJ_DISABLE:
324316
GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable,ENABLE);
325317
break;

0 commit comments

Comments
 (0)