Merge branch '2.3' into 3djc/fix-modelchange-module-power
This commit is contained in:
@@ -236,7 +236,8 @@ inline uint8_t MODULE_SUBTYPE_ROWS(int moduleIdx)
|
||||
}
|
||||
|
||||
#define POT_WARN_ROWS ((g_model.potsWarnMode) ? (uint8_t)(NUM_POTS+NUM_SLIDERS) : (uint8_t)0)
|
||||
#define TIMER_ROWS 2, 0, 0, 0, 0
|
||||
#define TIMER_ROWS(x) 2, 0, 0, 0, g_model.timers[x].countdownBeep != COUNTDOWN_SILENT ? (uint8_t)1 : (uint8_t)0
|
||||
#define TIMERS_ROWS TIMER_ROWS(0), TIMER_ROWS(1), TIMER_ROWS(2)
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
#define EXTRA_MODULE_ROWS LABEL(ExtraModule), 1, 2,
|
||||
@@ -306,6 +307,27 @@ void onBluetoothConnectMenu(const char * result)
|
||||
}
|
||||
#endif
|
||||
|
||||
void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event)
|
||||
{
|
||||
TimerData & timer = g_model.timers[timerIdx];
|
||||
lcdDrawTextAlignedLeft(y, STR_BEEPCOUNTDOWN);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VBEEPCOUNTDOWN, timer.countdownBeep, (menuHorizontalPosition == 0 ? attr : 0));
|
||||
if (timer.countdownBeep != COUNTDOWN_SILENT) {
|
||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN + 6 * FW, y, TIMER_COUNTDOWN_START(timerIdx), (menuHorizontalPosition == 1 ? attr : 0) | LEFT);
|
||||
lcdDrawChar(lcdLastRightPos, y, 's');
|
||||
}
|
||||
if (attr && s_editMode > 0) {
|
||||
switch (menuHorizontalPosition) {
|
||||
case 0:
|
||||
CHECK_INCDEC_MODELVAR(event, timer.countdownBeep, COUNTDOWN_SILENT, COUNTDOWN_COUNT - 1);
|
||||
break;
|
||||
case 1:
|
||||
timer.countdownStart = -checkIncDecModel(event, -timer.countdownStart, -1, +2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "common/stdlcd/model_setup_pxx1.cpp"
|
||||
|
||||
#if defined(PXX2)
|
||||
@@ -375,9 +397,7 @@ void menuModelSetup(event_t event)
|
||||
MENU_TAB({
|
||||
HEADER_LINE_COLUMNS
|
||||
0,
|
||||
TIMER_ROWS,
|
||||
TIMER_ROWS,
|
||||
TIMER_ROWS,
|
||||
TIMERS_ROWS,
|
||||
0, // Extended limits
|
||||
1, // Extended trims
|
||||
0, // Show trims
|
||||
@@ -408,9 +428,7 @@ void menuModelSetup(event_t event)
|
||||
MENU_TAB({
|
||||
HEADER_LINE_COLUMNS
|
||||
0,
|
||||
TIMER_ROWS,
|
||||
TIMER_ROWS,
|
||||
TIMER_ROWS,
|
||||
TIMERS_ROWS,
|
||||
0, // Extended limits
|
||||
1, // Extended trims
|
||||
0, // Show trims
|
||||
@@ -489,7 +507,7 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
|
||||
uint8_t moduleIdx = CURRENT_MODULE_EDITED(k);
|
||||
LcdFlags blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||
LcdFlags blink = ((s_editMode > 0) ? BLINK|INVERS : INVERS);
|
||||
LcdFlags attr = (sub == k ? blink : 0);
|
||||
|
||||
switch (k) {
|
||||
@@ -520,7 +538,7 @@ void menuModelSetup(event_t event)
|
||||
timerMode += TMRMODE_COUNT-1;
|
||||
timer->mode = timerMode;
|
||||
#if defined(AUTOSWITCH)
|
||||
if (s_editMode>0) {
|
||||
if (s_editMode > 0) {
|
||||
int8_t val = timer->mode - (TMRMODE_COUNT-1);
|
||||
int8_t switchVal = checkIncDecMovedSwitch(val);
|
||||
if (val != switchVal) {
|
||||
@@ -568,8 +586,7 @@ void menuModelSetup(event_t event)
|
||||
case ITEM_MODEL_SETUP_TIMER2_COUNTDOWN_BEEP:
|
||||
case ITEM_MODEL_SETUP_TIMER3_COUNTDOWN_BEEP:
|
||||
{
|
||||
TimerData * timer = &g_model.timers[k>=ITEM_MODEL_SETUP_TIMER3 ? 2 : (k>=ITEM_MODEL_SETUP_TIMER2 ? 1 : 0)];
|
||||
timer->countdownBeep = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_BEEPCOUNTDOWN, STR_VBEEPCOUNTDOWN, timer->countdownBeep, COUNTDOWN_SILENT, COUNTDOWN_COUNT-1, attr, event);
|
||||
editTimerCountdown(k>=ITEM_MODEL_SETUP_TIMER3 ? 2 : (k>=ITEM_MODEL_SETUP_TIMER2 ? 1 : 0), y, attr, event);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ void onHardwareAntennaSwitchConfirm(const char * result)
|
||||
#define EXTERNAL_ANTENNA_ROW
|
||||
#endif
|
||||
|
||||
#if (defined(CROSSFIRE) || defined(GHOST))
|
||||
#if (defined(CROSSFIRE) || defined(GHOST)) && (SPORT_MAX_BAUDRATE < 400000 || defined(DEBUG))
|
||||
#define MAX_BAUDRATE_ROW 0
|
||||
#else
|
||||
#define MAX_BAUDRATE_ROW HIDDEN_ROW
|
||||
|
||||
@@ -284,7 +284,7 @@ enum {
|
||||
#define TX_CAPACITY_MEASUREMENT_ROWS
|
||||
#endif
|
||||
|
||||
#if (defined(CROSSFIRE) || defined(GHOST)) && SPORT_MAX_BAUDRATE < 400000
|
||||
#if (defined(CROSSFIRE) || defined(GHOST)) && (SPORT_MAX_BAUDRATE < 400000 || defined(DEBUG))
|
||||
#define MAX_BAUD_ROWS 0,
|
||||
#else
|
||||
#define MAX_BAUD_ROWS
|
||||
|
||||
@@ -108,15 +108,15 @@ static void sendFailsafeChannels(uint8_t moduleIdx)
|
||||
int16_t failsafeValue = g_model.failsafeChannels[i];
|
||||
int pulseValue;
|
||||
|
||||
if (g_model.moduleData[moduleIdx].failsafeMode == FAILSAFE_HOLD) {
|
||||
if (g_model.moduleData[moduleIdx].failsafeMode == FAILSAFE_HOLD || failsafeValue == FAILSAFE_CHANNEL_HOLD) {
|
||||
pulseValue = 2047;
|
||||
}
|
||||
else if (g_model.moduleData[moduleIdx].failsafeMode == FAILSAFE_NOPULSES) {
|
||||
else if (g_model.moduleData[moduleIdx].failsafeMode == FAILSAFE_NOPULSES || failsafeValue == FAILSAFE_CHANNEL_NOPULSE) {
|
||||
pulseValue = 0;
|
||||
}
|
||||
else {
|
||||
failsafeValue += 2 * PPM_CH_CENTER(g_model.moduleData[moduleIdx].channelsStart + i) - 2 * PPM_CENTER;
|
||||
pulseValue = limit(1, (failsafeValue * 800 / 1000) + 1024, 2047);
|
||||
pulseValue = limit(1, (failsafeValue * 800 / 1000) + 1024, 2046);
|
||||
}
|
||||
|
||||
bits |= pulseValue << bitsavailable;
|
||||
|
||||
@@ -21,10 +21,6 @@
|
||||
#include "opentx.h"
|
||||
#include "targets/horus/board.h"
|
||||
|
||||
#if defined(SBUS)
|
||||
extern Fifo<uint8_t, 32> trainerSbusFifo;
|
||||
#endif
|
||||
|
||||
#if defined(AUX_SERIAL)
|
||||
uint8_t auxSerialMode = UART_MODE_COUNT; // Prevent debug output before port is setup
|
||||
Fifo<uint8_t, 512> auxSerialTxFifo;
|
||||
@@ -416,4 +412,4 @@ extern "C" void AUX2_SERIAL_USART_IRQHandler(void)
|
||||
}
|
||||
}
|
||||
#endif // SIMU
|
||||
#endif // AUX2_SERIAL
|
||||
#endif // AUX2_SERIAL
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
#if defined(SBUS_TRAINER)
|
||||
Fifo<uint8_t, 32> trainerSbusFifo;
|
||||
#endif
|
||||
|
||||
void trainerSendNextFrame();
|
||||
|
||||
void init_trainer_ppm()
|
||||
@@ -174,4 +170,4 @@ int sbusGetByte(uint8_t * byte)
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,17 +213,7 @@ void OpenTxSimulator::setTrim(unsigned int idx, int value)
|
||||
if (i < 4) // swap axes
|
||||
i = modn12x3[4 * getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightMode(getFlightMode(), i);
|
||||
|
||||
if (!setTrimValue(phase, i, value)) {
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->setSingleShot(true);
|
||||
connect(timer, &QTimer::timeout, [=]() {
|
||||
emit trimValueChange(idx, 0);
|
||||
emit outputValueChange(OUTPUT_SRC_TRIM_VALUE, idx, 0);
|
||||
timer->deleteLater();
|
||||
});
|
||||
timer->start(350);
|
||||
}
|
||||
setTrimValue(phase, i, value);
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setTrainerInput(unsigned int inputNumber, int16_t value)
|
||||
|
||||
@@ -32,16 +32,6 @@ RTOS_DEFINE_STACK(audioStack, AUDIO_STACK_SIZE);
|
||||
RTOS_MUTEX_HANDLE audioMutex;
|
||||
RTOS_MUTEX_HANDLE mixerMutex;
|
||||
|
||||
enum TaskIndex {
|
||||
MENU_TASK_INDEX,
|
||||
MIXER_TASK_INDEX,
|
||||
AUDIO_TASK_INDEX,
|
||||
CLI_TASK_INDEX,
|
||||
BLUETOOTH_TASK_INDEX,
|
||||
TASK_INDEX_COUNT,
|
||||
MAIN_TASK_INDEX = 255
|
||||
};
|
||||
|
||||
void stackPaint()
|
||||
{
|
||||
menusStack.paint();
|
||||
|
||||
@@ -102,7 +102,7 @@ const uint8_t CROSSFIRE_PERIODS[] = {
|
||||
4,
|
||||
16,
|
||||
};
|
||||
#if SPORT_MAX_BAUDRATE < 400000
|
||||
#if SPORT_MAX_BAUDRATE < 400000 || defined(DEBUG)
|
||||
#define CROSSFIRE_BAUDRATE CROSSFIRE_BAUDRATES[g_eeGeneral.telemetryBaudrate]
|
||||
#define CROSSFIRE_PERIOD CROSSFIRE_PERIODS[g_eeGeneral.telemetryBaudrate]
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user