mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 08:45:24 +03:00
Merge branch '2.3' into shmuely/widget-Timer2
This commit is contained in:
commit
1e3af7372c
58 changed files with 1077 additions and 693 deletions
38
CREDITS.txt
38
CREDITS.txt
|
@ -1450,3 +1450,41 @@ Edmond Dufresne
|
|||
Jaroslav Gazik
|
||||
Philippe Desrichard
|
||||
Vincent Heron
|
||||
Marcel Schäfer
|
||||
Stefano Pascucci
|
||||
Frédéric Bourgois
|
||||
Stefan Hufnagl
|
||||
Jean Philippe Bonacci
|
||||
Jack Mitchell
|
||||
Santiago Iglesias Garcia
|
||||
Steve Kurywchak
|
||||
Tore Skjefstad
|
||||
Sergio Digiandco di Molino
|
||||
Xavier Delepine
|
||||
Miles Shearman
|
||||
Bernard Teyssier
|
||||
Entel Consulting BVBA
|
||||
Stuart Olson
|
||||
Maximilian Wechselberger
|
||||
Kenneth Crump
|
||||
Ken Elder
|
||||
Darko Perković
|
||||
Martin Krueger
|
||||
Jack Lopes
|
||||
Huguette Viale
|
||||
Didier Christien
|
||||
Pascal Roublot
|
||||
Arnaud Sourisse
|
||||
Aldo Midali
|
||||
Sidney Gates
|
||||
Serhiy Semenenko
|
||||
Miguel Esquer Ramiro
|
||||
Stefan Grunenberg
|
||||
Ferenc Kunkli
|
||||
Stefano Boggia
|
||||
Lee Bennett
|
||||
Morgantech
|
||||
Marek Přikryl
|
||||
Peter Scott
|
||||
Ernst Camenzind
|
||||
Steve Robbins
|
||||
|
|
|
@ -114,7 +114,7 @@ QString ModuleData::protocolToString(unsigned protocol)
|
|||
QStringList ModuleData::powerValueStrings(int subType, Firmware * fw)
|
||||
{
|
||||
static const QStringList strings[] = {
|
||||
{ tr("10mW - 16CH"), tr("100mW - 16CH"), tr("500mW - 16CH"), tr("1W - 16CH") }, // full-size FCC
|
||||
{ tr("10mW - 16CH"), tr("100mW - 16CH"), tr("500mW - 16CH"), tr("Auto <= 1W - 16CH") }, // full-size FCC
|
||||
{ tr("25mW - 8CH"), tr("25mW - 16CH"), tr("200mW - 16CH (no telemetry)"), tr("500mW - 16CH (no telemetry)") }, // full-size EU
|
||||
{ tr("100mW - 16CH") }, // mini FCC
|
||||
{ tr("25mW - 8CH"), tr("25mW - 16CH"), tr("100mW - 16CH (no telemetry)") } // mini EU
|
||||
|
|
|
@ -92,7 +92,13 @@ enum MultiModuleRFProtocols {
|
|||
MM_RF_PROTO_HITEC,
|
||||
MM_RF_PROTO_WFLY,
|
||||
MM_RF_PROTO_BUGS,
|
||||
MM_RF_PROTO_LAST= MM_RF_PROTO_BUGS
|
||||
MM_RF_PROTO_BUGS_MINI,
|
||||
MM_RF_PROTO_TRAXXAS,
|
||||
MM_RF_PROTO_NCC1701,
|
||||
MM_RF_PROTO_E01X,
|
||||
MM_RF_PROTO_V911S,
|
||||
MM_RF_PROTO_GD00X,
|
||||
MM_RF_PROTO_LAST = MM_RF_PROTO_GD00X
|
||||
};
|
||||
|
||||
enum TrainerProtocol {
|
||||
|
|
|
@ -61,6 +61,7 @@ static const QStringList STR_SUBTYPE_CABELL {"Cabell V3", "Cab V3 Telem", "-",
|
|||
static const QStringList STR_SUBTYPE_H83D {"H8 Mini 3D", "H20H", "H20 Mini", "H30 Mini"};
|
||||
static const QStringList STR_SUBTYPE_CORONA {"V1", "V2", "Flydream V3"};
|
||||
static const QStringList STR_SUBTYPE_HITEC {"Optima", "Optima Hub Telem", "Minima"};
|
||||
static const QStringList STR_SUBTYPE_E01X {"E012", "E015"};
|
||||
|
||||
static const QStringList NO_SUBTYPE {STR_MULTI_DEFAULT};
|
||||
|
||||
|
@ -95,6 +96,7 @@ const Multiprotocols multiProtocols {
|
|||
{MM_RF_PROTO_H83D, 3, false, STR_SUBTYPE_H83D, nullptr},
|
||||
{MM_RF_PROTO_CORONA, 2, false, STR_SUBTYPE_CORONA, STR_MULTI_RFTUNE},
|
||||
{MM_RF_PROTO_HITEC, 2, false, STR_SUBTYPE_HITEC, STR_MULTI_RFTUNE},
|
||||
{MM_RF_PROTO_E01X, 1, false, STR_SUBTYPE_E01X, nullptr},
|
||||
{MM_RF_CUSTOM_SELECTED, 7, true, STR_SUBTYPE_CUSTOM, STR_MULTI_OPTION},
|
||||
|
||||
// Sentinel and default for protocols not listed above (MM_RF_CUSTOM is 0xff)
|
||||
|
@ -136,7 +138,7 @@ QString Multiprotocols::protocolToString(int protocol, bool custom)
|
|||
"FlySky", "Hubsan", "FrSky", "Hisky", "V2x2", "DSM", "Devo", "YD717", "KN", "SymaX", "SLT", "CX10", "CG023",
|
||||
"Bayang", "ESky", "MT99XX", "MJXQ", "Shenqi", "FY326", "SFHSS", "J6 PRO","FQ777","Assan","Hontai","Open LRS",
|
||||
"FlySky AFHDS2A", "Q2x2", "Walkera", "Q303", "GW008", "DM002", "Cabell", "ESky 150", "H8 3D", "Corona", "CFlie",
|
||||
"Hitec", "Wfly", "Bugs"
|
||||
"Hitec", "Wfly", "Bugs", "Bugs Mini", "Traxxas", "NCC-1701-A", "E01X", "V911S", "GD00X"
|
||||
});
|
||||
|
||||
if (protocol == MM_RF_CUSTOM_SELECTED || custom)
|
||||
|
|
|
@ -863,16 +863,8 @@ void MainWindow::sdsync()
|
|||
|
||||
void MainWindow::changelog()
|
||||
{
|
||||
Firmware * firmware = getCurrentFirmware();
|
||||
QString url = firmware->getReleaseNotesUrl();
|
||||
if (url.isEmpty()) {
|
||||
QMessageBox::information(this, tr("Release notes"), tr("Cannot retrieve release notes from the server."));
|
||||
}
|
||||
else {
|
||||
ReleaseNotesFirmwareDialog * dialog = new ReleaseNotesFirmwareDialog(this, url);
|
||||
dialog->exec();
|
||||
dialog->deleteLater();
|
||||
}
|
||||
QString link = "http://www.open-tx.org";
|
||||
QDesktopServices::openUrl(QUrl(link));
|
||||
}
|
||||
|
||||
void MainWindow::customizeSplash()
|
||||
|
|
|
@ -1260,7 +1260,7 @@ void MdiChild::openModelEditWindow(int row)
|
|||
gStopwatch.report("ModelEdit creation");
|
||||
ModelEdit * t = new ModelEdit(this, radioData, (row), firmware);
|
||||
gStopwatch.report("ModelEdit created");
|
||||
t->setWindowTitle(tr("Editing model %1: ").arg(row+1) + QString(model.name));
|
||||
t->setWindowTitle(tr("Editing model %1: ").arg(row+1) + QString(model.name) + QString(" (%1)").arg(userFriendlyCurrentFile()));
|
||||
connect(t, &ModelEdit::modified, this, &MdiChild::setModified);
|
||||
gStopwatch.report("STARTING MODEL EDIT");
|
||||
t->show();
|
||||
|
|
|
@ -355,7 +355,7 @@ local function runConfigSummary(event)
|
|||
-- motors
|
||||
if(MotorFields[1][5] == 1) then
|
||||
drawNextLine("Motor chan :", MotorFields[2][5])
|
||||
elseif (MotorFields[2][5] == 2) then
|
||||
elseif (MotorFields[1][5] == 2) then
|
||||
drawNextLine("Motor 1 chan :", MotorFields[2][5])
|
||||
drawNextLine("Motor 2 chan :", MotorFields[3][5])
|
||||
end
|
||||
|
@ -414,7 +414,7 @@ local function createModel(event)
|
|||
-- motor
|
||||
if(MotorFields[1][5] == 1) then
|
||||
addMix(MotorFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor")
|
||||
elseif (MotorFields[2][5] == 2) then
|
||||
elseif (MotorFields[1][5] == 2) then
|
||||
addMix(MotorFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor1")
|
||||
addMix(MotorFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor2")
|
||||
end
|
||||
|
|
|
@ -355,7 +355,7 @@ local function runConfigSummary(event)
|
|||
-- motors
|
||||
if(MotorFields[1][5] == 1) then
|
||||
drawNextLine("Motor chan :", MotorFields[2][5])
|
||||
elseif (MotorFields[2][5] == 2) then
|
||||
elseif (MotorFields[1][5] == 2) then
|
||||
drawNextLine("Motor 1 chan :", MotorFields[2][5])
|
||||
drawNextLine("Motor 2 chan :", MotorFields[3][5])
|
||||
end
|
||||
|
@ -414,7 +414,7 @@ local function createModel(event)
|
|||
-- motor
|
||||
if(MotorFields[1][5] == 1) then
|
||||
addMix(MotorFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor")
|
||||
elseif (MotorFields[2][5] == 2) then
|
||||
elseif (MotorFields[1][5] == 2) then
|
||||
addMix(MotorFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor1")
|
||||
addMix(MotorFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor2")
|
||||
end
|
||||
|
|
|
@ -47,6 +47,7 @@ option(FRSKY_STICKS "Reverse sticks for FrSky sticks" OFF)
|
|||
option(NANO "Use nano newlib and binalloc")
|
||||
option(NIGHTLY_BUILD_WARNING "Warn this is a nightly build" OFF)
|
||||
option(MODULE_R9M_FLEX_FW "Add R9M options for non certified firmwwares" OFF)
|
||||
option(PXX2 "Enable PXX v2 support" OFF)
|
||||
|
||||
# since we reset all default CMAKE compiler flags for firmware builds, provide an alternate way for user to specify additional flags.
|
||||
set(FIRMWARE_C_FLAGS "" CACHE STRING "Additional flags for firmware target c compiler (note: all CMAKE_C_FLAGS[_*] are ignored for firmware/bootloader).")
|
||||
|
@ -313,7 +314,11 @@ if(NIGHTLY_BUILD_WARNING)
|
|||
endif(NIGHTLY_BUILD_WARNING)
|
||||
|
||||
if(MODULE_R9M_FLEX_FW)
|
||||
add_definitions(-DMODULE_R9M_FLEX_FW)
|
||||
add_definitions(-DMODULE_R9M_FLEX_FW)
|
||||
endif()
|
||||
|
||||
if(PXX2)
|
||||
add_definitions(-DPXX2)
|
||||
endif()
|
||||
|
||||
set(SRC
|
||||
|
|
|
@ -524,7 +524,7 @@ enum MixSources {
|
|||
MIXSRC_LAST_INPUT = MIXSRC_FIRST_INPUT+MAX_INPUTS-1,
|
||||
|
||||
#if defined(LUA_INPUTS)
|
||||
MIXSRC_FIRST_LUA,
|
||||
MIXSRC_FIRST_LUA, LUA_EXPORT_MULTIPLE("lua", "Lua mix output %d", MAX_SCRIPTS*MAX_SCRIPT_OUTPUTS)
|
||||
MIXSRC_LAST_LUA = MIXSRC_FIRST_LUA+(MAX_SCRIPTS*MAX_SCRIPT_OUTPUTS)-1,
|
||||
#endif
|
||||
|
||||
|
@ -699,7 +699,7 @@ enum MixSources {
|
|||
MIXSRC_TIMER3, LUA_EXPORT("timer3", "Timer 3 value [seconds]")
|
||||
MIXSRC_LAST_TIMER = MIXSRC_TIMER3,
|
||||
|
||||
MIXSRC_FIRST_TELEM,
|
||||
MIXSRC_FIRST_TELEM, LUA_EXPORT_MULTIPLE("telem", "Telemetry sensor %d", MAX_TELEMETRY_SENSORS)
|
||||
MIXSRC_LAST_TELEM = MIXSRC_FIRST_TELEM+3*MAX_TELEMETRY_SENSORS-1
|
||||
};
|
||||
|
||||
|
|
|
@ -33,12 +33,12 @@ void drawColumnHeader(const char * const * headers, const char * const * descrip
|
|||
}
|
||||
}
|
||||
|
||||
const uint8_t __alpha_button_on[] {
|
||||
static const uint8_t __alpha_button_on[] __ALIGNED(4) = {
|
||||
#include "alpha_button_on.lbm"
|
||||
};
|
||||
Bitmap ALPHA_BUTTON_ON(BMP_ARGB4444, (const uint16_t*)__alpha_button_on);
|
||||
|
||||
const uint8_t __alpha_button_off[] {
|
||||
static const uint8_t __alpha_button_off[] __ALIGNED(4) = {
|
||||
#include "alpha_button_off.lbm"
|
||||
};
|
||||
Bitmap ALPHA_BUTTON_OFF(BMP_ARGB4444, (const uint16_t*)__alpha_button_off);
|
||||
|
|
|
@ -680,6 +680,7 @@ const char STR_SUBTYPE_CABELL[] = "\007""V3\0 ""V3 Telm""-\0 ""-\0 "
|
|||
const char STR_SUBTYPE_H83D[] = "\007""Std\0 ""H20H\0 ""H20Mini""H30Mini";
|
||||
const char STR_SUBTYPE_CORONA[] = "\006"" V1\0 "" V2\0 "" FD V3";
|
||||
const char STR_SUBTYPE_HITEC[] = "\007""Optima\0""Opt Hub""Minima\0";
|
||||
const char STR_SUBTYPE_E01X[] = "\004""E012""E015";
|
||||
|
||||
const mm_protocol_definition multi_protocols[] = {
|
||||
|
||||
|
@ -710,6 +711,7 @@ const mm_protocol_definition multi_protocols[] = {
|
|||
{MM_RF_PROTO_H83D, 3, false, STR_SUBTYPE_H83D, nullptr},
|
||||
{MM_RF_PROTO_CORONA, 2, false, STR_SUBTYPE_CORONA, STR_MULTI_RFTUNE},
|
||||
{MM_RF_PROTO_HITEC, 2, false, STR_SUBTYPE_HITEC, STR_MULTI_RFTUNE},
|
||||
{MM_RF_PROTO_E01X, 1, false, STR_SUBTYPE_E01X, nullptr},
|
||||
{MM_RF_CUSTOM_SELECTED, 7, true, NO_SUBTYPE, STR_MULTI_OPTION},
|
||||
|
||||
// Sentinel and default for protocols not listed above (MM_RF_CUSTOM is 0xff)
|
||||
|
|
27
radio/src/io/pxx2.h
Normal file
27
radio/src/io/pxx2.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef _IO_PXX2_H_
|
||||
#define _IO_PXX2_H_
|
||||
|
||||
#define PXX2_BAUDRATE 230400
|
||||
#define PXX2_PERIOD 4 // 4ms
|
||||
|
||||
#endif
|
|
@ -301,7 +301,10 @@ bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags)
|
|||
continue;
|
||||
}
|
||||
if (index < luaMultipleFields[n].count) {
|
||||
field.id = luaMultipleFields[n].id + index;
|
||||
if(luaMultipleFields[n].id == MIXSRC_FIRST_TELEM)
|
||||
field.id = luaMultipleFields[n].id + index*3;
|
||||
else
|
||||
field.id = luaMultipleFields[n].id + index;
|
||||
if (flags & FIND_FIELD_DESC) {
|
||||
snprintf(field.desc, sizeof(field.desc)-1, luaMultipleFields[n].desc, index+1);
|
||||
field.desc[sizeof(field.desc)-1] = '\0';
|
||||
|
|
|
@ -342,10 +342,16 @@ enum Protocols {
|
|||
#endif
|
||||
PROTO_MULTIMODULE,
|
||||
PROTO_SBUS,
|
||||
PROTO_MAX,
|
||||
PROTO_PXX2,
|
||||
PROTO_NONE
|
||||
};
|
||||
|
||||
#if defined(PXX2)
|
||||
#define PROTO_PXX_EXTERNAL_MODULE PROTO_PXX2
|
||||
#else
|
||||
#define PROTO_PXX_EXTERNAL_MODULE PROTO_PXX
|
||||
#endif
|
||||
|
||||
enum XJTRFProtocols {
|
||||
RF_PROTO_OFF = -1,
|
||||
RF_PROTO_X16,
|
||||
|
@ -405,7 +411,13 @@ enum MultiModuleRFProtocols {
|
|||
MM_RF_PROTO_HITEC,
|
||||
MM_RF_PROTO_WFLY,
|
||||
MM_RF_PROTO_BUGS,
|
||||
MM_RF_PROTO_LAST= MM_RF_PROTO_BUGS
|
||||
MM_RF_PROTO_BUGS_MINI,
|
||||
MM_RF_PROTO_TRAXXAS,
|
||||
MM_RF_PROTO_NCC1701,
|
||||
MM_RF_PROTO_E01X,
|
||||
MM_RF_PROTO_V911S,
|
||||
MM_RF_PROTO_GD00X,
|
||||
MM_RF_PROTO_LAST = MM_RF_PROTO_GD00X
|
||||
};
|
||||
|
||||
enum MMDSM2Subtypes {
|
||||
|
|
|
@ -193,7 +193,7 @@ inline int8_t defaultModuleChannels_M8(uint8_t idx)
|
|||
else if (isModuleMultimoduleDSM2(idx))
|
||||
return -1; // 7 channels
|
||||
else
|
||||
return 8; // 16 channels
|
||||
return maxModuleChannels_M8(idx);
|
||||
}
|
||||
|
||||
inline int8_t sentModuleChannels(uint8_t idx)
|
||||
|
|
|
@ -20,6 +20,11 @@
|
|||
|
||||
#include "opentx.h"
|
||||
|
||||
#if defined(PXX2)
|
||||
#include "io/pxx2.h"
|
||||
#include "pulses/pxx2.h"
|
||||
#endif
|
||||
|
||||
uint8_t s_pulses_paused = 0;
|
||||
uint8_t s_current_protocol[NUM_MODULES] = { MODULES_INIT(255) };
|
||||
uint16_t failsafeCounter[NUM_MODULES] = { MODULES_INIT(100) };
|
||||
|
@ -56,14 +61,13 @@ uint8_t getRequiredProtocol(uint8_t port)
|
|||
#endif
|
||||
|
||||
default:
|
||||
port = EXTERNAL_MODULE; // ensure it's external module only
|
||||
switch (g_model.moduleData[EXTERNAL_MODULE].type) {
|
||||
case MODULE_TYPE_PPM:
|
||||
required_protocol = PROTO_PPM;
|
||||
break;
|
||||
case MODULE_TYPE_XJT:
|
||||
case MODULE_TYPE_R9M:
|
||||
required_protocol = PROTO_PXX;
|
||||
required_protocol = PROTO_PXX_EXTERNAL_MODULE; // either PXX or PXX2 depending on compilation options
|
||||
break;
|
||||
case MODULE_TYPE_SBUS:
|
||||
required_protocol = PROTO_SBUS;
|
||||
|
@ -118,6 +122,20 @@ uint8_t getRequiredProtocol(uint8_t port)
|
|||
return required_protocol;
|
||||
}
|
||||
|
||||
void setupPulsesPXX(uint8_t port)
|
||||
{
|
||||
#if defined(INTMODULE_USART) && defined(EXTMODULE_USART)
|
||||
modulePulsesData[port].pxx_uart.setupFrame(port);
|
||||
#elif !defined(INTMODULE_USART) && !defined(EXTMODULE_USART)
|
||||
modulePulsesData[port].pxx.setupFrame(port);
|
||||
#else
|
||||
if (IS_UART_MODULE(port))
|
||||
modulePulsesData[port].pxx_uart.setupFrame(port);
|
||||
else
|
||||
modulePulsesData[port].pxx.setupFrame(port);
|
||||
#endif
|
||||
}
|
||||
|
||||
void setupPulses(uint8_t port)
|
||||
{
|
||||
bool init_needed = false;
|
||||
|
@ -142,7 +160,13 @@ void setupPulses(uint8_t port)
|
|||
|
||||
#if defined(CROSSFIRE)
|
||||
case PROTO_CROSSFIRE:
|
||||
disable_crossfire(port);
|
||||
disable_module_timer(port);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(PXX2)
|
||||
case PROTO_PXX2:
|
||||
disable_module_timer(port);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
@ -208,6 +232,16 @@ void setupPulses(uint8_t port)
|
|||
break;
|
||||
#endif
|
||||
|
||||
#if defined(PXX2)
|
||||
case PROTO_PXX2:
|
||||
if (telemetryProtocol == PROTOCOL_FRSKY_SPORT && !init_needed) {
|
||||
modulePulsesData[port].pxx2.setupFrame(port);
|
||||
sportSendBuffer(modulePulsesData[port].pxx2.getData(), modulePulsesData[port].pxx2.getSize());
|
||||
}
|
||||
scheduleNextMixerCalculation(port, PXX2_PERIOD);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(MULTIMODULE)
|
||||
case PROTO_MULTIMODULE:
|
||||
setupPulsesMultimodule(port);
|
||||
|
@ -243,7 +277,13 @@ void setupPulses(uint8_t port)
|
|||
|
||||
#if defined(CROSSFIRE)
|
||||
case PROTO_CROSSFIRE:
|
||||
init_crossfire(port);
|
||||
init_module_timer(port, CROSSFIRE_PERIOD, true);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(PXX2)
|
||||
case PROTO_PXX2:
|
||||
init_module_timer(port, PXX2_PERIOD, true);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -21,20 +21,15 @@
|
|||
#ifndef _PULSES_ARM_H_
|
||||
#define _PULSES_ARM_H_
|
||||
|
||||
#include "pulses/pxx2.h"
|
||||
#include "pulses/pxx1.h"
|
||||
|
||||
#if NUM_MODULES == 2
|
||||
#define MODULES_INIT(...) __VA_ARGS__, __VA_ARGS__
|
||||
#else
|
||||
#define MODULES_INIT(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if defined(PCBX12S) && PCBREV < 13
|
||||
#define pulse_duration_t uint32_t
|
||||
#define trainer_pulse_duration_t uint16_t
|
||||
#else
|
||||
#define pulse_duration_t uint16_t
|
||||
#define trainer_pulse_duration_t uint16_t
|
||||
#endif
|
||||
|
||||
extern uint8_t s_current_protocol[NUM_MODULES];
|
||||
extern uint8_t s_pulses_paused;
|
||||
extern uint16_t failsafeCounter[NUM_MODULES];
|
||||
|
@ -44,30 +39,6 @@ template<class T> struct PpmPulsesData {
|
|||
T * ptr;
|
||||
};
|
||||
|
||||
#if defined(PXX_FREQUENCY_HIGH)
|
||||
#define EXTMODULE_USART_PXX_BAUDRATE 420000
|
||||
#define INTMODULE_USART_PXX_BAUDRATE 450000
|
||||
#define PXX_PERIOD 4/*ms*/
|
||||
#else
|
||||
#define EXTMODULE_USART_PXX_BAUDRATE 115200
|
||||
#define INTMODULE_USART_PXX_BAUDRATE 115200
|
||||
#define PXX_PERIOD 9/*ms*/
|
||||
#endif
|
||||
|
||||
#define PXX_PERIOD_HALF_US (PXX_PERIOD * 2000)
|
||||
|
||||
#if defined(PPM_PIN_SERIAL)
|
||||
PACK(struct PxxSerialPulsesData {
|
||||
uint8_t pulses[64];
|
||||
uint8_t * ptr;
|
||||
uint16_t pcmValue;
|
||||
uint16_t pcmCrc;
|
||||
uint32_t pcmOnesCount;
|
||||
uint16_t serialByte;
|
||||
uint16_t serialBitCount;
|
||||
});
|
||||
#endif
|
||||
|
||||
#if defined(PPM_PIN_SERIAL)
|
||||
PACK(struct Dsm2SerialPulsesData {
|
||||
uint8_t pulses[64];
|
||||
|
@ -86,15 +57,6 @@ PACK(struct Dsm2TimerPulsesData {
|
|||
});
|
||||
#endif
|
||||
|
||||
#if defined(INTMODULE_USART) || defined(EXTMODULE_USART)
|
||||
PACK(struct PxxUartPulsesData {
|
||||
uint8_t pulses[64];
|
||||
uint8_t * ptr;
|
||||
uint16_t pcmCrc;
|
||||
uint16_t _alignment;
|
||||
});
|
||||
#endif
|
||||
|
||||
#define PPM_PERIOD_HALF_US(module) ((g_model.moduleData[module].ppm.frameLength * 5 + 225) * 200) /*half us*/
|
||||
#define PPM_PERIOD(module) (PPM_PERIOD_HALF_US(module) / 2000) /*ms*/
|
||||
#define DSM2_BAUDRATE 125000
|
||||
|
@ -105,26 +67,6 @@ PACK(struct PxxUartPulsesData {
|
|||
#define MULTIMODULE_BAUDRATE 100000
|
||||
#define MULTIMODULE_PERIOD 7 /*ms*/
|
||||
|
||||
#if !defined(INTMODULE_USART) || !defined(EXTMODULE_USART)
|
||||
/* PXX uses 20 bytes (as of Rev 1.1 document) with 8 changes per byte + stop bit ~= 162 max pulses */
|
||||
/* DSM2 uses 2 header + 12 channel bytes, with max 10 changes (8n2) per byte + 16 bits trailer ~= 156 max pulses */
|
||||
/* Multimodule uses 3 bytes header + 22 channel bytes with max 11 changes per byte (8e2) + 16 bits trailer ~= 291 max pulses */
|
||||
/* Multimodule reuses some of the DSM2 function and structs since the protocols are similar enough */
|
||||
/* sbus is 1 byte header, 22 channel bytes (11bit * 16ch) + 1 byte flags */
|
||||
|
||||
#if defined(PXX_FREQUENCY_HIGH)
|
||||
#error "Pulses array needs to be increased (PXX_FREQUENCY=HIGH)"
|
||||
#endif
|
||||
|
||||
PACK(struct PxxTimerPulsesData {
|
||||
pulse_duration_t pulses[200];
|
||||
pulse_duration_t * ptr;
|
||||
uint16_t rest;
|
||||
uint16_t pcmCrc;
|
||||
uint32_t pcmOnesCount;
|
||||
});
|
||||
#endif
|
||||
|
||||
#define CROSSFIRE_FRAME_MAXLEN 64
|
||||
PACK(struct CrossfirePulsesData {
|
||||
uint8_t pulses[CROSSFIRE_FRAME_MAXLEN];
|
||||
|
@ -132,12 +74,16 @@ PACK(struct CrossfirePulsesData {
|
|||
|
||||
union ModulePulsesData {
|
||||
#if defined(INTMODULE_USART) || defined(EXTMODULE_USART)
|
||||
PxxUartPulsesData pxx_uart;
|
||||
UartPxxPulses pxx_uart;
|
||||
#endif
|
||||
#if defined(PPM_PIN_SERIAL)
|
||||
PxxSerialPulsesData pxx;
|
||||
SerialPxxPulses pxx;
|
||||
#elif !defined(INTMODULE_USART) || !defined(EXTMODULE_USART)
|
||||
PxxTimerPulsesData pxx;
|
||||
PwmPxxPulses pxx;
|
||||
#endif
|
||||
|
||||
#if defined(PXX2)
|
||||
Pxx2Pulses pxx2;
|
||||
#endif
|
||||
|
||||
#if defined(PPM_PIN_SERIAL)
|
||||
|
@ -242,10 +188,10 @@ enum R9MLBTPowerValues {
|
|||
|
||||
#define LEN_R9M_REGION "\006"
|
||||
#define TR_R9M_REGION "FCC\0 ""EU\0 ""868MHz""915MHz"
|
||||
#define LEN_R9M_FCC_POWER_VALUES "\006"
|
||||
#define LEN_R9M_FCC_POWER_VALUES "\013"
|
||||
#define LEN_R9M_LBT_POWER_VALUES "\013"
|
||||
#define TR_R9M_FCC_POWER_VALUES "10 mW\0" "100 mW" "500 mW" "1 W\0"
|
||||
#define TR_R9M_LBT_POWER_VALUES "25 mW 8ch\0 ""25 mW 16ch\0" "200 mW 16ch" "500 mW 16ch"
|
||||
#define TR_R9M_FCC_POWER_VALUES "10 mW\0 " "100 mW\0 " "500 mW\0 " "Auto <= 1 W"
|
||||
#define TR_R9M_LBT_POWER_VALUES "25 mW 8ch\0 " "25 mW 16ch\0" "200 mW 16ch" "500 mW 16ch"
|
||||
|
||||
enum R9MFCCPowerValues {
|
||||
R9M_FCC_POWER_10 = 0,
|
||||
|
|
65
radio/src/pulses/pulses_common.h
Normal file
65
radio/src/pulses/pulses_common.h
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef _PULSES_COMMON_H_
|
||||
#define _PULSES_COMMON_H_
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#if defined(PCBX12S) && PCBREV < 13
|
||||
#define pulse_duration_t uint32_t
|
||||
#define trainer_pulse_duration_t uint16_t
|
||||
#else
|
||||
#define pulse_duration_t uint16_t
|
||||
#define trainer_pulse_duration_t uint16_t
|
||||
#endif
|
||||
|
||||
template <class T, int SIZE>
|
||||
class DataBuffer {
|
||||
public:
|
||||
const T * getData()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
uint8_t getSize()
|
||||
{
|
||||
return ptr - data;
|
||||
}
|
||||
|
||||
protected:
|
||||
T data[SIZE];
|
||||
T * ptr;
|
||||
|
||||
void initBuffer()
|
||||
{
|
||||
ptr = data;
|
||||
}
|
||||
};
|
||||
|
||||
template <class T, int SIZE>
|
||||
class PulsesBuffer: public DataBuffer<T, SIZE> {
|
||||
public:
|
||||
T getLast() {
|
||||
return *(DataBuffer<T, SIZE>::ptr - 1);
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
183
radio/src/pulses/pxx.cpp
Normal file
183
radio/src/pulses/pxx.cpp
Normal file
|
@ -0,0 +1,183 @@
|
|||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "pulses/pxx1.h"
|
||||
#include "pulses/pxx2.h"
|
||||
|
||||
const uint16_t PxxCrcMixin::CRCTable[] = {
|
||||
0x0000,0x1189,0x2312,0x329b,0x4624,0x57ad,0x6536,0x74bf,
|
||||
0x8c48,0x9dc1,0xaf5a,0xbed3,0xca6c,0xdbe5,0xe97e,0xf8f7,
|
||||
0x1081,0x0108,0x3393,0x221a,0x56a5,0x472c,0x75b7,0x643e,
|
||||
0x9cc9,0x8d40,0xbfdb,0xae52,0xdaed,0xcb64,0xf9ff,0xe876,
|
||||
0x2102,0x308b,0x0210,0x1399,0x6726,0x76af,0x4434,0x55bd,
|
||||
0xad4a,0xbcc3,0x8e58,0x9fd1,0xeb6e,0xfae7,0xc87c,0xd9f5,
|
||||
0x3183,0x200a,0x1291,0x0318,0x77a7,0x662e,0x54b5,0x453c,
|
||||
0xbdcb,0xac42,0x9ed9,0x8f50,0xfbef,0xea66,0xd8fd,0xc974,
|
||||
0x4204,0x538d,0x6116,0x709f,0x0420,0x15a9,0x2732,0x36bb,
|
||||
0xce4c,0xdfc5,0xed5e,0xfcd7,0x8868,0x99e1,0xab7a,0xbaf3,
|
||||
0x5285,0x430c,0x7197,0x601e,0x14a1,0x0528,0x37b3,0x263a,
|
||||
0xdecd,0xcf44,0xfddf,0xec56,0x98e9,0x8960,0xbbfb,0xaa72,
|
||||
0x6306,0x728f,0x4014,0x519d,0x2522,0x34ab,0x0630,0x17b9,
|
||||
0xef4e,0xfec7,0xcc5c,0xddd5,0xa96a,0xb8e3,0x8a78,0x9bf1,
|
||||
0x7387,0x620e,0x5095,0x411c,0x35a3,0x242a,0x16b1,0x0738,
|
||||
0xffcf,0xee46,0xdcdd,0xcd54,0xb9eb,0xa862,0x9af9,0x8b70,
|
||||
0x8408,0x9581,0xa71a,0xb693,0xc22c,0xd3a5,0xe13e,0xf0b7,
|
||||
0x0840,0x19c9,0x2b52,0x3adb,0x4e64,0x5fed,0x6d76,0x7cff,
|
||||
0x9489,0x8500,0xb79b,0xa612,0xd2ad,0xc324,0xf1bf,0xe036,
|
||||
0x18c1,0x0948,0x3bd3,0x2a5a,0x5ee5,0x4f6c,0x7df7,0x6c7e,
|
||||
0xa50a,0xb483,0x8618,0x9791,0xe32e,0xf2a7,0xc03c,0xd1b5,
|
||||
0x2942,0x38cb,0x0a50,0x1bd9,0x6f66,0x7eef,0x4c74,0x5dfd,
|
||||
0xb58b,0xa402,0x9699,0x8710,0xf3af,0xe226,0xd0bd,0xc134,
|
||||
0x39c3,0x284a,0x1ad1,0x0b58,0x7fe7,0x6e6e,0x5cf5,0x4d7c,
|
||||
0xc60c,0xd785,0xe51e,0xf497,0x8028,0x91a1,0xa33a,0xb2b3,
|
||||
0x4a44,0x5bcd,0x6956,0x78df,0x0c60,0x1de9,0x2f72,0x3efb,
|
||||
0xd68d,0xc704,0xf59f,0xe416,0x90a9,0x8120,0xb3bb,0xa232,
|
||||
0x5ac5,0x4b4c,0x79d7,0x685e,0x1ce1,0x0d68,0x3ff3,0x2e7a,
|
||||
0xe70e,0xf687,0xc41c,0xd595,0xa12a,0xb0a3,0x8238,0x93b1,
|
||||
0x6b46,0x7acf,0x4854,0x59dd,0x2d62,0x3ceb,0x0e70,0x1ff9,
|
||||
0xf78f,0xe606,0xd49d,0xc514,0xb1ab,0xa022,0x92b9,0x8330,
|
||||
0x7bc7,0x6a4e,0x58d5,0x495c,0x3de3,0x2c6a,0x1ef1,0x0f78
|
||||
};
|
||||
|
||||
template <class PxxTransport>
|
||||
void PxxPulses<PxxTransport>::addChannels(uint8_t port, uint8_t sendFailsafe, uint8_t sendUpperChannels)
|
||||
{
|
||||
uint16_t pulseValue = 0;
|
||||
uint16_t pulseValueLow = 0;
|
||||
|
||||
for (int8_t i=0; i<8; i++) {
|
||||
if (sendFailsafe) {
|
||||
if (g_model.moduleData[port].failsafeMode == FAILSAFE_HOLD) {
|
||||
pulseValue = (i < sendUpperChannels ? 4095 : 2047);
|
||||
}
|
||||
else if (g_model.moduleData[port].failsafeMode == FAILSAFE_NOPULSES) {
|
||||
pulseValue = (i < sendUpperChannels ? 2048 : 0);
|
||||
}
|
||||
else {
|
||||
if (i < sendUpperChannels) {
|
||||
int16_t failsafeValue = g_model.moduleData[port].failsafeChannels[8+i];
|
||||
if (failsafeValue == FAILSAFE_CHANNEL_HOLD) {
|
||||
pulseValue = 4095;
|
||||
}
|
||||
else if (failsafeValue == FAILSAFE_CHANNEL_NOPULSE) {
|
||||
pulseValue = 2048;
|
||||
}
|
||||
else {
|
||||
failsafeValue += 2*PPM_CH_CENTER(8+g_model.moduleData[port].channelsStart+i) - 2*PPM_CENTER;
|
||||
pulseValue = limit(2049, (failsafeValue * 512 / 682) + 3072, 4094);
|
||||
}
|
||||
}
|
||||
else {
|
||||
int16_t failsafeValue = g_model.moduleData[port].failsafeChannels[i];
|
||||
if (failsafeValue == FAILSAFE_CHANNEL_HOLD) {
|
||||
pulseValue = 2047;
|
||||
}
|
||||
else if (failsafeValue == FAILSAFE_CHANNEL_NOPULSE) {
|
||||
pulseValue = 0;
|
||||
}
|
||||
else {
|
||||
failsafeValue += 2*PPM_CH_CENTER(g_model.moduleData[port].channelsStart+i) - 2*PPM_CENTER;
|
||||
pulseValue = limit(1, (failsafeValue * 512 / 682) + 1024, 2046);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (i < sendUpperChannels) {
|
||||
int channel = 8 + g_model.moduleData[port].channelsStart + i;
|
||||
int value = channelOutputs[channel] + 2*PPM_CH_CENTER(channel) - 2*PPM_CENTER;
|
||||
pulseValue = limit(2049, (value * 512 / 682) + 3072, 4094);
|
||||
}
|
||||
else if (i < sentModuleChannels(port)) {
|
||||
int channel = g_model.moduleData[port].channelsStart + i;
|
||||
int value = channelOutputs[channel] + 2*PPM_CH_CENTER(channel) - 2*PPM_CENTER;
|
||||
pulseValue = limit(1, (value * 512 / 682) + 1024, 2046);
|
||||
}
|
||||
else {
|
||||
pulseValue = 1024;
|
||||
}
|
||||
}
|
||||
|
||||
if (i & 1) {
|
||||
PxxTransport::addByte(pulseValueLow); // Low byte of channel
|
||||
PxxTransport::addByte(((pulseValueLow >> 8) & 0x0F) | (pulseValue << 4)); // 4 bits each from 2 channels
|
||||
PxxTransport::addByte(pulseValue >> 4); // High byte of channel
|
||||
}
|
||||
else {
|
||||
pulseValueLow = pulseValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class PxxTransport>
|
||||
uint8_t PxxPulses<PxxTransport>::addFlag1(uint8_t port)
|
||||
{
|
||||
uint8_t flag1 = (g_model.moduleData[port].rfProtocol << 6);
|
||||
if (moduleFlag[port] == MODULE_BIND) {
|
||||
flag1 |= (g_eeGeneral.countryCode << 1) | PXX_SEND_BIND;
|
||||
}
|
||||
else if (moduleFlag[port] == MODULE_RANGECHECK) {
|
||||
flag1 |= PXX_SEND_RANGECHECK;
|
||||
}
|
||||
else if (g_model.moduleData[port].failsafeMode != FAILSAFE_NOT_SET && g_model.moduleData[port].failsafeMode != FAILSAFE_RECEIVER) {
|
||||
if (failsafeCounter[port]-- == 0) {
|
||||
failsafeCounter[port] = 1000;
|
||||
flag1 |= PXX_SEND_FAILSAFE;
|
||||
}
|
||||
if (failsafeCounter[port] == 0 && g_model.moduleData[port].channelsCount > 0) {
|
||||
flag1 |= PXX_SEND_FAILSAFE;
|
||||
}
|
||||
}
|
||||
PxxTransport::addByte(flag1);
|
||||
return flag1;
|
||||
}
|
||||
|
||||
template <class PxxTransport>
|
||||
void PxxPulses<PxxTransport>::addExtraFlags(uint8_t port)
|
||||
{
|
||||
// Ext. flag (holds antenna selection on Horus internal module, 0x00 otherwise)
|
||||
uint8_t extra_flags = 0;
|
||||
|
||||
#if defined(PCBHORUS) || defined(PCBXLITE)
|
||||
if (port == INTERNAL_MODULE) {
|
||||
extra_flags |= (g_model.moduleData[port].pxx.external_antenna << 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
extra_flags |= (g_model.moduleData[port].pxx.receiver_telem_off << 1);
|
||||
extra_flags |= (g_model.moduleData[port].pxx.receiver_channel_9_16 << 2);
|
||||
if (isModuleR9M(port)) {
|
||||
extra_flags |= (min<uint8_t>(g_model.moduleData[port].pxx.power, isModuleR9M_FCC_VARIANT(port) ? (uint8_t)R9M_FCC_POWER_MAX : (uint8_t)R9M_LBT_POWER_MAX) << 3);
|
||||
if(isModuleR9M_EUPLUS(port))
|
||||
extra_flags |= (1 << 6);
|
||||
}
|
||||
|
||||
// Disable S.PORT if internal module is active
|
||||
if (IS_TELEMETRY_INTERNAL_MODULE()) {
|
||||
extra_flags |= (1 << 5);
|
||||
}
|
||||
PxxTransport::addByte(extra_flags);
|
||||
}
|
||||
|
||||
template class PxxPulses<StandardPxxTransport<PwmPxxBitTransport> >;
|
||||
template class PxxPulses<StandardPxxTransport<SerialPxxBitTransport> >;
|
||||
template class PxxPulses<Pxx2Transport>;
|
||||
template class PxxPulses<UartPxxTransport>;
|
240
radio/src/pulses/pxx.h
Normal file
240
radio/src/pulses/pxx.h
Normal file
|
@ -0,0 +1,240 @@
|
|||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef _PULSES_PXX_H_
|
||||
#define _PULSES_PXX_H_
|
||||
|
||||
#include "pulses_common.h"
|
||||
|
||||
#define PXX_SEND_BIND 0x01
|
||||
#define PXX_SEND_FAILSAFE (1 << 4)
|
||||
#define PXX_SEND_RANGECHECK (1 << 5)
|
||||
|
||||
#if defined(PXX_FREQUENCY_HIGH)
|
||||
#define EXTMODULE_USART_PXX_BAUDRATE 420000
|
||||
#define INTMODULE_USART_PXX_BAUDRATE 450000
|
||||
#define PXX_PERIOD 4/*ms*/
|
||||
#else
|
||||
#define EXTMODULE_USART_PXX_BAUDRATE 115200
|
||||
#define INTMODULE_USART_PXX_BAUDRATE 115200
|
||||
#define PXX_PERIOD 9/*ms*/
|
||||
#endif
|
||||
|
||||
#if defined(PXX_FREQUENCY_HIGH) && (!defined(INTMODULE_USART) || !defined(EXTMODULE_USART))
|
||||
/* PXX uses 20 bytes (as of Rev 1.1 document) with 8 changes per byte + stop bit ~= 162 max pulses */
|
||||
/* DSM2 uses 2 header + 12 channel bytes, with max 10 changes (8n2) per byte + 16 bits trailer ~= 156 max pulses */
|
||||
/* Multimodule uses 3 bytes header + 22 channel bytes with max 11 changes per byte (8e2) + 16 bits trailer ~= 291 max pulses */
|
||||
/* Multimodule reuses some of the DSM2 function and structs since the protocols are similar enough */
|
||||
/* sbus is 1 byte header, 22 channel bytes (11bit * 16ch) + 1 byte flags */
|
||||
|
||||
#error "Pulses array needs to be increased (PXX_FREQUENCY=HIGH)"
|
||||
#endif
|
||||
|
||||
|
||||
#define PXX_PERIOD_HALF_US (PXX_PERIOD * 2000)
|
||||
|
||||
class PxxCrcMixin {
|
||||
protected:
|
||||
void initCrc()
|
||||
{
|
||||
crc = 0;
|
||||
}
|
||||
|
||||
void addToCrc(uint8_t byte)
|
||||
{
|
||||
crc = (crc << 8) ^ (CRCTable[((crc >> 8) ^ byte) & 0xFF]);
|
||||
}
|
||||
|
||||
uint16_t crc;
|
||||
static const uint16_t CRCTable[];
|
||||
};
|
||||
|
||||
// Used by the Sky9x family boards
|
||||
class SerialPxxBitTransport: public DataBuffer<uint8_t, 64> {
|
||||
protected:
|
||||
uint8_t byte;
|
||||
uint8_t bits_count;
|
||||
|
||||
void initFrame()
|
||||
{
|
||||
initBuffer();
|
||||
byte = 0;
|
||||
bits_count = 0;
|
||||
}
|
||||
|
||||
void addSerialBit(uint8_t bit)
|
||||
{
|
||||
byte >>= 1;
|
||||
if (bit & 1) {
|
||||
byte |= 0x80;
|
||||
}
|
||||
if (++bits_count >= 8) {
|
||||
*ptr++ = byte;
|
||||
bits_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 8uS/bit 01 = 0, 001 = 1
|
||||
void addPart(uint8_t value)
|
||||
{
|
||||
addSerialBit(0);
|
||||
if (value) {
|
||||
addSerialBit(0);
|
||||
}
|
||||
addSerialBit(1);
|
||||
}
|
||||
|
||||
void addTail()
|
||||
{
|
||||
while (bits_count != 0) {
|
||||
addSerialBit(1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class PwmPxxBitTransport: public PulsesBuffer<pulse_duration_t, 200> {
|
||||
protected:
|
||||
uint16_t rest;
|
||||
|
||||
void initFrame()
|
||||
{
|
||||
initBuffer();
|
||||
rest = PXX_PERIOD_HALF_US;
|
||||
}
|
||||
|
||||
void addPart(uint8_t value)
|
||||
{
|
||||
pulse_duration_t duration = value ? 47 : 31;
|
||||
*ptr++ = duration;
|
||||
rest -= duration + 1;
|
||||
}
|
||||
|
||||
void addTail()
|
||||
{
|
||||
// rest min value is 18000 - 200 * 48 = 8400 (4.2ms)
|
||||
*(ptr - 1) += rest;
|
||||
}
|
||||
};
|
||||
|
||||
template <class BitTransport>
|
||||
class StandardPxxTransport: public BitTransport, public PxxCrcMixin {
|
||||
protected:
|
||||
uint8_t ones_count;
|
||||
|
||||
void initFrame()
|
||||
{
|
||||
BitTransport::initFrame();
|
||||
ones_count = 0;
|
||||
}
|
||||
|
||||
void addByte(uint8_t byte)
|
||||
{
|
||||
PxxCrcMixin::addToCrc(byte);
|
||||
addByteWithoutCrc(byte);
|
||||
};
|
||||
|
||||
void addRawByteWithoutCrc(uint8_t byte)
|
||||
{
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
if (byte & 0x80)
|
||||
BitTransport::addPart(1);
|
||||
else
|
||||
BitTransport::addPart(0);
|
||||
byte <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
void addByteWithoutCrc(uint8_t byte)
|
||||
{
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
addBit(byte & 0x80);
|
||||
byte <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
void addBit(uint8_t bit)
|
||||
{
|
||||
if (bit) {
|
||||
BitTransport::addPart(1);
|
||||
if (++ones_count == 5) {
|
||||
ones_count = 0;
|
||||
BitTransport::addPart(0); // Stuff a 0 bit in
|
||||
}
|
||||
}
|
||||
else {
|
||||
BitTransport::addPart(0);
|
||||
ones_count = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class UartPxxTransport: public DataBuffer<uint8_t, 64>, public PxxCrcMixin {
|
||||
protected:
|
||||
void initFrame()
|
||||
{
|
||||
initBuffer();
|
||||
}
|
||||
|
||||
void addByte(uint8_t byte)
|
||||
{
|
||||
PxxCrcMixin::addToCrc(byte);
|
||||
addWithByteStuffing(byte);
|
||||
}
|
||||
|
||||
void addRawByteWithoutCrc(uint8_t byte)
|
||||
{
|
||||
addByteWithoutCrc(byte);
|
||||
}
|
||||
|
||||
void addByteWithoutCrc(uint8_t byte)
|
||||
{
|
||||
*ptr++ = byte;
|
||||
}
|
||||
|
||||
void addWithByteStuffing(uint8_t byte)
|
||||
{
|
||||
if (0x7E == byte) {
|
||||
*ptr++ = 0x7D;
|
||||
*ptr++ = 0x5E;
|
||||
}
|
||||
else if (0x7D == byte) {
|
||||
*ptr++ = 0x7D;
|
||||
*ptr++ = 0x5D;
|
||||
}
|
||||
else {
|
||||
*ptr++ = byte;
|
||||
}
|
||||
}
|
||||
|
||||
void addTail()
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
};
|
||||
|
||||
template <class PxxTransport>
|
||||
class PxxPulses: public PxxTransport {
|
||||
protected:
|
||||
uint8_t addFlag1(uint8_t port);
|
||||
void addChannels(uint8_t port, uint8_t sendFailsafe, uint8_t sendUpperChannels);
|
||||
void addExtraFlags(uint8_t port);
|
||||
};
|
||||
|
||||
#endif
|
79
radio/src/pulses/pxx1.cpp
Normal file
79
radio/src/pulses/pxx1.cpp
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "pulses/pxx1.h"
|
||||
|
||||
template <class PxxTransport>
|
||||
void Pxx1Pulses<PxxTransport>::add8ChannelsFrame(uint8_t port, uint8_t sendUpperChannels)
|
||||
{
|
||||
PxxTransport::initCrc();
|
||||
|
||||
// Sync
|
||||
addHead();
|
||||
|
||||
// RX Number
|
||||
PxxTransport::addByte(g_model.header.modelId[port]);
|
||||
|
||||
// Flag1
|
||||
uint8_t flag1 = PxxPulses<PxxTransport>::addFlag1(port);
|
||||
|
||||
// Flag2
|
||||
PxxTransport::addByte(0);
|
||||
|
||||
// Channels
|
||||
PxxPulses<PxxTransport>::addChannels(port, flag1 & PXX_SEND_FAILSAFE, sendUpperChannels);
|
||||
|
||||
// Extra flags
|
||||
PxxPulses<PxxTransport>::addExtraFlags(port);
|
||||
|
||||
// CRC
|
||||
addCrc();
|
||||
|
||||
// Sync = HEAD
|
||||
addHead();
|
||||
|
||||
// Tail
|
||||
PxxTransport::addTail();
|
||||
}
|
||||
|
||||
template <class PxxTransport>
|
||||
void Pxx1Pulses<PxxTransport>::setupFrame(uint8_t port)
|
||||
{
|
||||
PxxTransport::initFrame();
|
||||
|
||||
#if defined(PXX_FREQUENCY_HIGH)
|
||||
add8ChannelsFrame(port, 0);
|
||||
if (sentModuleChannels(port) > 8) {
|
||||
add8ChannelsFrame(port, 8);
|
||||
}
|
||||
#else
|
||||
static uint8_t pass[NUM_MODULES] = { MODULES_INIT(0) };
|
||||
uint8_t sendUpperChannels = 0;
|
||||
if (pass[port]++ & 0x01) {
|
||||
sendUpperChannels = g_model.moduleData[port].channelsCount;
|
||||
}
|
||||
add8ChannelsFrame(port, sendUpperChannels);
|
||||
#endif
|
||||
}
|
||||
|
||||
template class Pxx1Pulses<StandardPxxTransport<PwmPxxBitTransport> >;
|
||||
template class Pxx1Pulses<StandardPxxTransport<SerialPxxBitTransport> >;
|
||||
template class Pxx1Pulses<UartPxxTransport>;
|
52
radio/src/pulses/pxx1.h
Normal file
52
radio/src/pulses/pxx1.h
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef _PULSES_PXX1_H_
|
||||
#define _PULSES_PXX1_H_
|
||||
|
||||
#include "pxx.h"
|
||||
|
||||
template <class PxxTransport>
|
||||
class Pxx1Pulses: public PxxPulses<PxxTransport>
|
||||
{
|
||||
public:
|
||||
void setupFrame(uint8_t port);
|
||||
|
||||
protected:
|
||||
void addHead()
|
||||
{
|
||||
// send 7E, do not CRC
|
||||
PxxTransport::addRawByteWithoutCrc(0x7E);
|
||||
}
|
||||
|
||||
void addCrc()
|
||||
{
|
||||
PxxTransport::addByteWithoutCrc(PxxCrcMixin::crc >> 8);
|
||||
PxxTransport::addByteWithoutCrc(PxxCrcMixin::crc);
|
||||
}
|
||||
|
||||
void add8ChannelsFrame(uint8_t port, uint8_t sendUpperChannels);
|
||||
};
|
||||
|
||||
typedef Pxx1Pulses<UartPxxTransport> UartPxxPulses;
|
||||
typedef Pxx1Pulses<StandardPxxTransport<PwmPxxBitTransport>> PwmPxxPulses;
|
||||
typedef Pxx1Pulses<StandardPxxTransport<SerialPxxBitTransport>> SerialPxxPulses;
|
||||
|
||||
#endif
|
75
radio/src/pulses/pxx2.cpp
Normal file
75
radio/src/pulses/pxx2.cpp
Normal file
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "pulses/pxx2.h"
|
||||
|
||||
void Pxx2Pulses::setupFrame(uint8_t port)
|
||||
{
|
||||
initFrame();
|
||||
initCrc();
|
||||
|
||||
static uint8_t pass[NUM_MODULES] = { MODULES_INIT(0) };
|
||||
uint8_t sendUpperChannels = 0;
|
||||
if (pass[port]++ & 0x01) {
|
||||
sendUpperChannels = g_model.moduleData[port].channelsCount;
|
||||
}
|
||||
|
||||
// Model ID
|
||||
addByte(g_model.header.modelId[port]);
|
||||
|
||||
// Flag1
|
||||
uint8_t flag1 = addFlag1(port);
|
||||
|
||||
// Flag2
|
||||
addByte(0);
|
||||
|
||||
// Channels
|
||||
addChannels(port, flag1 & PXX_SEND_FAILSAFE, sendUpperChannels);
|
||||
|
||||
// Extra flags
|
||||
addExtraFlags(port);
|
||||
|
||||
// Flag3, reserved
|
||||
addByte(0);
|
||||
|
||||
#if defined(LUA)
|
||||
if (outputTelemetryBufferTrigger != 0x00 && outputTelemetryBufferSize > 0) {
|
||||
// CMD/Resp
|
||||
addByte(1);
|
||||
// primID (1 byte) + dataID (2 bytes) + value (4 bytes)
|
||||
for (uint8_t i=0; i<7; i++) {
|
||||
addByte(outputTelemetryBuffer[i]);
|
||||
}
|
||||
outputTelemetryBufferTrigger = 0x00;
|
||||
outputTelemetryBufferSize = 0;
|
||||
}
|
||||
else {
|
||||
// CMD/Resp
|
||||
addByte(0);
|
||||
}
|
||||
#else
|
||||
// CMD/Resp
|
||||
addByte(0);
|
||||
#endif
|
||||
|
||||
// CRC
|
||||
addByte(crc); // TODO need to check the CRC chosen algorithm
|
||||
}
|
72
radio/src/pulses/pxx2.h
Normal file
72
radio/src/pulses/pxx2.h
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef _PULSES_PXX2_H_
|
||||
#define _PULSES_PXX2_H_
|
||||
|
||||
#include "./pxx.h"
|
||||
|
||||
class SportCrcMixin {
|
||||
protected:
|
||||
void initCrc()
|
||||
{
|
||||
crc = 0;
|
||||
}
|
||||
|
||||
void addToCrc(uint8_t byte)
|
||||
{
|
||||
crc += byte; // 0-1FF
|
||||
crc += crc >> 8; // 0-100
|
||||
crc &= 0x00ff;
|
||||
}
|
||||
|
||||
uint16_t crc;
|
||||
};
|
||||
|
||||
|
||||
class Pxx2Transport: public DataBuffer<uint8_t, 64>, public SportCrcMixin {
|
||||
protected:
|
||||
void addByte(uint8_t byte)
|
||||
{
|
||||
SportCrcMixin::addToCrc(byte);
|
||||
*ptr++ = byte;
|
||||
}
|
||||
|
||||
void addTail()
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
};
|
||||
|
||||
class Pxx2Pulses: public PxxPulses<Pxx2Transport> {
|
||||
public:
|
||||
void setupFrame(uint8_t port);
|
||||
|
||||
protected:
|
||||
uint8_t data[64];
|
||||
uint8_t * ptr;
|
||||
|
||||
void initFrame()
|
||||
{
|
||||
Pxx2Transport::initBuffer();
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,453 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
#define PXX_SEND_BIND 0x01
|
||||
#define PXX_SEND_FAILSAFE (1 << 4)
|
||||
#define PXX_SEND_RANGECHECK (1 << 5)
|
||||
|
||||
const uint16_t CRCTable[]=
|
||||
{
|
||||
0x0000,0x1189,0x2312,0x329b,0x4624,0x57ad,0x6536,0x74bf,
|
||||
0x8c48,0x9dc1,0xaf5a,0xbed3,0xca6c,0xdbe5,0xe97e,0xf8f7,
|
||||
0x1081,0x0108,0x3393,0x221a,0x56a5,0x472c,0x75b7,0x643e,
|
||||
0x9cc9,0x8d40,0xbfdb,0xae52,0xdaed,0xcb64,0xf9ff,0xe876,
|
||||
0x2102,0x308b,0x0210,0x1399,0x6726,0x76af,0x4434,0x55bd,
|
||||
0xad4a,0xbcc3,0x8e58,0x9fd1,0xeb6e,0xfae7,0xc87c,0xd9f5,
|
||||
0x3183,0x200a,0x1291,0x0318,0x77a7,0x662e,0x54b5,0x453c,
|
||||
0xbdcb,0xac42,0x9ed9,0x8f50,0xfbef,0xea66,0xd8fd,0xc974,
|
||||
0x4204,0x538d,0x6116,0x709f,0x0420,0x15a9,0x2732,0x36bb,
|
||||
0xce4c,0xdfc5,0xed5e,0xfcd7,0x8868,0x99e1,0xab7a,0xbaf3,
|
||||
0x5285,0x430c,0x7197,0x601e,0x14a1,0x0528,0x37b3,0x263a,
|
||||
0xdecd,0xcf44,0xfddf,0xec56,0x98e9,0x8960,0xbbfb,0xaa72,
|
||||
0x6306,0x728f,0x4014,0x519d,0x2522,0x34ab,0x0630,0x17b9,
|
||||
0xef4e,0xfec7,0xcc5c,0xddd5,0xa96a,0xb8e3,0x8a78,0x9bf1,
|
||||
0x7387,0x620e,0x5095,0x411c,0x35a3,0x242a,0x16b1,0x0738,
|
||||
0xffcf,0xee46,0xdcdd,0xcd54,0xb9eb,0xa862,0x9af9,0x8b70,
|
||||
0x8408,0x9581,0xa71a,0xb693,0xc22c,0xd3a5,0xe13e,0xf0b7,
|
||||
0x0840,0x19c9,0x2b52,0x3adb,0x4e64,0x5fed,0x6d76,0x7cff,
|
||||
0x9489,0x8500,0xb79b,0xa612,0xd2ad,0xc324,0xf1bf,0xe036,
|
||||
0x18c1,0x0948,0x3bd3,0x2a5a,0x5ee5,0x4f6c,0x7df7,0x6c7e,
|
||||
0xa50a,0xb483,0x8618,0x9791,0xe32e,0xf2a7,0xc03c,0xd1b5,
|
||||
0x2942,0x38cb,0x0a50,0x1bd9,0x6f66,0x7eef,0x4c74,0x5dfd,
|
||||
0xb58b,0xa402,0x9699,0x8710,0xf3af,0xe226,0xd0bd,0xc134,
|
||||
0x39c3,0x284a,0x1ad1,0x0b58,0x7fe7,0x6e6e,0x5cf5,0x4d7c,
|
||||
0xc60c,0xd785,0xe51e,0xf497,0x8028,0x91a1,0xa33a,0xb2b3,
|
||||
0x4a44,0x5bcd,0x6956,0x78df,0x0c60,0x1de9,0x2f72,0x3efb,
|
||||
0xd68d,0xc704,0xf59f,0xe416,0x90a9,0x8120,0xb3bb,0xa232,
|
||||
0x5ac5,0x4b4c,0x79d7,0x685e,0x1ce1,0x0d68,0x3ff3,0x2e7a,
|
||||
0xe70e,0xf687,0xc41c,0xd595,0xa12a,0xb0a3,0x8238,0x93b1,
|
||||
0x6b46,0x7acf,0x4854,0x59dd,0x2d62,0x3ceb,0x0e70,0x1ff9,
|
||||
0xf78f,0xe606,0xd49d,0xc514,0xb1ab,0xa022,0x92b9,0x8330,
|
||||
0x7bc7,0x6a4e,0x58d5,0x495c,0x3de3,0x2c6a,0x1ef1,0x0f78
|
||||
};
|
||||
|
||||
#if defined(INTMODULE_USART) || defined(EXTMODULE_USART)
|
||||
inline void uartPutPcmPart(uint8_t port, uint8_t byte)
|
||||
{
|
||||
if (0x7E == byte) {
|
||||
*modulePulsesData[port].pxx_uart.ptr++ = 0x7D;
|
||||
*modulePulsesData[port].pxx_uart.ptr++ = 0x5E;
|
||||
}
|
||||
else if (0x7D == byte) {
|
||||
*modulePulsesData[port].pxx_uart.ptr++ = 0x7D;
|
||||
*modulePulsesData[port].pxx_uart.ptr++ = 0x5D;
|
||||
}
|
||||
else {
|
||||
*modulePulsesData[port].pxx_uart.ptr++ = byte;
|
||||
}
|
||||
}
|
||||
|
||||
void uartPutPcmByte(uint8_t port, uint8_t byte)
|
||||
{
|
||||
modulePulsesData[port].pxx_uart.pcmCrc = (modulePulsesData[port].pxx_uart.pcmCrc<<8) ^ (CRCTable[((modulePulsesData[port].pxx_uart.pcmCrc>>8)^byte) & 0xFF]);
|
||||
uartPutPcmPart(port, byte);
|
||||
}
|
||||
|
||||
void uartInitPcmArray(uint8_t port)
|
||||
{
|
||||
modulePulsesData[port].pxx_uart.ptr = modulePulsesData[port].pxx_uart.pulses;
|
||||
}
|
||||
|
||||
void uartInitPcmCrc(uint8_t port)
|
||||
{
|
||||
modulePulsesData[port].pxx_uart.pcmCrc = 0;
|
||||
}
|
||||
|
||||
void uartPutPcmHead(uint8_t port)
|
||||
{
|
||||
// send 7E, do not CRC
|
||||
*modulePulsesData[port].pxx_uart.ptr++ = 0x7E;
|
||||
}
|
||||
|
||||
void uartPutPcmCrc(uint8_t port)
|
||||
{
|
||||
uint16_t pulseValue = modulePulsesData[port].pxx_uart.pcmCrc;
|
||||
uartPutPcmByte(port, pulseValue >> 8);
|
||||
uartPutPcmByte(port, pulseValue);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(INTMODULE_USART) || !defined(EXTMODULE_USART)
|
||||
|
||||
#if defined(PPM_PIN_SERIAL)
|
||||
void pxxPutPcmSerialBit(uint8_t port, uint8_t bit)
|
||||
{
|
||||
modulePulsesData[port].pxx.serialByte >>= 1;
|
||||
if (bit & 1) {
|
||||
modulePulsesData[port].pxx.serialByte |= 0x80;
|
||||
}
|
||||
if (++modulePulsesData[port].pxx.serialBitCount >= 8) {
|
||||
*modulePulsesData[port].pxx.ptr++ = modulePulsesData[port].pxx.serialByte;
|
||||
modulePulsesData[port].pxx.serialBitCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 8uS/bit 01 = 0, 001 = 1
|
||||
void pxxPutPcmPart(uint8_t port, uint8_t value)
|
||||
{
|
||||
pxxPutPcmSerialBit(port, 0);
|
||||
if (value) {
|
||||
pxxPutPcmSerialBit(port, 0);
|
||||
}
|
||||
pxxPutPcmSerialBit(port, 1);
|
||||
}
|
||||
|
||||
void pxxPutPcmTail(uint8_t port)
|
||||
{
|
||||
while (modulePulsesData[port].pxx.serialBitCount != 0) {
|
||||
pxxPutPcmSerialBit(port, 1);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void pxxPutPcmPart(uint8_t port, uint8_t value)
|
||||
{
|
||||
pulse_duration_t duration = value ? 47 : 31;
|
||||
*modulePulsesData[port].pxx.ptr++ = duration;
|
||||
modulePulsesData[port].pxx.rest -= duration + 1;
|
||||
}
|
||||
|
||||
void pxxPutPcmTail(uint8_t port)
|
||||
{
|
||||
// rest min value is 18000 - 200 * 48 = 8400 (4.2ms)
|
||||
*(modulePulsesData[port].pxx.ptr-1) += modulePulsesData[port].pxx.rest;
|
||||
}
|
||||
#endif
|
||||
|
||||
void pxxPutPcmBit(uint8_t port, uint8_t bit)
|
||||
{
|
||||
if (bit) {
|
||||
pxxPutPcmPart(port, 1);
|
||||
if (++modulePulsesData[port].pxx.pcmOnesCount == 5) {
|
||||
modulePulsesData[port].pxx.pcmOnesCount = 0;
|
||||
pxxPutPcmPart(port, 0); // Stuff a 0 bit in
|
||||
}
|
||||
}
|
||||
else {
|
||||
pxxPutPcmPart(port, 0);
|
||||
modulePulsesData[port].pxx.pcmOnesCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void pxxPutPcmByte(uint8_t port, uint8_t byte)
|
||||
{
|
||||
modulePulsesData[port].pxx.pcmCrc = (modulePulsesData[port].pxx.pcmCrc<<8) ^ (CRCTable[((modulePulsesData[port].pxx.pcmCrc>>8)^byte) & 0xFF]);
|
||||
for (uint8_t i=0; i<8; i++) {
|
||||
pxxPutPcmBit(port, byte & 0x80);
|
||||
byte <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
void pxxInitPcmArray(uint8_t port)
|
||||
{
|
||||
modulePulsesData[port].pxx.ptr = modulePulsesData[port].pxx.pulses;
|
||||
#if defined(PPM_PIN_SERIAL)
|
||||
modulePulsesData[port].pxx.pcmValue = 0;
|
||||
#else
|
||||
modulePulsesData[port].pxx.rest = PXX_PERIOD_HALF_US;
|
||||
#endif
|
||||
|
||||
modulePulsesData[port].pxx.pcmOnesCount = 0;
|
||||
}
|
||||
|
||||
void pxxInitPcmCrc(uint8_t port)
|
||||
{
|
||||
modulePulsesData[port].pxx.pcmCrc = 0;
|
||||
}
|
||||
|
||||
void pxxPutPcmHead(uint8_t port)
|
||||
{
|
||||
// send 7E, do not CRC
|
||||
// 01111110
|
||||
pxxPutPcmPart(port, 0);
|
||||
pxxPutPcmPart(port, 1);
|
||||
pxxPutPcmPart(port, 1);
|
||||
pxxPutPcmPart(port, 1);
|
||||
pxxPutPcmPart(port, 1);
|
||||
pxxPutPcmPart(port, 1);
|
||||
pxxPutPcmPart(port, 1);
|
||||
pxxPutPcmPart(port, 0);
|
||||
}
|
||||
|
||||
void pxxPutPcmCrc(uint8_t port)
|
||||
{
|
||||
uint16_t pulseValue = modulePulsesData[port].pxx.pcmCrc;
|
||||
pxxPutPcmByte(port, pulseValue >> 8);
|
||||
pxxPutPcmByte(port, pulseValue);
|
||||
}
|
||||
#else
|
||||
// those functions should not be used, a link error will occur if wrong
|
||||
void pxxInitPcmArray(uint8_t port);
|
||||
void pxxInitPcmCrc(uint8_t port);
|
||||
void pxxPutPcmByte(uint8_t port, uint8_t byte);
|
||||
void pxxPutPcmHead(uint8_t port);
|
||||
void pxxPutPcmTail(uint8_t port);
|
||||
void pxxPutPcmCrc(uint8_t port);
|
||||
#endif
|
||||
|
||||
#if defined(INTMODULE_USART) || defined(EXTMODULE_USART)
|
||||
inline void initPcmArray(uint8_t port)
|
||||
{
|
||||
if (IS_UART_MODULE(port))
|
||||
uartInitPcmArray(port);
|
||||
else
|
||||
pxxInitPcmArray(port);
|
||||
}
|
||||
|
||||
inline void initPcmCrc(uint8_t port)
|
||||
{
|
||||
if (IS_UART_MODULE(port))
|
||||
uartInitPcmCrc(port);
|
||||
else
|
||||
pxxInitPcmCrc(port);
|
||||
}
|
||||
|
||||
inline void putPcmHead(uint8_t port)
|
||||
{
|
||||
if (IS_UART_MODULE(port))
|
||||
uartPutPcmHead(port);
|
||||
else
|
||||
pxxPutPcmHead(port);
|
||||
}
|
||||
|
||||
inline void putPcmByte(uint8_t port, uint8_t byte)
|
||||
{
|
||||
if (IS_UART_MODULE(port))
|
||||
uartPutPcmByte(port, byte);
|
||||
else
|
||||
pxxPutPcmByte(port, byte);
|
||||
}
|
||||
|
||||
inline void putPcmCrc(uint8_t port)
|
||||
{
|
||||
if (IS_UART_MODULE(port))
|
||||
uartPutPcmCrc(port);
|
||||
else
|
||||
pxxPutPcmCrc(port);
|
||||
}
|
||||
|
||||
inline void putPcmTail(uint8_t port)
|
||||
{
|
||||
if (!IS_UART_MODULE(port))
|
||||
pxxPutPcmTail(port);
|
||||
}
|
||||
#else
|
||||
inline void initPcmArray(uint8_t port)
|
||||
{
|
||||
pxxInitPcmArray(port);
|
||||
}
|
||||
|
||||
inline void initPcmCrc(uint8_t port)
|
||||
{
|
||||
pxxInitPcmCrc(port);
|
||||
}
|
||||
|
||||
inline void putPcmHead(uint8_t port)
|
||||
{
|
||||
pxxPutPcmHead(port);
|
||||
}
|
||||
|
||||
inline void putPcmByte(uint8_t port, uint8_t byte)
|
||||
{
|
||||
pxxPutPcmByte(port, byte);
|
||||
}
|
||||
|
||||
inline void putPcmCrc(uint8_t port)
|
||||
{
|
||||
pxxPutPcmCrc(port);
|
||||
}
|
||||
|
||||
inline void putPcmTail(uint8_t port)
|
||||
{
|
||||
pxxPutPcmTail(port);
|
||||
}
|
||||
#endif
|
||||
|
||||
inline void setupFramePXX(uint8_t port, uint8_t sendUpperChannels)
|
||||
{
|
||||
uint16_t pulseValue=0, pulseValueLow=0;
|
||||
|
||||
initPcmCrc(port);
|
||||
|
||||
/* Sync */
|
||||
putPcmHead(port);
|
||||
|
||||
/* Rx Number */
|
||||
putPcmByte(port, g_model.header.modelId[port]);
|
||||
|
||||
/* FLAG1 */
|
||||
uint8_t flag1 = (g_model.moduleData[port].rfProtocol << 6);
|
||||
if (moduleFlag[port] == MODULE_BIND) {
|
||||
flag1 |= (g_eeGeneral.countryCode << 1) | PXX_SEND_BIND;
|
||||
}
|
||||
else if (moduleFlag[port] == MODULE_RANGECHECK) {
|
||||
flag1 |= PXX_SEND_RANGECHECK;
|
||||
}
|
||||
else if (g_model.moduleData[port].failsafeMode != FAILSAFE_NOT_SET && g_model.moduleData[port].failsafeMode != FAILSAFE_RECEIVER) {
|
||||
if (failsafeCounter[port]-- == 0) {
|
||||
failsafeCounter[port] = 1000;
|
||||
flag1 |= PXX_SEND_FAILSAFE;
|
||||
}
|
||||
if (failsafeCounter[port] == 0 && g_model.moduleData[port].channelsCount > 0) {
|
||||
flag1 |= PXX_SEND_FAILSAFE;
|
||||
}
|
||||
}
|
||||
|
||||
putPcmByte(port, flag1);
|
||||
|
||||
/* FLAG2 */
|
||||
putPcmByte(port, 0);
|
||||
|
||||
/* CHANNELS */
|
||||
for (int i=0; i<8; i++) {
|
||||
if (flag1 & PXX_SEND_FAILSAFE) {
|
||||
if (g_model.moduleData[port].failsafeMode == FAILSAFE_HOLD) {
|
||||
pulseValue = (i < sendUpperChannels ? 4095 : 2047);
|
||||
}
|
||||
else if (g_model.moduleData[port].failsafeMode == FAILSAFE_NOPULSES) {
|
||||
pulseValue = (i < sendUpperChannels ? 2048 : 0);
|
||||
}
|
||||
else {
|
||||
if (i < sendUpperChannels) {
|
||||
int16_t failsafeValue = g_model.moduleData[port].failsafeChannels[8+i];
|
||||
if (failsafeValue == FAILSAFE_CHANNEL_HOLD) {
|
||||
pulseValue = 4095;
|
||||
}
|
||||
else if (failsafeValue == FAILSAFE_CHANNEL_NOPULSE) {
|
||||
pulseValue = 2048;
|
||||
}
|
||||
else {
|
||||
failsafeValue += 2*PPM_CH_CENTER(8+g_model.moduleData[port].channelsStart+i) - 2*PPM_CENTER;
|
||||
pulseValue = limit(2049, (failsafeValue * 512 / 682) + 3072, 4094);
|
||||
}
|
||||
}
|
||||
else {
|
||||
int16_t failsafeValue = g_model.moduleData[port].failsafeChannels[i];
|
||||
if (failsafeValue == FAILSAFE_CHANNEL_HOLD) {
|
||||
pulseValue = 2047;
|
||||
}
|
||||
else if (failsafeValue == FAILSAFE_CHANNEL_NOPULSE) {
|
||||
pulseValue = 0;
|
||||
}
|
||||
else {
|
||||
failsafeValue += 2*PPM_CH_CENTER(g_model.moduleData[port].channelsStart+i) - 2*PPM_CENTER;
|
||||
pulseValue = limit(1, (failsafeValue * 512 / 682) + 1024, 2046);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (i < sendUpperChannels) {
|
||||
int channel = 8 + g_model.moduleData[port].channelsStart + i;
|
||||
int value = channelOutputs[channel] + 2*PPM_CH_CENTER(channel) - 2*PPM_CENTER;
|
||||
pulseValue = limit(2049, (value * 512 / 682) + 3072, 4094);
|
||||
}
|
||||
else if (i < sentModuleChannels(port)) {
|
||||
int channel = g_model.moduleData[port].channelsStart + i;
|
||||
int value = channelOutputs[channel] + 2*PPM_CH_CENTER(channel) - 2*PPM_CENTER;
|
||||
pulseValue = limit(1, (value * 512 / 682) + 1024, 2046);
|
||||
}
|
||||
else {
|
||||
pulseValue = 1024;
|
||||
}
|
||||
}
|
||||
|
||||
if (i & 1) {
|
||||
putPcmByte(port, pulseValueLow); // Low byte of channel
|
||||
putPcmByte(port, ((pulseValueLow >> 8) & 0x0F) | (pulseValue << 4)); // 4 bits each from 2 channels
|
||||
putPcmByte(port, pulseValue >> 4); // High byte of channel
|
||||
}
|
||||
else {
|
||||
pulseValueLow = pulseValue;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t extra_flags = 0;
|
||||
|
||||
/* Ext. flag (holds antenna selection on Horus internal module, 0x00 otherwise) */
|
||||
#if defined(PCBHORUS) || defined(PCBXLITE)
|
||||
if (port == INTERNAL_MODULE) {
|
||||
extra_flags |= (g_model.moduleData[port].pxx.external_antenna << 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
extra_flags |= (g_model.moduleData[port].pxx.receiver_telem_off << 1);
|
||||
extra_flags |= (g_model.moduleData[port].pxx.receiver_channel_9_16 << 2);
|
||||
if (isModuleR9M(port)) {
|
||||
extra_flags |= (min(g_model.moduleData[port].pxx.power, isModuleR9M_FCC_VARIANT(port) ? (uint8_t)R9M_FCC_POWER_MAX : (uint8_t)R9M_LBT_POWER_MAX) << 3);
|
||||
if(isModuleR9M_EUPLUS(port))
|
||||
extra_flags |= (1 << 6);
|
||||
}
|
||||
|
||||
// Disable S.PORT if internal module is active
|
||||
if (IS_TELEMETRY_INTERNAL_MODULE()) {
|
||||
extra_flags |= (1 << 5);
|
||||
}
|
||||
|
||||
putPcmByte(port, extra_flags);
|
||||
|
||||
/* CRC */
|
||||
putPcmCrc(port);
|
||||
|
||||
/* Sync */
|
||||
putPcmHead(port);
|
||||
|
||||
putPcmTail(port);
|
||||
}
|
||||
|
||||
void setupPulsesPXX(uint8_t port)
|
||||
{
|
||||
initPcmArray(port);
|
||||
|
||||
#if defined(PXX_FREQUENCY_HIGH)
|
||||
setupFramePXX(port, 0);
|
||||
if (sentModuleChannels(port) > 8) {
|
||||
setupFramePXX(port, 8);
|
||||
}
|
||||
#else
|
||||
static uint8_t pass[NUM_MODULES] = { MODULES_INIT(0) };
|
||||
uint8_t sendUpperChannels = 0;
|
||||
if (pass[port]++ & 0x01) {
|
||||
sendUpperChannels = g_model.moduleData[port].channelsCount;
|
||||
}
|
||||
setupFramePXX(port, sendUpperChannels);
|
||||
#endif
|
||||
}
|
|
@ -125,11 +125,20 @@ set(FIRMWARE_SRC
|
|||
${COOS_DIR}/portable/GCC/port.c
|
||||
${COOS_DIR}/portable/arch.c
|
||||
)
|
||||
|
||||
set(PULSES_SRC
|
||||
${PULSES_SRC}
|
||||
pulses_arm.cpp
|
||||
ppm_arm.cpp
|
||||
pxx_arm.cpp
|
||||
pxx.cpp
|
||||
pxx1.cpp
|
||||
dsm2_arm.cpp
|
||||
sbus_arm.cpp
|
||||
)
|
||||
)
|
||||
|
||||
if(PXX2)
|
||||
set(PULSES_SRC
|
||||
${PULSES_SRC}
|
||||
pxx2.cpp
|
||||
)
|
||||
endif()
|
||||
|
|
|
@ -9,6 +9,7 @@ option(USB_SERIAL "Enable USB serial (CDC)" OFF)
|
|||
set(ARCH ARM)
|
||||
set(STM32USB_DIR ${THIRDPARTY_DIR}/STM32_USB-Host-Device_Lib_V2.2.0/Libraries)
|
||||
add_definitions(-DSTM32 -DLUA_INPUTS -DVARIO -DCROSSFIRE)
|
||||
|
||||
include_directories(${RADIO_SRC_DIRECTORY}/targets/common/arm/stm32)
|
||||
include_directories(${STM32USB_DIR}/STM32_USB_OTG_Driver/inc)
|
||||
include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Core/inc)
|
||||
|
@ -90,11 +91,13 @@ foreach(FILE ${STM32USB_SRC})
|
|||
${STM32USB_DIR}/${FILE}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
set(SRC
|
||||
${SRC}
|
||||
telemetry/crossfire.cpp
|
||||
io/bootloader_flash.cpp
|
||||
)
|
||||
|
||||
set(PULSES_SRC
|
||||
${PULSES_SRC}
|
||||
crossfire.cpp
|
||||
|
|
|
@ -130,8 +130,8 @@ void intmoduleSendNextFrame()
|
|||
DMA_InitStructure.DMA_Channel = INTMODULE_DMA_CHANNEL;
|
||||
DMA_InitStructure.DMA_PeripheralBaseAddr = CONVERT_PTR_UINT(&INTMODULE_USART->DR);
|
||||
DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToPeripheral;
|
||||
DMA_InitStructure.DMA_Memory0BaseAddr = CONVERT_PTR_UINT(modulePulsesData[INTERNAL_MODULE].pxx_uart.pulses);
|
||||
DMA_InitStructure.DMA_BufferSize = modulePulsesData[INTERNAL_MODULE].pxx_uart.ptr - modulePulsesData[INTERNAL_MODULE].pxx_uart.pulses;
|
||||
DMA_InitStructure.DMA_Memory0BaseAddr = CONVERT_PTR_UINT(modulePulsesData[INTERNAL_MODULE].pxx_uart.getData());
|
||||
DMA_InitStructure.DMA_BufferSize = modulePulsesData[INTERNAL_MODULE].pxx_uart.getSize();
|
||||
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
|
||||
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
|
||||
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
|
||||
|
|
|
@ -195,8 +195,8 @@ void init_pxx(uint32_t module_index);
|
|||
void disable_pxx(uint32_t module_index);
|
||||
void init_serial(uint32_t module_index, uint32_t baudrate, uint32_t period_half_us);
|
||||
void disable_serial(uint32_t module_index);
|
||||
void init_crossfire(uint32_t module_index);
|
||||
void disable_crossfire(uint32_t module_index);
|
||||
void init_module_timer( uint32_t module_index, uint32_t period, uint8_t state);
|
||||
void disable_module_timer( uint32_t module_index);
|
||||
|
||||
// Trainer driver
|
||||
void init_trainer_ppm(void);
|
||||
|
@ -526,7 +526,7 @@ int32_t getVolume(void);
|
|||
#define TELEMETRY_FIFO_SIZE 512
|
||||
void telemetryPortInit(uint32_t baudrate, uint8_t mode);
|
||||
void telemetryPortSetDirectionOutput(void);
|
||||
void sportSendBuffer(uint8_t * buffer, uint32_t count);
|
||||
void sportSendBuffer(const uint8_t * buffer, uint32_t count);
|
||||
uint8_t telemetryGetByte(uint8_t * byte);
|
||||
extern uint32_t telemetryErrors;
|
||||
|
||||
|
|
|
@ -34,9 +34,12 @@ void extmoduleStop()
|
|||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN;
|
||||
}
|
||||
|
||||
void extmoduleNoneStart()
|
||||
void extmoduleTimerStart(uint32_t period, uint8_t state)
|
||||
{
|
||||
EXTERNAL_MODULE_OFF();
|
||||
if (state)
|
||||
EXTERNAL_MODULE_ON();
|
||||
else
|
||||
EXTERNAL_MODULE_OFF();
|
||||
|
||||
GPIO_PinAFConfig(EXTMODULE_TX_GPIO, EXTMODULE_TX_GPIO_PinSource, 0);
|
||||
|
||||
|
@ -51,8 +54,8 @@ void extmoduleNoneStart()
|
|||
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN;
|
||||
EXTMODULE_TIMER->PSC = EXTMODULE_TIMER_FREQ / 2000000 - 1; // 0.5uS (2Mhz)
|
||||
EXTMODULE_TIMER->ARR = 36000; // 18mS
|
||||
EXTMODULE_TIMER->CCR2 = 32000; // Update time
|
||||
EXTMODULE_TIMER->ARR = (2000 * period);
|
||||
EXTMODULE_TIMER->CCR2 = (2000 * period) - 1000;
|
||||
EXTMODULE_TIMER->EGR = 1; // Restart
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF;
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC2IE; // Enable this interrupt
|
||||
|
@ -62,6 +65,7 @@ void extmoduleNoneStart()
|
|||
NVIC_SetPriority(EXTMODULE_TIMER_IRQn, 7);
|
||||
}
|
||||
|
||||
|
||||
void extmodulePpmStart()
|
||||
{
|
||||
EXTERNAL_MODULE_ON();
|
||||
|
@ -209,34 +213,6 @@ void extmoduleSerialStart(uint32_t /*baudrate*/, uint32_t period_half_us)
|
|||
}
|
||||
#endif
|
||||
|
||||
void extmoduleCrossfireStart()
|
||||
{
|
||||
EXTERNAL_MODULE_ON();
|
||||
|
||||
GPIO_PinAFConfig(EXTMODULE_TX_GPIO, EXTMODULE_TX_GPIO_PinSource, 0);
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = EXTMODULE_TX_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(EXTMODULE_TX_GPIO, &GPIO_InitStructure);
|
||||
GPIO_SetBits(EXTMODULE_TX_GPIO, EXTMODULE_TX_GPIO_PIN); // Set high
|
||||
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN;
|
||||
EXTMODULE_TIMER->PSC = EXTMODULE_TIMER_FREQ / 2000000 - 1; // 0.5uS (2Mhz)
|
||||
EXTMODULE_TIMER->ARR = (2000 * CROSSFIRE_PERIOD);
|
||||
EXTMODULE_TIMER->CCR2 = (2000 * CROSSFIRE_PERIOD) - 1000;
|
||||
EXTMODULE_TIMER->EGR = 1; // Restart
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF;
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC2IE; // Enable this interrupt
|
||||
EXTMODULE_TIMER->CR1 |= TIM_CR1_CEN;
|
||||
|
||||
NVIC_EnableIRQ(EXTMODULE_TIMER_IRQn);
|
||||
NVIC_SetPriority(EXTMODULE_TIMER_IRQn, 7);
|
||||
}
|
||||
|
||||
void extmoduleSendNextFrame()
|
||||
{
|
||||
if (s_current_protocol[EXTERNAL_MODULE] == PROTO_PPM) {
|
||||
|
@ -259,7 +235,7 @@ void extmoduleSendNextFrame()
|
|||
EXTMODULE_DMA_STREAM->CR |= DMA_SxCR_EN | DMA_SxCR_TCIE; // Enable DMA
|
||||
}
|
||||
else if (s_current_protocol[EXTERNAL_MODULE] == PROTO_PXX) {
|
||||
EXTMODULE_TIMER->CCR2 = *(modulePulsesData[EXTERNAL_MODULE].pxx.ptr - 1) - 4000; // 2mS in advance
|
||||
EXTMODULE_TIMER->CCR2 = modulePulsesData[EXTERNAL_MODULE].pxx.getLast() - 4000; // 2mS in advance
|
||||
EXTMODULE_DMA_STREAM->CR &= ~DMA_SxCR_EN; // Disable DMA
|
||||
#if defined(PCBX10) || PCBREV >= 13
|
||||
EXTMODULE_DMA_STREAM->CR |= EXTMODULE_DMA_CHANNEL | DMA_SxCR_DIR_0 | DMA_SxCR_MINC | DMA_SxCR_PSIZE_0 | DMA_SxCR_MSIZE_0 | DMA_SxCR_PL_0 | DMA_SxCR_PL_1;
|
||||
|
@ -267,8 +243,8 @@ void extmoduleSendNextFrame()
|
|||
EXTMODULE_DMA_STREAM->CR |= EXTMODULE_DMA_CHANNEL | DMA_SxCR_DIR_0 | DMA_SxCR_MINC | DMA_SxCR_PSIZE_1 | DMA_SxCR_MSIZE_1 | DMA_SxCR_PL_0 | DMA_SxCR_PL_1;
|
||||
#endif
|
||||
EXTMODULE_DMA_STREAM->PAR = CONVERT_PTR_UINT(&EXTMODULE_TIMER->ARR);
|
||||
EXTMODULE_DMA_STREAM->M0AR = CONVERT_PTR_UINT(modulePulsesData[EXTERNAL_MODULE].pxx.pulses);
|
||||
EXTMODULE_DMA_STREAM->NDTR = modulePulsesData[EXTERNAL_MODULE].pxx.ptr - modulePulsesData[EXTERNAL_MODULE].pxx.pulses;
|
||||
EXTMODULE_DMA_STREAM->M0AR = CONVERT_PTR_UINT(modulePulsesData[EXTERNAL_MODULE].pxx.getData());
|
||||
EXTMODULE_DMA_STREAM->NDTR = modulePulsesData[EXTERNAL_MODULE].pxx.getSize();
|
||||
EXTMODULE_DMA_STREAM->CR |= DMA_SxCR_EN | DMA_SxCR_TCIE; // Enable DMA
|
||||
}
|
||||
else if (IS_DSM2_PROTOCOL(s_current_protocol[EXTERNAL_MODULE]) || IS_MULTIMODULE_PROTOCOL(s_current_protocol[EXTERNAL_MODULE]) || IS_SBUS_PROTOCOL(s_current_protocol[EXTERNAL_MODULE])) {
|
||||
|
|
|
@ -26,18 +26,17 @@ void extmoduleStop(void);
|
|||
void intmoduleNoneStart(void);
|
||||
void intmodulePxxStart(void);
|
||||
|
||||
void extmoduleNoneStart(void);
|
||||
void extmoduleTimerStart(uint32_t period, uint8_t state);
|
||||
void extmodulePpmStart(void);
|
||||
void extmodulePxxStart(void);
|
||||
void extmoduleSerialStart(uint32_t baudrate, uint32_t period_half_us);
|
||||
void extmoduleCrossfireStart(void);
|
||||
|
||||
void init_no_pulses(uint32_t port)
|
||||
{
|
||||
if (port == INTERNAL_MODULE)
|
||||
intmoduleNoneStart();
|
||||
else
|
||||
extmoduleNoneStart();
|
||||
extmoduleTimerStart(18, false);
|
||||
}
|
||||
|
||||
void disable_no_pulses(uint32_t port)
|
||||
|
@ -94,16 +93,17 @@ void disable_serial(uint32_t port)
|
|||
}
|
||||
#endif
|
||||
|
||||
void init_crossfire(uint32_t port)
|
||||
void init_module_timer(uint32_t port, uint32_t period, uint8_t state)
|
||||
{
|
||||
if (port == EXTERNAL_MODULE) {
|
||||
extmoduleCrossfireStart();
|
||||
extmoduleTimerStart(period, state);
|
||||
}
|
||||
}
|
||||
|
||||
void disable_crossfire(uint32_t port)
|
||||
void disable_module_timer(uint32_t port)
|
||||
{
|
||||
if (port == EXTERNAL_MODULE) {
|
||||
extmoduleStop();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ void telemetryPortSetDirectionInput()
|
|||
TELEMETRY_USART->CR1 |= USART_CR1_RE; // turn on receiver
|
||||
}
|
||||
|
||||
void sportSendBuffer(uint8_t * buffer, uint32_t count)
|
||||
void sportSendBuffer(const uint8_t * buffer, uint32_t count)
|
||||
{
|
||||
telemetryPortSetDirectionOutput();
|
||||
|
||||
|
|
|
@ -278,8 +278,8 @@ extern "C" void PWM_IRQHandler(void)
|
|||
else {
|
||||
// Kick off serial output here
|
||||
Ssc * sscptr = SSC;
|
||||
sscptr->SSC_TPR = CONVERT_PTR_UINT(modulePulsesData[EXTERNAL_MODULE].pxx.pulses);
|
||||
sscptr->SSC_TCR = (uint8_t *)modulePulsesData[EXTERNAL_MODULE].pxx.ptr - (uint8_t *)modulePulsesData[EXTERNAL_MODULE].pxx.pulses;
|
||||
sscptr->SSC_TPR = CONVERT_PTR_UINT(modulePulsesData[EXTERNAL_MODULE].pxx.getData());
|
||||
sscptr->SSC_TCR = modulePulsesData[EXTERNAL_MODULE].pxx.getSize();
|
||||
sscptr->SSC_PTCR = SSC_PTCR_TXTEN; // Start transfers
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -182,14 +182,14 @@ uint32_t isBootloaderStart(const uint8_t * buffer);
|
|||
#endif
|
||||
void init_no_pulses(uint32_t port);
|
||||
void disable_no_pulses(uint32_t port);
|
||||
void init_ppm( uint32_t module_index );
|
||||
void disable_ppm( uint32_t module_index );
|
||||
void init_pxx( uint32_t module_index );
|
||||
void disable_pxx( uint32_t module_index );
|
||||
void init_serial( uint32_t module_index, uint32_t baudrate, uint32_t period );
|
||||
void disable_serial( uint32_t module_index );
|
||||
void init_crossfire( uint32_t module_index );
|
||||
void disable_crossfire( uint32_t module_index );
|
||||
void init_ppm( uint32_t module_index);
|
||||
void disable_ppm( uint32_t module_index);
|
||||
void init_pxx( uint32_t module_index);
|
||||
void disable_pxx( uint32_t module_index);
|
||||
void init_serial( uint32_t module_index, uint32_t baudrate, uint32_t period);
|
||||
void disable_serial( uint32_t module_index);
|
||||
void init_module_timer( uint32_t module_index, uint32_t period, uint8_t state);
|
||||
void disable_module_timer( uint32_t module_index);
|
||||
|
||||
// Trainer driver
|
||||
#define SLAVE_MODE() (g_model.trainerMode == TRAINER_MODE_SLAVE)
|
||||
|
@ -565,7 +565,7 @@ void debugPutc(const char c);
|
|||
// Telemetry driver
|
||||
void telemetryPortInit(uint32_t baudrate, uint8_t mode);
|
||||
void telemetryPortSetDirectionOutput(void);
|
||||
void sportSendBuffer(uint8_t * buffer, uint32_t count);
|
||||
void sportSendBuffer(const uint8_t * buffer, uint32_t count);
|
||||
uint8_t telemetryGetByte(uint8_t * byte);
|
||||
extern uint32_t telemetryErrors;
|
||||
|
||||
|
|
|
@ -41,11 +41,12 @@ void extmoduleStop()
|
|||
}
|
||||
}
|
||||
|
||||
void extmoduleNoneStart()
|
||||
void extmoduleTimerStart(uint32_t period, uint8_t state)
|
||||
{
|
||||
if (!IS_TRAINER_EXTERNAL_MODULE()) {
|
||||
if (state)
|
||||
EXTERNAL_MODULE_ON();
|
||||
else if (!IS_TRAINER_EXTERNAL_MODULE())
|
||||
EXTERNAL_MODULE_OFF();
|
||||
}
|
||||
|
||||
GPIO_PinAFConfig(EXTMODULE_TX_GPIO, EXTMODULE_TX_GPIO_PinSource, 0);
|
||||
|
||||
|
@ -60,8 +61,8 @@ void extmoduleNoneStart()
|
|||
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN;
|
||||
EXTMODULE_TIMER->PSC = EXTMODULE_TIMER_FREQ / 2000000 - 1; // 0.5uS from 30MHz
|
||||
EXTMODULE_TIMER->ARR = 36000; // 18mS
|
||||
EXTMODULE_TIMER->CCR2 = 32000; // Update time
|
||||
EXTMODULE_TIMER->ARR = (2000 * period);
|
||||
EXTMODULE_TIMER->CCR2 = (2000 * period) - 1000;
|
||||
EXTMODULE_TIMER->EGR = 1; // Restart
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF;
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC2IE; // Enable this interrupt
|
||||
|
@ -235,34 +236,6 @@ void extmodulePxxStart()
|
|||
}
|
||||
#endif
|
||||
|
||||
void extmoduleCrossfireStart()
|
||||
{
|
||||
EXTERNAL_MODULE_ON();
|
||||
|
||||
GPIO_PinAFConfig(EXTMODULE_TX_GPIO, EXTMODULE_TX_GPIO_PinSource, 0);
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = EXTMODULE_TX_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(EXTMODULE_TX_GPIO, &GPIO_InitStructure);
|
||||
GPIO_SetBits(EXTMODULE_TX_GPIO, EXTMODULE_TX_GPIO_PIN); // Set high
|
||||
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN;
|
||||
EXTMODULE_TIMER->PSC = EXTMODULE_TIMER_FREQ / 2000000 - 1; // 0.5uS from 30MHz
|
||||
EXTMODULE_TIMER->ARR = (2000 * CROSSFIRE_PERIOD);
|
||||
EXTMODULE_TIMER->CCR2 = (2000 * CROSSFIRE_PERIOD) - 1000;
|
||||
EXTMODULE_TIMER->EGR = 1; // Restart
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF;
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC2IE; // Enable this interrupt
|
||||
EXTMODULE_TIMER->CR1 |= TIM_CR1_CEN;
|
||||
|
||||
NVIC_EnableIRQ(EXTMODULE_TIMER_CC_IRQn);
|
||||
NVIC_SetPriority(EXTMODULE_TIMER_CC_IRQn, 7);
|
||||
}
|
||||
|
||||
void extmoduleSendNextFrame()
|
||||
{
|
||||
if (s_current_protocol[EXTERNAL_MODULE] == PROTO_PPM) {
|
||||
|
@ -283,8 +256,8 @@ void extmoduleSendNextFrame()
|
|||
DMA_InitStructure.DMA_Channel = EXTMODULE_USART_DMA_CHANNEL;
|
||||
DMA_InitStructure.DMA_PeripheralBaseAddr = CONVERT_PTR_UINT(&EXTMODULE_USART->DR);
|
||||
DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToPeripheral;
|
||||
DMA_InitStructure.DMA_Memory0BaseAddr = CONVERT_PTR_UINT(modulePulsesData[EXTERNAL_MODULE].pxx_uart.pulses);
|
||||
DMA_InitStructure.DMA_BufferSize = modulePulsesData[EXTERNAL_MODULE].pxx_uart.ptr - modulePulsesData[EXTERNAL_MODULE].pxx_uart.pulses;
|
||||
DMA_InitStructure.DMA_Memory0BaseAddr = CONVERT_PTR_UINT(modulePulsesData[EXTERNAL_MODULE].pxx_uart.getData());
|
||||
DMA_InitStructure.DMA_BufferSize = modulePulsesData[EXTERNAL_MODULE].pxx_uart.getSize();
|
||||
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
|
||||
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
|
||||
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
|
||||
|
@ -300,12 +273,12 @@ void extmoduleSendNextFrame()
|
|||
USART_DMACmd(EXTMODULE_USART, USART_DMAReq_Tx, ENABLE);
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC2IE;
|
||||
#else
|
||||
EXTMODULE_TIMER->CCR2 = *(modulePulsesData[EXTERNAL_MODULE].pxx.ptr - 1) - 4000; // 2mS in advance
|
||||
EXTMODULE_TIMER->CCR2 = modulePulsesData[EXTERNAL_MODULE].pxx.getLast() - 4000; // 2mS in advance
|
||||
EXTMODULE_TIMER_DMA_STREAM->CR &= ~DMA_SxCR_EN; // Disable DMA
|
||||
EXTMODULE_TIMER_DMA_STREAM->CR |= EXTMODULE_TIMER_DMA_CHANNEL | DMA_SxCR_DIR_0 | DMA_SxCR_MINC | DMA_SxCR_PSIZE_0 | DMA_SxCR_MSIZE_0 | DMA_SxCR_PL_0 | DMA_SxCR_PL_1;
|
||||
EXTMODULE_TIMER_DMA_STREAM->PAR = CONVERT_PTR_UINT(&EXTMODULE_TIMER->ARR);
|
||||
EXTMODULE_TIMER_DMA_STREAM->M0AR = CONVERT_PTR_UINT(modulePulsesData[EXTERNAL_MODULE].pxx.pulses);
|
||||
EXTMODULE_TIMER_DMA_STREAM->NDTR = modulePulsesData[EXTERNAL_MODULE].pxx.ptr - modulePulsesData[EXTERNAL_MODULE].pxx.pulses;
|
||||
EXTMODULE_TIMER_DMA_STREAM->M0AR = CONVERT_PTR_UINT(modulePulsesData[EXTERNAL_MODULE].pxx.getData());
|
||||
EXTMODULE_TIMER_DMA_STREAM->NDTR = modulePulsesData[EXTERNAL_MODULE].pxx.getSize();
|
||||
EXTMODULE_TIMER_DMA_STREAM->CR |= DMA_SxCR_EN | DMA_SxCR_TCIE; // Enable DMA
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -61,12 +61,12 @@ void intmoduleNoneStart()
|
|||
void intmoduleSendNextFrame()
|
||||
{
|
||||
if (s_current_protocol[INTERNAL_MODULE] == PROTO_PXX) {
|
||||
INTMODULE_TIMER->CCR2 = *(modulePulsesData[INTERNAL_MODULE].pxx.ptr - 1) - 4000; // 2mS in advance
|
||||
INTMODULE_TIMER->CCR2 = modulePulsesData[INTERNAL_MODULE].pxx.getLast() - 4000; // 2mS in advance
|
||||
INTMODULE_DMA_STREAM->CR &= ~DMA_SxCR_EN; // Disable DMA
|
||||
INTMODULE_DMA_STREAM->CR |= INTMODULE_DMA_CHANNEL | DMA_SxCR_DIR_0 | DMA_SxCR_MINC | DMA_SxCR_PSIZE_0 | DMA_SxCR_MSIZE_0 | DMA_SxCR_PL_0 | DMA_SxCR_PL_1;
|
||||
INTMODULE_DMA_STREAM->PAR = CONVERT_PTR_UINT(&INTMODULE_TIMER->ARR);
|
||||
INTMODULE_DMA_STREAM->M0AR = CONVERT_PTR_UINT(modulePulsesData[INTERNAL_MODULE].pxx.pulses);
|
||||
INTMODULE_DMA_STREAM->NDTR = modulePulsesData[INTERNAL_MODULE].pxx.ptr - modulePulsesData[INTERNAL_MODULE].pxx.pulses;
|
||||
INTMODULE_DMA_STREAM->M0AR = CONVERT_PTR_UINT(modulePulsesData[INTERNAL_MODULE].pxx.getData());
|
||||
INTMODULE_DMA_STREAM->NDTR = modulePulsesData[INTERNAL_MODULE].pxx.getSize();
|
||||
INTMODULE_DMA_STREAM->CR |= DMA_SxCR_EN | DMA_SxCR_TCIE; // Enable DMA
|
||||
}
|
||||
#if defined(TARANIS_INTERNAL_PPM)
|
||||
|
|
|
@ -149,7 +149,11 @@ void readKeysAndTrims()
|
|||
keys[index++].input(trims_input & i);
|
||||
}
|
||||
|
||||
#if defined(PWR_BUTTON_PRESS)
|
||||
if ((keys_input || trims_input || pwrPressed()) && (g_eeGeneral.backlightMode & e_backlight_mode_keys)) {
|
||||
#else
|
||||
if ((keys_input || trims_input) && (g_eeGeneral.backlightMode & e_backlight_mode_keys)) {
|
||||
#endif
|
||||
// on keypress turn the light on
|
||||
backlightOn();
|
||||
}
|
||||
|
|
|
@ -29,11 +29,11 @@ void intmodulePxxStart(void);
|
|||
void intmodulePpmStart(void);
|
||||
#endif
|
||||
|
||||
void extmoduleNoneStart(void);
|
||||
void extmoduleTimerStart(uint32_t period, uint8_t state);
|
||||
void extmodulePpmStart(void);
|
||||
void extmodulePxxStart(void);
|
||||
void extmoduleSerialStart(uint32_t baudrate, uint32_t period_half_us);
|
||||
void extmoduleCrossfireStart(void);
|
||||
|
||||
|
||||
void init_pxx(uint32_t port)
|
||||
{
|
||||
|
@ -96,7 +96,7 @@ void init_no_pulses(uint32_t port)
|
|||
if (port == INTERNAL_MODULE)
|
||||
intmoduleNoneStart();
|
||||
else
|
||||
extmoduleNoneStart();
|
||||
extmoduleTimerStart(18, false);
|
||||
}
|
||||
|
||||
void disable_no_pulses(uint32_t port)
|
||||
|
@ -107,14 +107,14 @@ void disable_no_pulses(uint32_t port)
|
|||
extmoduleStop();
|
||||
}
|
||||
|
||||
void init_crossfire(uint32_t port)
|
||||
void init_module_timer(uint32_t port, uint32_t period, uint8_t state)
|
||||
{
|
||||
if (port == EXTERNAL_MODULE) {
|
||||
extmoduleCrossfireStart();
|
||||
extmoduleTimerStart(period, state);
|
||||
}
|
||||
}
|
||||
|
||||
void disable_crossfire(uint32_t port)
|
||||
void disable_module_timer(uint32_t port)
|
||||
{
|
||||
if (port == EXTERNAL_MODULE) {
|
||||
extmoduleStop();
|
||||
|
|
|
@ -89,7 +89,7 @@ void telemetryPortSetDirectionInput()
|
|||
TELEMETRY_USART->CR1 |= USART_CR1_RE; // turn on receiver
|
||||
}
|
||||
|
||||
void sportSendBuffer(uint8_t * buffer, uint32_t count)
|
||||
void sportSendBuffer(const uint8_t * buffer, uint32_t count)
|
||||
{
|
||||
telemetryPortSetDirectionOutput();
|
||||
|
||||
|
|
|
@ -103,6 +103,9 @@ static void processFlySkySensor(const uint8_t *packet)
|
|||
else if (id == FS_ID_TEMP)
|
||||
// Temperature sensors have 40 degree offset
|
||||
value -= 400;
|
||||
else if (sensor->unit == UNIT_VOLTS)
|
||||
// Voltage types are signed 16bit integers
|
||||
value = (int16_t)value;
|
||||
setTelemetryValue(TELEM_PROTO_FLYSKY_IBUS, id, 0, instance, value, sensor->unit, sensor->precision);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,13 @@ enum FrSkyDataState {
|
|||
STATE_DATA_XOR,
|
||||
};
|
||||
|
||||
#if defined(PXX2)
|
||||
#include "io/pxx2.h"
|
||||
#define FRSKY_SPORT_BAUDRATE PXX2_BAUDRATE
|
||||
#else
|
||||
#define FRSKY_SPORT_BAUDRATE 57600
|
||||
#endif
|
||||
|
||||
#define FRSKY_D_BAUDRATE 9600
|
||||
|
||||
#define FRSKY_SPORT_PACKET_SIZE 9
|
||||
|
@ -175,7 +181,9 @@ enum FrSkyDataState {
|
|||
#define GASSUIT_MAX_FLOW_LAST_ID 0x0d6f
|
||||
#define GASSUIT_AVG_FLOW_FIRST_ID 0x0d70
|
||||
#define GASSUIT_AVG_FLOW_LAST_ID 0x0d7f
|
||||
#define DIY_FIRST_ID 0x5000
|
||||
#define SBEC_POWER_FIRST_ID 0x0e50
|
||||
#define SBEC_POWER_LAST_ID 0x0e5f
|
||||
#define DIY_FIRST_ID 0x5100
|
||||
#define DIY_LAST_ID 0x52ff
|
||||
#define DIY_STREAM_FIRST_ID 0x5000
|
||||
#define DIY_STREAM_LAST_ID 0x50ff
|
||||
|
|
|
@ -77,6 +77,8 @@ const FrSkySportSensor sportSensors[] = {
|
|||
{ GASSUIT_FLOW_FIRST_ID, GASSUIT_FLOW_LAST_ID, 0, ZSTR_GASSUIT_FLOW, UNIT_MILLILITERS, 0 }, //TODO this needs to be changed to ml/min, but need eeprom conversion
|
||||
{ GASSUIT_MAX_FLOW_FIRST_ID, GASSUIT_MAX_FLOW_LAST_ID, 0, ZSTR_GASSUIT_MAX_FLOW, UNIT_MILLILITERS, 0 }, //TODO this needs to be changed to ml/min, but need eeprom conversion
|
||||
{ GASSUIT_AVG_FLOW_FIRST_ID, GASSUIT_AVG_FLOW_LAST_ID, 0, ZSTR_GASSUIT_AVG_FLOW, UNIT_MILLILITERS, 0 }, //TODO this needs to be changed to ml/min, but need eeprom conversion
|
||||
{ SBEC_POWER_FIRST_ID, SBEC_POWER_LAST_ID, 0, ZSTR_SBEC_VOLTAGE, UNIT_VOLTS, 2 },
|
||||
{ SBEC_POWER_FIRST_ID, SBEC_POWER_LAST_ID, 1, ZSTR_SBEC_CURRENT, UNIT_AMPS, 2 },
|
||||
{ 0, 0, 0, NULL, UNIT_RAW, 0 } // sentinel
|
||||
};
|
||||
|
||||
|
@ -235,6 +237,10 @@ void sportProcessTelemetryPacket(const uint8_t * packet)
|
|||
else if (id >= ESC_TEMPERATURE_FIRST_ID && id <= ESC_TEMPERATURE_LAST_ID) {
|
||||
sportProcessTelemetryPacket(id, 0, instance, data & 0x00ff);
|
||||
}
|
||||
else if (id >= SBEC_POWER_FIRST_ID && id <= SBEC_POWER_LAST_ID) {
|
||||
sportProcessTelemetryPacket(id, 0, instance, (data & 0xffff) / 10);
|
||||
sportProcessTelemetryPacket(id, 1, instance, (data >> 16) / 10);
|
||||
}
|
||||
else if (id >= DIY_STREAM_FIRST_ID && id <= DIY_STREAM_LAST_ID) {
|
||||
#if defined(LUA)
|
||||
if (luaInputTelemetryFifo && luaInputTelemetryFifo->hasSpace(sizeof(SportTelemetryPacket))) {
|
||||
|
|
|
@ -28,8 +28,6 @@ uint8_t telemetryRxBufferCount = 0;
|
|||
uint8_t wshhStreaming = 0;
|
||||
#endif
|
||||
|
||||
uint8_t link_counter = 0;
|
||||
|
||||
uint8_t telemetryState = TELEMETRY_INIT;
|
||||
|
||||
TelemetryData telemetryData;
|
||||
|
@ -216,11 +214,8 @@ void telemetryReset()
|
|||
}
|
||||
|
||||
telemetryStreaming = 0; // reset counter only if valid frsky packets are being detected
|
||||
link_counter = 0;
|
||||
|
||||
telemetryState = TELEMETRY_INIT;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// we don't reset the telemetry here as we would also reset the consumption after model load
|
||||
|
|
|
@ -41,8 +41,6 @@ extern uint8_t telemetryStreaming; // >0 (true) == data is streaming in. 0 = no
|
|||
extern uint8_t wshhStreaming;
|
||||
#endif
|
||||
|
||||
extern uint8_t link_counter;
|
||||
|
||||
enum TelemetryStates {
|
||||
TELEMETRY_INIT,
|
||||
TELEMETRY_OK,
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
#define TR_DSM_PROTOCOLS "LP45""DSM2""DSMX"
|
||||
|
||||
#define LEN_MULTI_PROTOCOLS "\006"
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 "
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 ""BugMin""Traxas""NC1701""E01X\0 ""V911S\0""GD00X\0"
|
||||
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
|
||||
|
@ -1274,3 +1274,5 @@
|
|||
#define ZSTR_GASSUIT_RES_PERC "GRPc"
|
||||
#define ZSTR_GASSUIT_MAX_FLOW "GMFl"
|
||||
#define ZSTR_GASSUIT_AVG_FLOW "GAFl"
|
||||
#define ZSTR_SBEC_VOLTAGE "BecV"
|
||||
#define ZSTR_SBEC_CURRENT "BecA"
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
#define TR_DSM_PROTOCOLS "LP45""DSM2""DSMX" //LP45 =Low Power 4 und 5 Kanal
|
||||
|
||||
#define LEN_MULTI_PROTOCOLS "\006"
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 "
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 ""BugMin""Traxas""NC1701""E01X\0 ""V911S\0""GD00X\0"
|
||||
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
|
||||
|
@ -1272,3 +1272,5 @@
|
|||
#define ZSTR_GASSUIT_RES_PERC "GRPc"
|
||||
#define ZSTR_GASSUIT_MAX_FLOW "GMFl"
|
||||
#define ZSTR_GASSUIT_AVG_FLOW "GAFl"
|
||||
#define ZSTR_SBEC_VOLTAGE "BecV"
|
||||
#define ZSTR_SBEC_CURRENT "BecA"
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
#define TR_DSM_PROTOCOLS "LP45""DSM2""DSMX"
|
||||
|
||||
#define LEN_MULTI_PROTOCOLS "\006"
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 "
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 ""BugMin""Traxas""NC1701""E01X\0 ""V911S\0""GD00X\0"
|
||||
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
|
||||
|
@ -1283,3 +1283,5 @@
|
|||
#define ZSTR_GASSUIT_RES_PERC "GRPc"
|
||||
#define ZSTR_GASSUIT_MAX_FLOW "GMFl"
|
||||
#define ZSTR_GASSUIT_AVG_FLOW "GAFl"
|
||||
#define ZSTR_SBEC_VOLTAGE "BecV"
|
||||
#define ZSTR_SBEC_CURRENT "BecA"
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
#define TR_DSM_PROTOCOLS "LP45""DSM2""DSMX"
|
||||
|
||||
#define LEN_MULTI_PROTOCOLS "\006"
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 "
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 ""BugMin""Traxas""NC1701""E01X\0 ""V911S\0""GD00X\0"
|
||||
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
|
||||
|
@ -1278,3 +1278,5 @@
|
|||
#define ZSTR_GASSUIT_RES_PERC "GRPc"
|
||||
#define ZSTR_GASSUIT_MAX_FLOW "GMFl"
|
||||
#define ZSTR_GASSUIT_AVG_FLOW "GAFl"
|
||||
#define ZSTR_SBEC_VOLTAGE "BecV"
|
||||
#define ZSTR_SBEC_CURRENT "BecA"
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
#define TR_DSM_PROTOCOLS "LP45""DSM2""DSMX"
|
||||
|
||||
#define LEN_MULTI_PROTOCOLS "\006"
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 "
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 ""BugMin""Traxas""NC1701""E01X\0 ""V911S\0""GD00X\0"
|
||||
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
|
||||
|
@ -1263,4 +1263,5 @@
|
|||
#define ZSTR_GASSUIT_RES_VOL "GRVl"
|
||||
#define ZSTR_GASSUIT_RES_PERC "GRPc"
|
||||
#define ZSTR_GASSUIT_MAX_FLOW "GMFl"
|
||||
#define ZSTR_GASSUIT_AVG_FLOW "GAFl"
|
||||
#define ZSTR_SBEC_VOLTAGE "BecV"
|
||||
#define ZSTR_SBEC_CURRENT "BecA"
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
#define TR_DSM_PROTOCOLS "LP45""DSM2""DSMX"
|
||||
|
||||
#define LEN_MULTI_PROTOCOLS "\006"
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 "
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 ""BugMin""Traxas""NC1701""E01X\0 ""V911S\0""GD00X\0"
|
||||
|
||||
#define TR_MULTI_CUSTOM "Perso"
|
||||
|
||||
|
@ -1290,3 +1290,5 @@
|
|||
#define ZSTR_GASSUIT_RES_PERC "GRPc"
|
||||
#define ZSTR_GASSUIT_MAX_FLOW "GMFl"
|
||||
#define ZSTR_GASSUIT_AVG_FLOW "GAFl"
|
||||
#define ZSTR_SBEC_VOLTAGE "BecV"
|
||||
#define ZSTR_SBEC_CURRENT "BecA"
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
#define TR_DSM_PROTOCOLS "LP45""DSM2""DSMX"
|
||||
|
||||
#define LEN_MULTI_PROTOCOLS "\006"
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 "
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 ""BugMin""Traxas""NC1701""E01X\0 ""V911S\0""GD00X\0"
|
||||
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
|
||||
|
@ -1273,3 +1273,5 @@
|
|||
#define ZSTR_GASSUIT_RES_PERC "GRPc"
|
||||
#define ZSTR_GASSUIT_MAX_FLOW "GMFl"
|
||||
#define ZSTR_GASSUIT_AVG_FLOW "GAFl"
|
||||
#define ZSTR_SBEC_VOLTAGE "BecV"
|
||||
#define ZSTR_SBEC_CURRENT "BecA"
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
#define TR_DSM_PROTOCOLS "LP45""DSM2""DSMX"
|
||||
|
||||
#define LEN_MULTI_PROTOCOLS "\006"
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 "
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 ""BugMin""Traxas""NC1701""E01X\0 ""V911S\0""GD00X\0"
|
||||
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
|
||||
|
@ -1280,3 +1280,5 @@
|
|||
#define ZSTR_GASSUIT_RES_PERC "GRPc"
|
||||
#define ZSTR_GASSUIT_MAX_FLOW "GMFl"
|
||||
#define ZSTR_GASSUIT_AVG_FLOW "GAFl"
|
||||
#define ZSTR_SBEC_VOLTAGE "BecV"
|
||||
#define ZSTR_SBEC_CURRENT "BecA"
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
#define TR_DSM_PROTOCOLS "LP45""DSM2""DSMX"
|
||||
|
||||
#define LEN_MULTI_PROTOCOLS "\006"
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 "
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 ""BugMin""Traxas""NC1701""E01X\0 ""V911S\0""GD00X\0"
|
||||
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
|
||||
|
@ -1274,3 +1274,5 @@
|
|||
#define ZSTR_GASSUIT_RES_PERC "GRPc"
|
||||
#define ZSTR_GASSUIT_MAX_FLOW "GMFl"
|
||||
#define ZSTR_GASSUIT_AVG_FLOW "GAFl"
|
||||
#define ZSTR_SBEC_VOLTAGE "BecV"
|
||||
#define ZSTR_SBEC_CURRENT "BecA"
|
|
@ -114,7 +114,7 @@
|
|||
#define TR_DSM_PROTOCOLS "LP45""DSM2""DSMX"
|
||||
|
||||
#define LEN_MULTI_PROTOCOLS "\006"
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 "
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 ""BugMin""Traxas""NC1701""E01X\0 ""V911S\0""GD00X\0"
|
||||
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
|
||||
|
@ -1277,3 +1277,5 @@
|
|||
#define ZSTR_GASSUIT_RES_PERC "GRPc"
|
||||
#define ZSTR_GASSUIT_MAX_FLOW "GMFl"
|
||||
#define ZSTR_GASSUIT_AVG_FLOW "GAFl"
|
||||
#define ZSTR_SBEC_VOLTAGE "BecV"
|
||||
#define ZSTR_SBEC_CURRENT "BecA"
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
#define TR_DSM_PROTOCOLS "LP45""DSM2""DSMX"
|
||||
|
||||
#define LEN_MULTI_PROTOCOLS "\006"
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 "
|
||||
#define TR_MULTI_PROTOCOLS "FlySky""Hubsan""FrSky\0""Hisky\0""V2x2\0 ""DSM\0 ""Devo\0 ""YD717\0""KN\0 ""SymaX\0""SLT\0 ""CX10\0 ""CG023\0""Bayang""ESky\0 ""MT99XX""MJXq\0 ""Shenqi""FY326\0""SFHSS\0""J6 PRO""FQ777\0""Assan\0""Hontai""OpnLrs""FS 2A\0""Q2x2\0 ""Walk.\0""Q303\0 ""GW008\0""DM002\0""Cabell""Esy150""H8 3D\0""Corona""CFlie\0""Hitec\0""WFly\0 ""Bugs\0 ""BugMin""Traxas""NC1701""E01X\0 ""V911S\0""GD00X\0"
|
||||
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
|
||||
|
@ -1285,3 +1285,5 @@
|
|||
#define ZSTR_GASSUIT_RES_PERC "GRPc"
|
||||
#define ZSTR_GASSUIT_MAX_FLOW "GMFl"
|
||||
#define ZSTR_GASSUIT_AVG_FLOW "GAFl"
|
||||
#define ZSTR_SBEC_VOLTAGE "BecV"
|
||||
#define ZSTR_SBEC_CURRENT "BecA"
|
||||
|
|
|
@ -40,7 +40,8 @@ options_sky9x = {
|
|||
"faimode": ("FAI", "YES", None),
|
||||
"faichoice": ("FAI", "CHOICE", None),
|
||||
"nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"),
|
||||
"multimodule": ("MULTIMODULE", "YES", "NO")
|
||||
"multimodule": ("MULTIMODULE", "YES", "NO"),
|
||||
"flexr9m": ("MODULE_R9M_FLEX_FW", "YES", None)
|
||||
}
|
||||
|
||||
options_ar9x = {
|
||||
|
@ -61,7 +62,8 @@ options_ar9x = {
|
|||
"faichoice": ("FAI", "CHOICE", None),
|
||||
"nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"),
|
||||
# "rtc": ("RTCLOCK", "YES", "NO"),
|
||||
"multimodule": ("MULTIMODULE", "YES", "NO")
|
||||
"multimodule": ("MULTIMODULE", "YES", "NO"),
|
||||
"flexr9m": ("MODULE_R9M_FLEX_FW", "YES", None)
|
||||
}
|
||||
|
||||
options_taranis = {
|
||||
|
|
|
@ -16,12 +16,12 @@ for i, s in enumerate(["virgola", "un", "e", "meno", "ora", "ore", "minuto", "mi
|
|||
systemSounds.append((s, filename(PROMPT_SYSTEM_BASE + 103 + i)))
|
||||
for i, (s, f) in enumerate([("volt", "volt0"),
|
||||
("ampere", "amp0"),
|
||||
("milliampers", "mamp0"),
|
||||
("milliampere", "mamp0"),
|
||||
("nodo", "knot0"), ("nodi", "knot1"),
|
||||
("metro al secondo", "mps0"), ("metri al secondo", "msp1"),
|
||||
("piede al secondo", "fps0"), ("piedi al secondo", "fps1"),
|
||||
("chilometro ora", "kph0"), ("chilometri orari", "kph1"),
|
||||
("miglio per ora", "mph0"), ("miglia per ora", "mph1"),
|
||||
("metri al secondo", "mps0"), ("metri al secondo", "msp1"),
|
||||
("piedi al secondo", "fps0"), ("piedi al secondo", "fps1"),
|
||||
("chilometri orari", "kph0"), ("chilometri orari", "kph1"),
|
||||
("miglia orarie", "mph0"), ("miglia orarie", "mph1"),
|
||||
("metro", "meter0"), ("metri", "meter1"),
|
||||
("piede", "foot0"), ("piedi", "foot1"),
|
||||
("grado celsius", "celsius0"), ("gradi celsius", "celsius1"),
|
||||
|
@ -34,9 +34,9 @@ for i, (s, f) in enumerate([("volt", "volt0"),
|
|||
("r p m", "rpm0"), ("r p m", "rpm1"),
|
||||
("g", "g0"), ("g", "g1"),
|
||||
("grado", "degree0"), ("gradi", "degree1"),
|
||||
("radian", "rad0"), ("radians", "rad1"),
|
||||
("radiante", "rad0"), ("radianti", "rad1"),
|
||||
("millilitro", "m10"), ("millilitri", "m11"),
|
||||
("oncia", "founce0"), ("once", "founce1"),
|
||||
("oncia fluida", "founce0"), ("once fluide", "founce1"),
|
||||
("ora", "hour0"), ("ore", "hour1"),
|
||||
("minuto", "minute0"), ("minuti", "minute1"),
|
||||
("secondo", "second0"), ("secondi", "second1"),
|
||||
|
@ -47,7 +47,7 @@ for s, f, a in [("radio inattiva controllare", "inactiv", 486),
|
|||
("controllo motore non in posizione, verificare", "thralert", 481),
|
||||
("interruttori non in posizione, verificare", "swalert", 482),
|
||||
("eeprom corrotta", "eebad", NO_ALTERNATE),
|
||||
("formattazzione eeprom in corso", "eeformat", NO_ALTERNATE),
|
||||
("formattazione eeprom in corso", "eeformat", NO_ALTERNATE),
|
||||
("errore", "error", NO_ALTERNATE),
|
||||
("trim centrato", "midtrim", 495),
|
||||
("potenziometro centrato", "midpot", 496),
|
||||
|
@ -70,14 +70,14 @@ for s, f, a in [("radio inattiva controllare", "inactiv", 486),
|
|||
("Problema all'antenna della radio", "swr_red", NO_ALTERNATE),
|
||||
("Telemetria assente", "telemko", NO_ALTERNATE),
|
||||
("Telemetria disponibile", "telemok", NO_ALTERNATE),
|
||||
("servo overload", "servoko", NO_ALTERNATE),
|
||||
("power overload", "rxko", NO_ALTERNATE),
|
||||
("receiver still connected", "modelpwr", NO_ALTERNATE),
|
||||
("sovraccarico servo", "servoko", NO_ALTERNATE),
|
||||
("sovraccarico di alimentazione", "rxko", NO_ALTERNATE),
|
||||
("ricevente ancora connessa", "modelpwr", NO_ALTERNATE),
|
||||
]:
|
||||
systemSounds.append((s, filename(f, a)))
|
||||
for i, s in enumerate(["timer", "", "tensione", "tensione", "trasmissione", "ricezione", "altitudine", "motore",
|
||||
"carburante", "temperatura", "temperatura", "velocità", "distanza", "altitudine", "cella lipo",
|
||||
"totale lipo", "tensione", "corrente", "consumo", "potenza", "accellerazione X", "accellerazione Y", "accellerazione Z",
|
||||
"totale lipo", "tensione", "corrente", "consumo", "potenza", "accelerazione X", "accelerazione Y", "accelerazione Z",
|
||||
"direzione", "variometro", "minimo", "massimo"]):
|
||||
systemSounds.append((s, filename(PROMPT_SYSTEM_BASE + 135 + i)))
|
||||
for i, (s, f) in enumerate([("carrello chiuso", "gearup"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue