mirror of
https://github.com/opentx/opentx.git
synced 2025-07-12 19:10:19 +03:00
X9D+ 2019 Bootloader: wait needed before detecting trims are pressed
as done on Horus...
This commit is contained in:
parent
adbe72d76f
commit
a27417c497
3 changed files with 7 additions and 4 deletions
|
@ -69,13 +69,13 @@ FlashCheckRes valid;
|
|||
MemoryType memoryType;
|
||||
uint32_t unlocked = 0;
|
||||
|
||||
void interrupt10ms(void)
|
||||
void interrupt10ms()
|
||||
{
|
||||
tenms |= 1; // 10 mS has passed
|
||||
tenms |= 1u; // 10 mS has passed
|
||||
|
||||
uint8_t index = 0;
|
||||
uint8_t in = readKeys();
|
||||
for (uint8_t i = 1; i != uint8_t(1 << TRM_BASE); i <<= 1) {
|
||||
for (uint8_t i = 1; i != uint8_t(1u << TRM_BASE); i <<= 1) {
|
||||
uint8_t value = (in & i);
|
||||
keys[index].input(value);
|
||||
++index;
|
||||
|
@ -210,7 +210,7 @@ int main()
|
|||
pwrInit();
|
||||
keysInit();
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#if defined(BOOTLOADER_WAIT_BEFORE_READ_TRIMS)
|
||||
// wait a bit for the inputs to stabilize...
|
||||
if (!WAS_RESET_BY_WATCHDOG_OR_SOFTWARE()) {
|
||||
for (uint32_t i = 0; i < 150000; i++) {
|
||||
|
|
|
@ -140,6 +140,8 @@
|
|||
#define SWITCHES_GPIO_PIN_J GPIO_Pin_0 // PB.00
|
||||
#endif
|
||||
|
||||
#define BOOTLOADER_WAIT_BEFORE_READ_TRIMS
|
||||
|
||||
// Trims
|
||||
#if defined(PCBX12S)
|
||||
#define TRIMS_GPIO_REG_RHL GPIOC->IDR
|
||||
|
|
|
@ -228,6 +228,7 @@
|
|||
#define TRIMS_GPIO_REG_RHL GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_RHL GPIO_Pin_9 // PD.09
|
||||
#elif defined(PCBX9DP) && PCBREV >= 2019
|
||||
#define BOOTLOADER_WAIT_BEFORE_READ_TRIMS
|
||||
#define TRIMS_GPIO_REG_LHL GPIOE->IDR
|
||||
#define TRIMS_GPIO_PIN_LHL GPIO_Pin_3 // PE.03
|
||||
#define TRIMS_GPIO_REG_LHR GPIOE->IDR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue