kopia lustrzana https://github.com/OpenRTX/OpenRTX
Fix compilation for MD-UV380
rodzic
a232caf7ec
commit
b0e83c4303
|
@ -40,10 +40,10 @@ void platform_test()
|
|||
float volumeLevel = platform_getVolumeLevel();
|
||||
uint8_t currentCh = platform_getChSelector();
|
||||
bool ptt = platform_getPttStatus();
|
||||
char buf2[20] = "";
|
||||
char buf2[26] = "";
|
||||
snprintf(buf2, sizeof(buf2), "bat:%.2f mic:%.2f", vBat, micLevel);
|
||||
char buf3[20] = "";
|
||||
snprintf(buf3, sizeof(buf3), "vol:%.2f ch:%d ptt:%d", volumeLevel, currentCh, ptt);
|
||||
char buf3[26] = "";
|
||||
snprintf(buf3, sizeof(buf3), "vol:%.2f ch:%d ptt:%s", volumeLevel, currentCh, ptt?"on":"off");
|
||||
gfx_print(pos_line2, buf2, FONT_SIZE_1, TEXT_ALIGN_LEFT, color_white);
|
||||
gfx_print(pos_line3, buf3, FONT_SIZE_1, TEXT_ALIGN_LEFT, color_white);
|
||||
gfx_render();
|
||||
|
|
|
@ -32,11 +32,12 @@ void adc1_init()
|
|||
* - PA1: battery voltage
|
||||
* - PA3: vox level
|
||||
* - PB0: RSSI level
|
||||
* Volume, Mic and RSSI temporarily disabled until the right pinout is found
|
||||
*/
|
||||
gpio_setMode(AIN_VOLUME, INPUT_ANALOG);
|
||||
//gpio_setMode(AIN_VOLUME, INPUT_ANALOG);
|
||||
gpio_setMode(AIN_VBAT, INPUT_ANALOG);
|
||||
gpio_setMode(AIN_MIC, INPUT_ANALOG);
|
||||
gpio_setMode(AIN_RSSI, INPUT_ANALOG);
|
||||
//gpio_setMode(AIN_MIC, INPUT_ANALOG);
|
||||
//gpio_setMode(AIN_RSSI, INPUT_ANALOG);
|
||||
|
||||
/*
|
||||
* ADC clock is APB2 frequency divided by 8, giving 10.5MHz.
|
||||
|
|
|
@ -134,7 +134,7 @@ uint8_t platform_getChSelector()
|
|||
{
|
||||
static const uint8_t rsPositions[] = { 1, 4, 2, 3};
|
||||
int pos = gpio_readPin(CH_SELECTOR_0)
|
||||
| (gpio_readPin(CH_SELECTOR_1) << 1)
|
||||
| (gpio_readPin(CH_SELECTOR_1) << 1);
|
||||
|
||||
return rsPositions[pos];
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue