1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 16:25:16 +03:00
This commit is contained in:
Bertrand Songis 2020-01-15 21:06:44 +01:00 committed by 3djc
parent a9285a0b83
commit c99175fc29
2 changed files with 5 additions and 2 deletions

View file

@ -54,9 +54,11 @@ void pwrInit()
#if defined(PCBREV_HARDCODED)
hardwareOptions.pcbrev = PCBREV_HARDCODED;
#elif defined(PCBREV_GPIO_PIN)
GPIO_ResetBits(PCBREV_GPIO, PCBREV_GPIO_PIN);
#if defined(PCBREV_GPIO_PULL_DOWN)
GPIO_ResetBits(PCBREV_GPIO, PCBREV_GPIO_PIN);
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
#endif
GPIO_InitStructure.GPIO_Pin = PCBREV_GPIO_PIN;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
GPIO_Init(PCBREV_GPIO, &GPIO_InitStructure);
hardwareOptions.pcbrev = PCBREV_VALUE();
#endif

View file

@ -1375,6 +1375,7 @@
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOA
#define PCBREV_GPIO GPIOA
#define PCBREV_GPIO_PIN GPIO_Pin_14 // PA.14
#define PCBREV_GPIO_PULL_DOWN
#define PCBREV_VALUE() GPIO_ReadInputDataBit(PCBREV_GPIO, PCBREV_GPIO_PIN)
#else
#define PCBREV_RCC_AHB1Periph 0