mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 16:55:20 +03:00
X9E added to Makefile, [ENTER] moved to PF0
This commit is contained in:
parent
17d61ef300
commit
dfa32b805b
3 changed files with 32 additions and 3 deletions
|
@ -681,6 +681,10 @@ ifeq ($(PCB), TARANIS)
|
|||
CPPDEFS = -DREVPLUS
|
||||
HAPTIC = YES
|
||||
SWR = NO
|
||||
else ifeq ($(PCBREV), REV9E)
|
||||
CPPDEFS = -DREVPLUS -DREV9E
|
||||
HAPTIC = YES
|
||||
SWR = YES
|
||||
else
|
||||
CPPDEFS = -DREV4
|
||||
SWR = YES
|
||||
|
|
|
@ -5,7 +5,11 @@
|
|||
* GPIOS
|
||||
*/
|
||||
|
||||
#define RCC_AHB1Periph_GPIOBUTTON (RCC_AHB1Periph_GPIOA|RCC_AHB1Periph_GPIOB|RCC_AHB1Periph_GPIOC|RCC_AHB1Periph_GPIOD|RCC_AHB1Periph_GPIOE)
|
||||
#if defined(REV9E)
|
||||
#define RCC_AHB1Periph_GPIOBUTTON (RCC_AHB1Periph_GPIOA|RCC_AHB1Periph_GPIOB|RCC_AHB1Periph_GPIOC|RCC_AHB1Periph_GPIOD|RCC_AHB1Periph_GPIOE|RCC_AHB1Periph_GPIOF)
|
||||
#else
|
||||
#define RCC_AHB1Periph_GPIOBUTTON (RCC_AHB1Periph_GPIOA|RCC_AHB1Periph_GPIOB|RCC_AHB1Periph_GPIOC|RCC_AHB1Periph_GPIOD|RCC_AHB1Periph_GPIOE)
|
||||
#endif
|
||||
|
||||
// Keys
|
||||
#define GPIO_BUTTON_ENTER GPIOE->IDR
|
||||
|
@ -15,8 +19,12 @@
|
|||
#define GPIO_BUTTON_EXIT GPIOD->IDR
|
||||
#define GPIO_BUTTON_PAGE GPIOD->IDR
|
||||
#define PIN_BUTTON_PLUS GPIO_Pin_10 //SW3 PE.10
|
||||
#define PIN_BUTTON_MINUS GPIO_Pin_11 //SW1 PE.12
|
||||
#define PIN_BUTTON_ENTER GPIO_Pin_12 //SW2 PE.11
|
||||
#define PIN_BUTTON_MINUS GPIO_Pin_11 // PE11
|
||||
#if defined(REV9E)
|
||||
#define PIN_BUTTON_ENTER GPIO_Pin_0 // PF0
|
||||
#else
|
||||
#define PIN_BUTTON_ENTER GPIO_Pin_12 // PE12
|
||||
#endif
|
||||
#define PIN_BUTTON_MENU GPIO_Pin_7 //SW4 PD.07
|
||||
#define PIN_BUTTON_PAGE GPIO_Pin_3 //SW6 PD.02
|
||||
#define PIN_BUTTON_EXIT GPIO_Pin_2 //SW5 PD.03
|
||||
|
|
|
@ -42,10 +42,18 @@ uint32_t readKeys()
|
|||
{
|
||||
register uint32_t d = GPIOD->IDR;
|
||||
register uint32_t e = GPIOE->IDR;
|
||||
#if defined(REV9E)
|
||||
register uint32_t f = GPIOF->IDR;
|
||||
#endif
|
||||
register uint32_t result = 0;
|
||||
|
||||
#if defined(REV9E)
|
||||
if (f & PIN_BUTTON_ENTER)
|
||||
result |= 0x02 << KEY_ENTER;
|
||||
#else
|
||||
if (e & PIN_BUTTON_ENTER)
|
||||
result |= 0x02 << KEY_ENTER;
|
||||
#endif
|
||||
if (e & PIN_BUTTON_PLUS)
|
||||
result |= 0x02 << KEY_PLUS;
|
||||
if (e & PIN_BUTTON_MINUS)
|
||||
|
@ -317,6 +325,10 @@ void keysInit()
|
|||
GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_PLUS | PIN_BUTTON_ENTER | PIN_BUTTON_MINUS | PIN_TRIM_LH_R | PIN_TRIM_LH_L
|
||||
| PIN_TRIM_LV_DN | PIN_TRIM_LV_UP
|
||||
| PIN_SW_A_L | PIN_SW_D_L | PIN_SW_F | PIN_SW_C_L | PIN_SW_D_H | PIN_SW_H;
|
||||
#elif defined(REV9E)
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_PLUS | PIN_BUTTON_MINUS | PIN_TRIM_LH_R | PIN_TRIM_LH_L
|
||||
| PIN_TRIM_LV_DN | PIN_TRIM_LV_UP
|
||||
| PIN_SW_F | PIN_SW_A_L | PIN_SW_B_H | PIN_SW_B_L | PIN_SW_C_H | PIN_SW_D_H | PIN_SW_D_L | PIN_SW_G_H | PIN_SW_G_L;
|
||||
#elif defined(REVPLUS)
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_PLUS | PIN_BUTTON_ENTER | PIN_BUTTON_MINUS | PIN_TRIM_LH_R | PIN_TRIM_LH_L
|
||||
| PIN_TRIM_LV_DN | PIN_TRIM_LV_UP
|
||||
|
@ -332,6 +344,11 @@ void keysInit()
|
|||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ;
|
||||
GPIO_Init(GPIOE, &GPIO_InitStructure);
|
||||
|
||||
#if defined(REV9E)
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_ENTER;
|
||||
GPIO_Init(GPIOF, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
#if defined(REVPLUS)
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_MENU | PIN_BUTTON_EXIT | PIN_BUTTON_PAGE | PIN_SW_H;
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue