kopia lustrzana https://github.com/OpenRTX/OpenRTX
Implemented reading of PTT status from external microphone on MD-3x0 and MD-UV3x0
rodzic
466b405bba
commit
b80ddc1145
|
@ -80,7 +80,8 @@
|
|||
#define CH_SELECTOR_3 GPIOB,11
|
||||
|
||||
/* Push-to-talk switch */
|
||||
#define PTT_SW GPIOE,11
|
||||
#define PTT_SW GPIOE,11
|
||||
#define PTT_EXT GPIOE,12
|
||||
|
||||
/*
|
||||
* Keyboard. Here we define only rows, since coloumn lines are the same as
|
||||
|
|
|
@ -46,7 +46,8 @@ void platform_init()
|
|||
gpio_setMode(CH_SELECTOR_2, INPUT);
|
||||
gpio_setMode(CH_SELECTOR_3, INPUT);
|
||||
|
||||
gpio_setMode(PTT_SW, INPUT);
|
||||
gpio_setMode(PTT_SW, INPUT);
|
||||
gpio_setMode(PTT_EXT, INPUT);
|
||||
|
||||
gpio_setMode(PWR_SW, OUTPUT);
|
||||
|
||||
|
@ -122,7 +123,9 @@ int8_t platform_getChSelector()
|
|||
bool platform_getPttStatus()
|
||||
{
|
||||
/* PTT line has a pullup resistor with PTT switch closing to ground */
|
||||
return (gpio_readPin(PTT_SW) == 0) ? true : false;
|
||||
uint8_t intPttStatus = gpio_readPin(PTT_SW);
|
||||
uint8_t extPttStatus = gpio_readPin(PTT_EXT);
|
||||
return ((intPttStatus == 0) || (extPttStatus == 0)) ? true : false;
|
||||
}
|
||||
|
||||
bool platform_pwrButtonStatus()
|
||||
|
|
|
@ -74,7 +74,8 @@
|
|||
#define CH_SELECTOR_1 GPIOB,11
|
||||
|
||||
/* Push-to-talk switch */
|
||||
#define PTT_SW GPIOE,11
|
||||
#define PTT_SW GPIOE,11
|
||||
#define PTT_EXT GPIOE,12
|
||||
|
||||
/*
|
||||
* Keyboard. Here we define only rows, since coloumn lines are the same as
|
||||
|
|
|
@ -43,7 +43,8 @@ void platform_init()
|
|||
|
||||
gpio_setMode(PTT_SW, INPUT_PULL_UP);
|
||||
|
||||
gpio_setMode(PWR_SW, OUTPUT);
|
||||
gpio_setMode(PTT_SW, INPUT);
|
||||
gpio_setMode(PTT_EXT, INPUT);
|
||||
|
||||
/*
|
||||
* Initialise ADC1, for vbat, RSSI, ...
|
||||
|
@ -116,7 +117,9 @@ float platform_getVolumeLevel()
|
|||
bool platform_getPttStatus()
|
||||
{
|
||||
/* PTT line has a pullup resistor with PTT switch closing to ground */
|
||||
return (gpio_readPin(PTT_SW) == 0) ? true : false;
|
||||
uint8_t intPttStatus = gpio_readPin(PTT_SW);
|
||||
uint8_t extPttStatus = gpio_readPin(PTT_EXT);
|
||||
return ((intPttStatus == 0) || (extPttStatus == 0)) ? true : false;
|
||||
}
|
||||
|
||||
bool platform_pwrButtonStatus()
|
||||
|
|
Ładowanie…
Reference in New Issue