We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6a3e62 commit de6aa65Copy full SHA for de6aa65
src/hw_config_rev4.c
@@ -203,12 +203,16 @@ HardwareDefinitionPtr detect_hardware(void) {
203
// GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
204
// GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
205
// GPIO_Init (GPIOB, &GPIO_InitStructure);
206
-
+ #define CPU_MODEL_GD32 (0x13030410)
207
+
208
const uint8_t state = GPIO_ReadInputDataBit (GPIOB, GPIO_Pin_7);
- if (state == 0) {
209
+ if (*((volatile uint32_t *)0xE0042000) == CPU_MODEL_GD32) {
210
+ g_current_hardware = &HW3;
211
+ } else if(state == 0){
212
g_current_hardware = &HW4;
- } else{
213
+ }
214
+ else{
215
g_current_hardware = &HW3;
216
}
217
return g_current_hardware;
-}
218
+}
0 commit comments