Skip to content

Commit 3722de9

Browse files
authored
fix(x10-express): Touch Screen Mod PCBREV check failing in cold temps(EdgeTX#4529)
1 parent 308b53e commit 3722de9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

radio/src/targets/common/arm/stm32/pwr_driver.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ void pwrInit()
7070
#endif
7171
GPIO_InitStructure.GPIO_Pin = PCBREV_GPIO_PIN;
7272
GPIO_Init(PCBREV_GPIO, &GPIO_InitStructure);
73+
#if defined(PCBREV_TOUCH_GPIO_PIN)
74+
#if defined(PCBREV_TOUCH_GPIO_PULL_UP)
75+
GPIO_ResetBits(PCBREV_TOUCH_GPIO, PCBREV_TOUCH_GPIO_PIN);
76+
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
77+
#endif
78+
GPIO_InitStructure.GPIO_Pin = PCBREV_TOUCH_GPIO_PIN;
79+
GPIO_Init(PCBREV_TOUCH_GPIO, &GPIO_InitStructure);
80+
#endif
81+
7382
hardwareOptions.pcbrev = PCBREV_VALUE();
7483
#endif
7584
}

radio/src/targets/horus/hal.h

+1
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@
419419
#define PCBREV_GPIO_PIN (GPIO_Pin_7 | GPIO_Pin_8) // PH.07 | PH.08
420420
#define PCBREV_TOUCH_GPIO GPIOA
421421
#define PCBREV_TOUCH_GPIO_PIN GPIO_Pin_6 // PA.06
422+
#define PCBREV_TOUCH_GPIO_PULL_UP
422423
#define PCBREV_VALUE() ((GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_7) + (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_8) << 1)) * GPIO_ReadInputDataBit(PCBREV_TOUCH_GPIO, GPIO_Pin_6))
423424
#else
424425
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOI

0 commit comments

Comments
 (0)