Skip to content

Commit

Permalink
fix(x10-express): Touch Screen Mod PCBREV check failing in cold temps(#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MRC3742 authored Jan 12, 2024
1 parent 308b53e commit 3722de9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions radio/src/targets/common/arm/stm32/pwr_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ void pwrInit()
#endif
GPIO_InitStructure.GPIO_Pin = PCBREV_GPIO_PIN;
GPIO_Init(PCBREV_GPIO, &GPIO_InitStructure);
#if defined(PCBREV_TOUCH_GPIO_PIN)
#if defined(PCBREV_TOUCH_GPIO_PULL_UP)
GPIO_ResetBits(PCBREV_TOUCH_GPIO, PCBREV_TOUCH_GPIO_PIN);
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
#endif
GPIO_InitStructure.GPIO_Pin = PCBREV_TOUCH_GPIO_PIN;
GPIO_Init(PCBREV_TOUCH_GPIO, &GPIO_InitStructure);
#endif

hardwareOptions.pcbrev = PCBREV_VALUE();
#endif
}
Expand Down
1 change: 1 addition & 0 deletions radio/src/targets/horus/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@
#define PCBREV_GPIO_PIN (GPIO_Pin_7 | GPIO_Pin_8) // PH.07 | PH.08
#define PCBREV_TOUCH_GPIO GPIOA
#define PCBREV_TOUCH_GPIO_PIN GPIO_Pin_6 // PA.06
#define PCBREV_TOUCH_GPIO_PULL_UP
#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))
#else
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOI
Expand Down

0 comments on commit 3722de9

Please sign in to comment.