Merge from 2.3

This commit is contained in:
Bertrand Songis
2019-12-05 09:29:11 +01:00
161 changed files with 3682 additions and 10305 deletions
@@ -21,6 +21,39 @@
#include "opentx.h"
#include <math.h>
#if defined(MULTIMODULE)
void lcdDrawMultiProtocolString(coord_t x, coord_t y, uint8_t moduleIdx, uint8_t protocol, LcdFlags flags)
{
if (protocol <= MODULE_SUBTYPE_MULTI_LAST) {
lcdDrawTextAtIndex(x, y, STR_MULTI_PROTOCOLS, protocol, flags);
return;
}
else {
MultiModuleStatus &status = getMultiModuleStatus(moduleIdx);
if (status.protocolName[0] && status.isValid())
lcdDrawText(x, y, status.protocolName, flags);
else
lcdDrawNumber(x, y, protocol + 3, flags); // Convert because of OpenTX FrSky fidling (OpenTX protocol tables and Multiprotocol tables don't match)
}
}
void lcdDrawMultiSubProtocolString(coord_t x, coord_t y, uint8_t moduleIdx, uint8_t subType, LcdFlags flags)
{
const mm_protocol_definition *pdef = getMultiProtocolDefinition(g_model.moduleData[moduleIdx].getMultiProtocol());
if (subType <= pdef->maxSubtype && pdef->subTypeString != nullptr) {
lcdDrawTextAtIndex(x, y, pdef->subTypeString, subType, flags);
return;
}
else {
MultiModuleStatus &status = getMultiModuleStatus(moduleIdx);
if (status.protocolName[0] && status.isValid())
lcdDrawText(x, y, status.protocolSubName, flags);
else
lcdDrawNumber(x, y, subType, flags);
}
}
#endif
void drawStringWithIndex(coord_t x, coord_t y, const char * str, uint8_t idx, LcdFlags flags)
{
if (flags & RIGHT) {
+2 -1
View File
@@ -22,7 +22,8 @@
#define _STDLCD_DRAW_FUNCTIONS_H_
#include "lcd.h"
void lcdDrawMultiProtocolString(coord_t x, coord_t y, uint8_t moduleIdx, uint8_t protocol, LcdFlags flags = 0);
void lcdDrawMultiSubProtocolString(coord_t x, coord_t y, uint8_t moduleIdx, uint8_t subType, LcdFlags flags = 0);
void drawStringWithIndex(coord_t x, coord_t y, const char * str, uint8_t idx, LcdFlags att=0);
void drawValueWithUnit(coord_t x, coord_t y, int val, uint8_t unit, LcdFlags att=0);
+3 -3
View File
@@ -231,7 +231,7 @@ void displayMixInfos(coord_t y, MixData * md)
void displayMixLine(coord_t y, MixData * md, bool active)
{
if(active && md->name[0]) {
lcdDrawSizedText(FW*sizeof(TR_MIXER)+FW/2, 0, md->name, sizeof(md->name), ZCHAR);
lcdDrawSizedText(FW*sizeof(TR_MIXES)+FW/2, 0, md->name, sizeof(md->name), ZCHAR);
if (!md->flightModes || ((md->curve.value || md->swtch) && ((get_tmr10ms() / 200) & 1)))
displayMixInfos(y, md);
else
@@ -385,7 +385,7 @@ void menuModelMixAll(event_t event)
break;
}
lcdDrawNumber(FW*sizeof(TR_MIXER)+FW/2, 0, getMixesCount(), 0);
lcdDrawNumber(FW*sizeof(TR_MIXES)+FW/2, 0, getMixesCount(), 0);
lcdDrawText(lcdNextPos, 0, STR_MAX(MAX_MIXERS));
// Value
@@ -397,7 +397,7 @@ void menuModelMixAll(event_t event)
#endif
}
SIMPLE_MENU(STR_MIXER, menuTabModel, MENU_MODEL_MIXES, HEADER_LINE + s_maxLines);
SIMPLE_MENU(STR_MIXES, menuTabModel, MENU_MODEL_MIXES, HEADER_LINE + s_maxLines);
#if LCD_W >= 212
// Gauge
@@ -50,7 +50,7 @@ void menuRadioPowerMeter(event_t event)
lcdRefresh();
moduleState[g_moduleIdx].readModuleInformation(&reusableBuffer.moduleSetup.pxx2.moduleInformation, PXX2_HW_INFO_TX_ID, PXX2_HW_INFO_TX_ID);
/* wait 1s to resume normal operation before leaving */
watchdogSuspend(1000);
watchdogSuspend(500 /*5s*/);
RTOS_WAIT_MS(1000);
return;
}
@@ -568,13 +568,15 @@ void menuRadioSdManager(event_t _event)
if (moduleState[EXTERNAL_MODULE].mode == MODULE_MODE_BIND) {
if (reusableBuffer.sdManager.otaUpdateInformation.step == BIND_INIT) {
if (reusableBuffer.sdManager.otaUpdateInformation.candidateReceiversCount > 0) {
popupMenuItemsCount = min<uint8_t>(reusableBuffer.sdManager.otaUpdateInformation.candidateReceiversCount, PXX2_MAX_RECEIVERS_PER_MODULE);
for (uint8_t i=0; i<popupMenuItemsCount; i++) {
popupMenuItems[i] = reusableBuffer.sdManager.otaUpdateInformation.candidateReceiversNames[i];
if(reusableBuffer.sdManager.otaUpdateInformation.candidateReceiversCount != popupMenuItemsCount) {
CLEAR_POPUP();
popupMenuItemsCount = min<uint8_t>(reusableBuffer.sdManager.otaUpdateInformation.candidateReceiversCount,PXX2_MAX_RECEIVERS_PER_MODULE);
for (auto rx = 0; rx < popupMenuItemsCount; rx++) {
popupMenuItems[rx] = reusableBuffer.sdManager.otaUpdateInformation.candidateReceiversNames[rx];
}
popupMenuTitle = STR_PXX2_SELECT_RX;
POPUP_MENU_START(onUpdateReceiverSelection);
}
popupMenuTitle = STR_PXX2_SELECT_RX;
CLEAR_POPUP();
POPUP_MENU_START(onUpdateReceiverSelection);
}
else {
POPUP_WAIT(STR_WAITING_FOR_RX);
@@ -44,7 +44,7 @@ void menuRadioSpectrumAnalyser(event_t event)
lcdRefresh();
moduleState[g_moduleIdx].readModuleInformation(&reusableBuffer.moduleSetup.pxx2.moduleInformation, PXX2_HW_INFO_TX_ID, PXX2_HW_INFO_TX_ID);
/* wait 1s to resume normal operation before leaving */
watchdogSuspend(1000);
watchdogSuspend(500 /*5s*/);
RTOS_WAIT_MS(1000);
return;
}
+1 -1
View File
@@ -44,7 +44,7 @@ void readModelNotes()
menuTextView(event);
event = getEvent();
lcdRefresh();
wdt_reset();
WDG_RESET();
}
LED_ERROR_END();