Implemented reading of PTT status from external microphone on MD-3x0 and MD-UV3x0

replace/b0e0666848cf088cc879d160ab7f96e122b7b4d5
Silvano Seva 2021-07-10 21:52:11 +02:00
rodzic 466b405bba
commit b80ddc1145
4 zmienionych plików z 14 dodań i 6 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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()

Wyświetl plik

@ -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

Wyświetl plik

@ -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()