mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 17:25:13 +03:00
No "Telemetry lost" during BIND mode
This commit is contained in:
parent
edb4f9a966
commit
6c27c60319
8 changed files with 50 additions and 35 deletions
|
@ -1599,7 +1599,7 @@ void menuModelSetup(event_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PXX)
|
#if defined(PXX)
|
||||||
if (IS_RANGECHECK_ENABLE()) {
|
if (isModuleInRangeCheckMode()) {
|
||||||
showMessageBox("RSSI: ");
|
showMessageBox("RSSI: ");
|
||||||
lcdDrawNumber(WARNING_LINE_X, 5*FH, TELEMETRY_RSSI(), BOLD);
|
lcdDrawNumber(WARNING_LINE_X, 5*FH, TELEMETRY_RSSI(), BOLD);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1411,7 +1411,7 @@ void menuModelSetup(event_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PXX)
|
#if defined(PXX)
|
||||||
if (IS_RANGECHECK_ENABLE()) {
|
if (isModuleInRangeCheckMode()) {
|
||||||
showMessageBox("RSSI: ");
|
showMessageBox("RSSI: ");
|
||||||
lcdDrawNumber(WARNING_LINE_X, 5*FH, TELEMETRY_RSSI(), BOLD | LEFT);
|
lcdDrawNumber(WARNING_LINE_X, 5*FH, TELEMETRY_RSSI(), BOLD | LEFT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -486,7 +486,6 @@ void insertMix(uint8_t idx);
|
||||||
#define WARNING_INFOLINE_Y (WARNING_LINE_Y+68)
|
#define WARNING_INFOLINE_Y (WARNING_LINE_Y+68)
|
||||||
|
|
||||||
void copySelection(char * dst, const char * src, uint8_t size);
|
void copySelection(char * dst, const char * src, uint8_t size);
|
||||||
|
|
||||||
void drawPopupBackgroundAndBorder(coord_t x, coord_t y, coord_t w, coord_t h);
|
void drawPopupBackgroundAndBorder(coord_t x, coord_t y, coord_t w, coord_t h);
|
||||||
void showMessageBox(const char * title);
|
void showMessageBox(const char * title);
|
||||||
void runPopupWarning(event_t event);
|
void runPopupWarning(event_t event);
|
||||||
|
@ -516,7 +515,7 @@ extern uint8_t popupMenuOffsetType;
|
||||||
extern uint8_t popupMenuSelectedItem;
|
extern uint8_t popupMenuSelectedItem;
|
||||||
const char * runPopupMenu(event_t event);
|
const char * runPopupMenu(event_t event);
|
||||||
|
|
||||||
typedef void (* PopupMenuHandler)(const char * result);
|
typedef void (* PopupMenuHandler)(const char * result);
|
||||||
extern PopupMenuHandler popupMenuHandler;
|
extern PopupMenuHandler popupMenuHandler;
|
||||||
|
|
||||||
inline void POPUP_INPUT(const char * s, PopupFunc func)
|
inline void POPUP_INPUT(const char * s, PopupFunc func)
|
||||||
|
|
|
@ -1369,9 +1369,6 @@ bool menuModelSetup(event_t event)
|
||||||
// popupMenuTitle = STR_PXX2_SELECT_RX;
|
// popupMenuTitle = STR_PXX2_SELECT_RX;
|
||||||
POPUP_MENU_START(onPXX2BindMenu);
|
POPUP_MENU_START(onPXX2BindMenu);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
POPUP_WAIT(STR_WAITING_FOR_RX);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1645,7 +1642,7 @@ bool menuModelSetup(event_t event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_RANGECHECK_ENABLE()) {
|
if (isModuleInRangeCheckMode()) {
|
||||||
theme->drawMessageBox("RSSI :", NULL, NULL, WARNING_TYPE_INFO);
|
theme->drawMessageBox("RSSI :", NULL, NULL, WARNING_TYPE_INFO);
|
||||||
lcdDrawNumber(WARNING_LINE_X, WARNING_INFOLINE_Y, TELEMETRY_RSSI(), DBLSIZE|LEFT);
|
lcdDrawNumber(WARNING_LINE_X, WARNING_INFOLINE_Y, TELEMETRY_RSSI(), DBLSIZE|LEFT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,22 +34,6 @@ uint16_t popupMenuOffset = 0;
|
||||||
uint8_t popupMenuOffsetType = MENU_OFFSET_INTERNAL;
|
uint8_t popupMenuOffsetType = MENU_OFFSET_INTERNAL;
|
||||||
void (*popupMenuHandler)(const char * result);
|
void (*popupMenuHandler)(const char * result);
|
||||||
|
|
||||||
void runPopupWarningBox()
|
|
||||||
{
|
|
||||||
// theme->drawMessageBox("", "", "", MESSAGEBOX_TYPE_WARNING);
|
|
||||||
// lcdDrawSolidFilledRect(POPUP_X, POPUP_Y, POPUP_W, POPUP_H, TEXT_BGCOLOR);
|
|
||||||
// lcdDrawSolidRect(POPUP_X, POPUP_Y, POPUP_W, POPUP_H, 2, ALARM_COLOR);
|
|
||||||
// lcdDrawBitmap(POPUP_X+15, POPUP_Y+20, LBM_WARNING);
|
|
||||||
}
|
|
||||||
|
|
||||||
void drawMessageBox()
|
|
||||||
{
|
|
||||||
// theme->drawMessageBox("", "", "", MESSAGEBOX_TYPE_INFO);
|
|
||||||
// lcdDrawSolidFilledRect(POPUP_X, POPUP_Y, POPUP_W, POPUP_H, TEXT_BGCOLOR);
|
|
||||||
// lcdDrawSolidRect(POPUP_X, POPUP_Y, POPUP_W, POPUP_H, 2, WARNING_COLOR);
|
|
||||||
// lcdDrawBitmap(POPUP_X+15, POPUP_Y+20, LBM_MESSAGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
void drawAlertBox(const char * title, const char * text, const char * action)
|
void drawAlertBox(const char * title, const char * text, const char * action)
|
||||||
{
|
{
|
||||||
theme->drawMessageBox(title, text, action, WARNING_TYPE_ALERT);
|
theme->drawMessageBox(title, text, action, WARNING_TYPE_ALERT);
|
||||||
|
@ -83,7 +67,21 @@ void runPopupWarning(event_t event)
|
||||||
{
|
{
|
||||||
warningResult = false;
|
warningResult = false;
|
||||||
|
|
||||||
theme->drawMessageBox(warningText, warningInfoText, warningType == WARNING_TYPE_INFO ? STR_OK : (warningType == WARNING_TYPE_ASTERISK ? STR_EXIT : STR_POPUPS_ENTER_EXIT), warningType);
|
const char * action;
|
||||||
|
switch (warningType) {
|
||||||
|
case WARNING_TYPE_INFO:
|
||||||
|
action = STR_OK;
|
||||||
|
break;
|
||||||
|
case WARNING_TYPE_ASTERISK:
|
||||||
|
case WARNING_TYPE_WAIT:
|
||||||
|
action = STR_EXIT;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
action = STR_POPUPS_ENTER_EXIT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
theme->drawMessageBox(warningText, warningInfoText, action, warningType);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case EVT_KEY_BREAK(KEY_ENTER):
|
case EVT_KEY_BREAK(KEY_ENTER):
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _MODULES_H_
|
#ifndef _MODULES_HELPERS_H_
|
||||||
#define _MODULES_H_
|
#define _MODULES_HELPERS_H_
|
||||||
|
|
||||||
#include "bitfield.h"
|
#include "bitfield.h"
|
||||||
#include "definitions.h"
|
#include "definitions.h"
|
||||||
|
@ -479,4 +479,4 @@ inline void removePXX2ReceiverIfEmpty(uint8_t moduleIdx, uint8_t receiverIdx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _MODULES_H_
|
#endif // _MODULES_HELPERS_H_
|
||||||
|
|
|
@ -29,12 +29,6 @@
|
||||||
#include "modules_helpers.h"
|
#include "modules_helpers.h"
|
||||||
#include "ff.h"
|
#include "ff.h"
|
||||||
|
|
||||||
#if NUM_MODULES > 1
|
|
||||||
#define IS_RANGECHECK_ENABLE() (moduleState[0].mode == MODULE_MODE_RANGECHECK || moduleState[1].mode == MODULE_MODE_RANGECHECK)
|
|
||||||
#else
|
|
||||||
#define IS_RANGECHECK_ENABLE() (moduleState[0].mode == MODULE_MODE_RANGECHECK)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PCBSKY9X) && defined(DSM2)
|
#if defined(PCBSKY9X) && defined(DSM2)
|
||||||
#define DSM2_BIND_TIMEOUT 255 // 255*11ms
|
#define DSM2_BIND_TIMEOUT 255 // 255*11ms
|
||||||
extern uint8_t dsm2BindTimer;
|
extern uint8_t dsm2BindTimer;
|
||||||
|
@ -404,5 +398,30 @@ inline void SEND_FAILSAFE_1S()
|
||||||
// for channels not set previously to HOLD or NOPULSE
|
// for channels not set previously to HOLD or NOPULSE
|
||||||
void setCustomFailsafe(uint8_t moduleIndex);
|
void setCustomFailsafe(uint8_t moduleIndex);
|
||||||
|
|
||||||
|
inline bool isModuleInRangeCheckMode()
|
||||||
|
{
|
||||||
|
if (moduleState[0].mode == MODULE_MODE_RANGECHECK)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
#if NUM_MODULES > 1
|
||||||
|
if (moduleState[1].mode == MODULE_MODE_RANGECHECK)
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool isModuleInBeepMode()
|
||||||
|
{
|
||||||
|
if (moduleState[0].mode >= MODULE_MODE_BEEP_FIRST)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
#if NUM_MODULES > 1
|
||||||
|
if (moduleState[1].mode >= MODULE_MODE_BEEP_FIRST)
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#endif // _PULSES_H_
|
#endif // _PULSES_H_
|
||||||
|
|
|
@ -200,7 +200,9 @@ void telemetryWakeup()
|
||||||
}
|
}
|
||||||
else if (telemetryState == TELEMETRY_OK) {
|
else if (telemetryState == TELEMETRY_OK) {
|
||||||
telemetryState = TELEMETRY_KO;
|
telemetryState = TELEMETRY_KO;
|
||||||
AUDIO_TELEMETRY_LOST();
|
if (!isModuleInBeepMode()) {
|
||||||
|
AUDIO_TELEMETRY_LOST();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue