Merge with latest 2.3
This commit is contained in:
@@ -114,11 +114,13 @@ GeneralSettings::GeneralSettings()
|
|||||||
speakerVolume = 12;
|
speakerVolume = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_HORUS(board)) {
|
if (IS_JUMPER_T16(board))
|
||||||
strcpy(bluetoothName, "Horus");
|
strcpy(bluetoothName, "t16");
|
||||||
|
else if (IS_HORUS(board)) {
|
||||||
|
strcpy(bluetoothName, "horus");
|
||||||
}
|
}
|
||||||
else if (IS_TARANIS_X9E(board) || IS_TARANIS_SMALL(board)) {
|
else if (IS_TARANIS_X9E(board) || IS_TARANIS_SMALL(board)) {
|
||||||
strcpy(bluetoothName, "Taranis");
|
strcpy(bluetoothName, "taranis");
|
||||||
}
|
}
|
||||||
|
|
||||||
templateSetup = g.profile[g.sessionId()].channelOrder();
|
templateSetup = g.profile[g.sessionId()].channelOrder();
|
||||||
|
|||||||
@@ -1536,7 +1536,7 @@ void MdiChild::writeEeprom() // write to Tx
|
|||||||
qDebug() << "Searching for SD card, found" << radioPath;
|
qDebug() << "Searching for SD card, found" << radioPath;
|
||||||
if (radioPath.isEmpty()) {
|
if (radioPath.isEmpty()) {
|
||||||
qDebug() << "MdiChild::writeEeprom(): Horus radio not found";
|
qDebug() << "MdiChild::writeEeprom(): Horus radio not found";
|
||||||
QMessageBox::critical(this, CPN_STR_TTL_ERROR, tr("Unable to find Horus radio SD card!"));
|
QMessageBox::critical(this, CPN_STR_TTL_ERROR, tr("Unable to find radio SD card!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (saveFile(radioPath, false)) {
|
if (saveFile(radioPath, false)) {
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ bool readEeprom(const QString & filename, ProgressWidget * progress)
|
|||||||
qDebug() << "Searching for SD card, found" << radioPath;
|
qDebug() << "Searching for SD card, found" << radioPath;
|
||||||
if (radioPath.isEmpty()) {
|
if (radioPath.isEmpty()) {
|
||||||
QMessageBox::critical(progress, CPN_STR_TTL_ERROR,
|
QMessageBox::critical(progress, CPN_STR_TTL_ERROR,
|
||||||
QCoreApplication::translate("RadioInterface", "Unable to find Horus radio SD card!"));
|
QCoreApplication::translate("RadioInterface", "Unable to find radio SD card!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
RadioData radioData;
|
RadioData radioData;
|
||||||
|
|||||||
@@ -14,12 +14,9 @@ local function create(zone, options)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function update(wgt, options)
|
local function update(wgt, options)
|
||||||
if (wgt==nil) then
|
if (wgt == nil) then return end
|
||||||
print("update(nil)")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
wgt.options = options
|
wgt.options = options
|
||||||
print("TimerNumB:" .. options.Timer)
|
--print("TimerNumB:" .. options.Timer)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function background(wgt)
|
local function background(wgt)
|
||||||
@@ -28,11 +25,11 @@ end
|
|||||||
|
|
||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
|
|
||||||
-- This size is for top bar wgts
|
-- Zone size: top bar widgets
|
||||||
local function refreshZoneTiny(wgt)
|
local function refreshZoneTiny(wgt)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Size is 160x32 1/8th
|
--- Zone size: 160x32 1/8th
|
||||||
local function refreshZoneSmall(wgt)
|
local function refreshZoneSmall(wgt)
|
||||||
local t1 = model.getTimer(wgt.options.Timer-1)
|
local t1 = model.getTimer(wgt.options.Timer-1)
|
||||||
local timerInfo = string.format("T%s: ", wgt.options.Timer)
|
local timerInfo = string.format("T%s: ", wgt.options.Timer)
|
||||||
@@ -41,7 +38,8 @@ local function refreshZoneSmall(wgt)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Size is 225x98 1/4th (no sliders/trim)
|
--- Zone size: 180x70 1/4th (with sliders/trim)
|
||||||
|
--- Zone size: 225x98 1/4th (no sliders/trim)
|
||||||
local function refreshZoneMedium(wgt)
|
local function refreshZoneMedium(wgt)
|
||||||
local t1 = model.getTimer(wgt.options.Timer-1)
|
local t1 = model.getTimer(wgt.options.Timer-1)
|
||||||
--print(t1.value)
|
--print(t1.value)
|
||||||
@@ -50,7 +48,7 @@ local function refreshZoneMedium(wgt)
|
|||||||
lcd.drawTimer(wgt.zone.x, wgt.zone.y+3, t1.value, XXLSIZE + CUSTOM_COLOR)
|
lcd.drawTimer(wgt.zone.x, wgt.zone.y+3, t1.value, XXLSIZE + CUSTOM_COLOR)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Size is 192x152 1/2
|
--- Zone size: 192x152 1/2
|
||||||
local function refreshZoneLarge(wgt)
|
local function refreshZoneLarge(wgt)
|
||||||
local t1 = model.getTimer(wgt.options.Timer-1)
|
local t1 = model.getTimer(wgt.options.Timer-1)
|
||||||
--print(t1.value)
|
--print(t1.value)
|
||||||
@@ -59,8 +57,8 @@ local function refreshZoneLarge(wgt)
|
|||||||
lcd.drawTimer(wgt.zone.x, wgt.zone.y+15, t1.value, XXLSIZE + CUSTOM_COLOR)
|
lcd.drawTimer(wgt.zone.x, wgt.zone.y+15, t1.value, XXLSIZE + CUSTOM_COLOR)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Size is 390x172 1/1
|
--- Zone size: 390x172 1/1
|
||||||
--- Size is 460x252 1/1 (no sliders/trim/topbar)
|
--- Zone size: 460x252 1/1 (no sliders/trim/topbar)
|
||||||
local function refreshZoneXLarge(wgt)
|
local function refreshZoneXLarge(wgt)
|
||||||
local t1 = model.getTimer(wgt.options.Timer-1)
|
local t1 = model.getTimer(wgt.options.Timer-1)
|
||||||
--print(t1.value)
|
--print(t1.value)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
bool menuStatsGraph(event_t event)
|
bool menuStatsGraph(event_t event)
|
||||||
{
|
{
|
||||||
switch(event) {
|
switch (event) {
|
||||||
case EVT_KEY_LONG(KEY_ENTER):
|
case EVT_KEY_LONG(KEY_ENTER):
|
||||||
g_eeGeneral.globalTimer = 0;
|
g_eeGeneral.globalTimer = 0;
|
||||||
storageDirty(EE_GENERAL);
|
storageDirty(EE_GENERAL);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ endmacro(add_lua_export_target)
|
|||||||
|
|
||||||
set(LUA_INCLUDES
|
set(LUA_INCLUDES
|
||||||
-DCPUARM -DLUA -DLUA_INPUTS -DLUA_EXPORT_GENERATION -DSIMU
|
-DCPUARM -DLUA -DLUA_INPUTS -DLUA_EXPORT_GENERATION -DSIMU
|
||||||
|
-I${RADIO_SRC_DIRECTORY}
|
||||||
-I${RADIO_SRC_DIR}/targets/${TARGET_DIR}
|
-I${RADIO_SRC_DIR}/targets/${TARGET_DIR}
|
||||||
-I${RADIO_SRC_DIR}/thirdparty
|
-I${RADIO_SRC_DIR}/thirdparty
|
||||||
-I${RADIO_SRC_DIR}/targets/common/arm/stm32
|
-I${RADIO_SRC_DIR}/targets/common/arm/stm32
|
||||||
|
|||||||
+4
-3
@@ -201,7 +201,8 @@ void checkEeprom()
|
|||||||
{
|
{
|
||||||
#if defined(RTC_BACKUP_RAM) && !defined(SIMU)
|
#if defined(RTC_BACKUP_RAM) && !defined(SIMU)
|
||||||
if (TIME_TO_BACKUP_RAM()) {
|
if (TIME_TO_BACKUP_RAM()) {
|
||||||
rambackupWrite();
|
if (!globalData.unexpectedShutdown)
|
||||||
|
rambackupWrite();
|
||||||
rambackupDirtyMsk = 0;
|
rambackupDirtyMsk = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -522,10 +523,10 @@ void perMain()
|
|||||||
periodicTick();
|
periodicTick();
|
||||||
DEBUG_TIMER_STOP(debugTimerPerMain1);
|
DEBUG_TIMER_STOP(debugTimerPerMain1);
|
||||||
|
|
||||||
if (mainRequestFlags & (1 << REQUEST_FLIGHT_RESET)) {
|
if (mainRequestFlags & (1u << REQUEST_FLIGHT_RESET)) {
|
||||||
TRACE("Executing requested Flight Reset");
|
TRACE("Executing requested Flight Reset");
|
||||||
flightReset();
|
flightReset();
|
||||||
mainRequestFlags &= ~(1 << REQUEST_FLIGHT_RESET);
|
mainRequestFlags &= ~(1u << REQUEST_FLIGHT_RESET);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkBacklight();
|
checkBacklight();
|
||||||
|
|||||||
+3
-1
@@ -505,10 +505,12 @@ extern uint8_t flightModeTransitionLast;
|
|||||||
#define availableMemory() ((unsigned int)((unsigned char *)&_heap_end - heap))
|
#define availableMemory() ((unsigned int)((unsigned char *)&_heap_end - heap))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern uint32_t nextMixerTime[NUM_MODULES];
|
||||||
|
|
||||||
void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms);
|
void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms);
|
||||||
void evalMixes(uint8_t tick10ms);
|
void evalMixes(uint8_t tick10ms);
|
||||||
void doMixerCalculations();
|
void doMixerCalculations();
|
||||||
void scheduleNextMixerCalculation(uint8_t module, uint16_t period_ms);
|
void scheduleNextMixerCalculation(uint8_t module, uint32_t period_ms);
|
||||||
|
|
||||||
void checkTrims();
|
void checkTrims();
|
||||||
void perMain();
|
void perMain();
|
||||||
|
|||||||
@@ -372,6 +372,11 @@ inline int8_t defaultModuleChannels_M8(uint8_t idx)
|
|||||||
return maxModuleChannels_M8(idx);
|
return maxModuleChannels_M8(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline uint8_t sentModulePXXChannels(uint8_t idx)
|
||||||
|
{
|
||||||
|
return 8 + g_model.moduleData[idx].channelsCount;
|
||||||
|
}
|
||||||
|
|
||||||
inline int8_t sentModuleChannels(uint8_t idx)
|
inline int8_t sentModuleChannels(uint8_t idx)
|
||||||
{
|
{
|
||||||
if (isModuleCrossfire(idx))
|
if (isModuleCrossfire(idx))
|
||||||
@@ -381,7 +386,7 @@ inline int8_t sentModuleChannels(uint8_t idx)
|
|||||||
else if (isModuleSBUS(idx))
|
else if (isModuleSBUS(idx))
|
||||||
return 16;
|
return 16;
|
||||||
else
|
else
|
||||||
return 8 + g_model.moduleData[idx].channelsCount;
|
return sentModulePXXChannels(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool isDefaultModelRegistrationID()
|
inline bool isDefaultModelRegistrationID()
|
||||||
|
|||||||
+21
-16
@@ -219,21 +219,21 @@ void enablePulsesExternalModule(uint8_t protocol)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupPulsesExternalModule(uint8_t protocol)
|
bool setupPulsesExternalModule(uint8_t protocol)
|
||||||
{
|
{
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
#if defined(PXX1)
|
#if defined(PXX1)
|
||||||
case PROTOCOL_CHANNELS_PXX1_PULSES:
|
case PROTOCOL_CHANNELS_PXX1_PULSES:
|
||||||
extmodulePulsesData.pxx.setupFrame(EXTERNAL_MODULE);
|
extmodulePulsesData.pxx.setupFrame(EXTERNAL_MODULE);
|
||||||
scheduleNextMixerCalculation(EXTERNAL_MODULE, PXX_PULSES_PERIOD);
|
scheduleNextMixerCalculation(EXTERNAL_MODULE, PXX_PULSES_PERIOD);
|
||||||
break;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PXX1) && defined(HARDWARE_EXTERNAL_MODULE_SIZE_SML)
|
#if defined(PXX1) && defined(HARDWARE_EXTERNAL_MODULE_SIZE_SML)
|
||||||
case PROTOCOL_CHANNELS_PXX1_SERIAL:
|
case PROTOCOL_CHANNELS_PXX1_SERIAL:
|
||||||
extmodulePulsesData.pxx_uart.setupFrame(EXTERNAL_MODULE);
|
extmodulePulsesData.pxx_uart.setupFrame(EXTERNAL_MODULE);
|
||||||
scheduleNextMixerCalculation(EXTERNAL_MODULE, EXTMODULE_PXX1_SERIAL_PERIOD);
|
scheduleNextMixerCalculation(EXTERNAL_MODULE, EXTMODULE_PXX1_SERIAL_PERIOD);
|
||||||
break;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PXX2)
|
#if defined(PXX2)
|
||||||
@@ -241,14 +241,14 @@ void setupPulsesExternalModule(uint8_t protocol)
|
|||||||
case PROTOCOL_CHANNELS_PXX2_LOWSPEED:
|
case PROTOCOL_CHANNELS_PXX2_LOWSPEED:
|
||||||
extmodulePulsesData.pxx2.setupFrame(EXTERNAL_MODULE);
|
extmodulePulsesData.pxx2.setupFrame(EXTERNAL_MODULE);
|
||||||
scheduleNextMixerCalculation(EXTERNAL_MODULE, PXX2_PERIOD);
|
scheduleNextMixerCalculation(EXTERNAL_MODULE, PXX2_PERIOD);
|
||||||
break;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SBUS)
|
#if defined(SBUS)
|
||||||
case PROTOCOL_CHANNELS_SBUS:
|
case PROTOCOL_CHANNELS_SBUS:
|
||||||
setupPulsesSbus();
|
setupPulsesSbus();
|
||||||
scheduleNextMixerCalculation(EXTERNAL_MODULE, SBUS_PERIOD);
|
scheduleNextMixerCalculation(EXTERNAL_MODULE, SBUS_PERIOD);
|
||||||
break;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(DSM2)
|
#if defined(DSM2)
|
||||||
@@ -257,32 +257,33 @@ void setupPulsesExternalModule(uint8_t protocol)
|
|||||||
case PROTOCOL_CHANNELS_DSM2_DSMX:
|
case PROTOCOL_CHANNELS_DSM2_DSMX:
|
||||||
setupPulsesDSM2();
|
setupPulsesDSM2();
|
||||||
scheduleNextMixerCalculation(EXTERNAL_MODULE, DSM2_PERIOD);
|
scheduleNextMixerCalculation(EXTERNAL_MODULE, DSM2_PERIOD);
|
||||||
break;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CROSSFIRE)
|
#if defined(CROSSFIRE)
|
||||||
case PROTOCOL_CHANNELS_CROSSFIRE:
|
case PROTOCOL_CHANNELS_CROSSFIRE:
|
||||||
setupPulsesCrossfire();
|
setupPulsesCrossfire();
|
||||||
scheduleNextMixerCalculation(EXTERNAL_MODULE, CROSSFIRE_PERIOD);
|
scheduleNextMixerCalculation(EXTERNAL_MODULE, CROSSFIRE_PERIOD);
|
||||||
break;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MULTIMODULE)
|
#if defined(MULTIMODULE)
|
||||||
case PROTOCOL_CHANNELS_MULTIMODULE:
|
case PROTOCOL_CHANNELS_MULTIMODULE:
|
||||||
setupPulsesMultiExternalModule();
|
setupPulsesMultiExternalModule();
|
||||||
scheduleNextMixerCalculation(EXTERNAL_MODULE, MULTIMODULE_PERIOD);
|
scheduleNextMixerCalculation(EXTERNAL_MODULE, MULTIMODULE_PERIOD);
|
||||||
break;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PPM)
|
#if defined(PPM)
|
||||||
case PROTOCOL_CHANNELS_PPM:
|
case PROTOCOL_CHANNELS_PPM:
|
||||||
setupPulsesPPMExternalModule();
|
setupPulsesPPMExternalModule();
|
||||||
scheduleNextMixerCalculation(EXTERNAL_MODULE, PPM_PERIOD(EXTERNAL_MODULE));
|
scheduleNextMixerCalculation(EXTERNAL_MODULE, PPM_PERIOD(EXTERNAL_MODULE));
|
||||||
break;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
scheduleNextMixerCalculation(EXTERNAL_MODULE, 50/*ms*/);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,7 +339,9 @@ bool setupPulsesInternalModule(uint8_t protocol)
|
|||||||
#if defined(PXX1) && defined(INTMODULE_USART)
|
#if defined(PXX1) && defined(INTMODULE_USART)
|
||||||
case PROTOCOL_CHANNELS_PXX1_SERIAL:
|
case PROTOCOL_CHANNELS_PXX1_SERIAL:
|
||||||
intmodulePulsesData.pxx_uart.setupFrame(INTERNAL_MODULE);
|
intmodulePulsesData.pxx_uart.setupFrame(INTERNAL_MODULE);
|
||||||
#if !defined(INTMODULE_HEARTBEAT)
|
#if defined(INTMODULE_HEARTBEAT)
|
||||||
|
scheduleNextMixerCalculation(INTERNAL_MODULE, INTMODULE_PXX1_SERIAL_PERIOD + 1 /* backup */);
|
||||||
|
#else
|
||||||
scheduleNextMixerCalculation(INTERNAL_MODULE, INTMODULE_PXX1_SERIAL_PERIOD);
|
scheduleNextMixerCalculation(INTERNAL_MODULE, INTMODULE_PXX1_SERIAL_PERIOD);
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
@@ -351,11 +354,13 @@ bool setupPulsesInternalModule(uint8_t protocol)
|
|||||||
if (moduleState[INTERNAL_MODULE].mode == MODULE_MODE_SPECTRUM_ANALYSER || moduleState[INTERNAL_MODULE].mode == MODULE_MODE_POWER_METER) {
|
if (moduleState[INTERNAL_MODULE].mode == MODULE_MODE_SPECTRUM_ANALYSER || moduleState[INTERNAL_MODULE].mode == MODULE_MODE_POWER_METER) {
|
||||||
scheduleNextMixerCalculation(INTERNAL_MODULE, PXX2_TOOLS_PERIOD);
|
scheduleNextMixerCalculation(INTERNAL_MODULE, PXX2_TOOLS_PERIOD);
|
||||||
}
|
}
|
||||||
#if !defined(INTMODULE_HEARTBEAT)
|
|
||||||
else {
|
else {
|
||||||
|
#if defined(INTMODULE_HEARTBEAT)
|
||||||
|
scheduleNextMixerCalculation(INTERNAL_MODULE, PXX2_PERIOD + 1 /* backup */);
|
||||||
|
#else
|
||||||
scheduleNextMixerCalculation(INTERNAL_MODULE, PXX2_PERIOD);
|
scheduleNextMixerCalculation(INTERNAL_MODULE, PXX2_PERIOD);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -375,7 +380,8 @@ bool setupPulsesInternalModule(uint8_t protocol)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return true;
|
scheduleNextMixerCalculation(INTERNAL_MODULE, 50/*ms*/);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,8 +416,7 @@ bool setupPulsesExternalModule()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setupPulsesExternalModule(protocol);
|
return setupPulsesExternalModule(protocol);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -69,17 +69,17 @@ void Pxx1Pulses<PxxTransport>::addExtraFlags(uint8_t module)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class PxxTransport>
|
template <class PxxTransport>
|
||||||
void Pxx1Pulses<PxxTransport>::addChannels(uint8_t port, uint8_t sendFailsafe, uint8_t sendUpperChannels)
|
void Pxx1Pulses<PxxTransport>::addChannels(uint8_t moduleIdx, uint8_t sendFailsafe, uint8_t sendUpperChannels)
|
||||||
{
|
{
|
||||||
uint16_t pulseValue = 0;
|
uint16_t pulseValue = 0;
|
||||||
uint16_t pulseValueLow = 0;
|
uint16_t pulseValueLow = 0;
|
||||||
|
|
||||||
for (int8_t i=0; i<8; i++) {
|
for (uint8_t i = 0; i < 8; i++) {
|
||||||
if (sendFailsafe) {
|
if (sendFailsafe) {
|
||||||
if (g_model.moduleData[port].failsafeMode == FAILSAFE_HOLD) {
|
if (g_model.moduleData[moduleIdx].failsafeMode == FAILSAFE_HOLD) {
|
||||||
pulseValue = (i < sendUpperChannels ? 4095 : 2047);
|
pulseValue = (i < sendUpperChannels ? 4095 : 2047);
|
||||||
}
|
}
|
||||||
else if (g_model.moduleData[port].failsafeMode == FAILSAFE_NOPULSES) {
|
else if (g_model.moduleData[moduleIdx].failsafeMode == FAILSAFE_NOPULSES) {
|
||||||
pulseValue = (i < sendUpperChannels ? 2048 : 0);
|
pulseValue = (i < sendUpperChannels ? 2048 : 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -92,7 +92,7 @@ void Pxx1Pulses<PxxTransport>::addChannels(uint8_t port, uint8_t sendFailsafe, u
|
|||||||
pulseValue = 2048;
|
pulseValue = 2048;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
failsafeValue += 2*PPM_CH_CENTER(8+g_model.moduleData[port].channelsStart+i) - 2*PPM_CENTER;
|
failsafeValue += 2*PPM_CH_CENTER(8+g_model.moduleData[moduleIdx].channelsStart+i) - 2*PPM_CENTER;
|
||||||
pulseValue = limit(2049, (failsafeValue * 512 / 682) + 3072, 4094);
|
pulseValue = limit(2049, (failsafeValue * 512 / 682) + 3072, 4094);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ void Pxx1Pulses<PxxTransport>::addChannels(uint8_t port, uint8_t sendFailsafe, u
|
|||||||
pulseValue = 0;
|
pulseValue = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
failsafeValue += 2*PPM_CH_CENTER(g_model.moduleData[port].channelsStart+i) - 2*PPM_CENTER;
|
failsafeValue += 2*PPM_CH_CENTER(g_model.moduleData[moduleIdx].channelsStart+i) - 2*PPM_CENTER;
|
||||||
pulseValue = limit(1, (failsafeValue * 512 / 682) + 1024, 2046);
|
pulseValue = limit(1, (failsafeValue * 512 / 682) + 1024, 2046);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -113,12 +113,12 @@ void Pxx1Pulses<PxxTransport>::addChannels(uint8_t port, uint8_t sendFailsafe, u
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (i < sendUpperChannels) {
|
if (i < sendUpperChannels) {
|
||||||
int channel = 8 + g_model.moduleData[port].channelsStart + i;
|
int channel = 8 + g_model.moduleData[moduleIdx].channelsStart + i;
|
||||||
int value = channelOutputs[channel] + 2*PPM_CH_CENTER(channel) - 2*PPM_CENTER;
|
int value = channelOutputs[channel] + 2*PPM_CH_CENTER(channel) - 2*PPM_CENTER;
|
||||||
pulseValue = limit(2049, (value * 512 / 682) + 3072, 4094);
|
pulseValue = limit(2049, (value * 512 / 682) + 3072, 4094);
|
||||||
}
|
}
|
||||||
else if (i < sentModuleChannels(port)) {
|
else if (i < sentModulePXXChannels(moduleIdx)) {
|
||||||
int channel = g_model.moduleData[port].channelsStart + i;
|
int channel = g_model.moduleData[moduleIdx].channelsStart + i;
|
||||||
int value = channelOutputs[channel] + 2*PPM_CH_CENTER(channel) - 2*PPM_CENTER;
|
int value = channelOutputs[channel] + 2*PPM_CH_CENTER(channel) - 2*PPM_CENTER;
|
||||||
pulseValue = limit(1, (value * 512 / 682) + 1024, 2046);
|
pulseValue = limit(1, (value * 512 / 682) + 1024, 2046);
|
||||||
}
|
}
|
||||||
@@ -186,7 +186,7 @@ void Pxx1Pulses<PxxTransport>::setupFrame(uint8_t module)
|
|||||||
moduleState[module].counter = 1000;
|
moduleState[module].counter = 1000;
|
||||||
}
|
}
|
||||||
add8ChannelsFrame(module, 0, sendFailsafe);
|
add8ChannelsFrame(module, 0, sendFailsafe);
|
||||||
if (sentModuleChannels(module) > 8) {
|
if (sentModulePXXChannels(module) > 8) {
|
||||||
add8ChannelsFrame(module, 8, sendFailsafe);
|
add8ChannelsFrame(module, 8, sendFailsafe);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -25,8 +25,12 @@
|
|||||||
#include "crc.h"
|
#include "crc.h"
|
||||||
|
|
||||||
struct HeartbeatCapture {
|
struct HeartbeatCapture {
|
||||||
|
#if !defined(INTMODULE_USART)
|
||||||
uint32_t timestamp;
|
uint32_t timestamp;
|
||||||
|
#endif
|
||||||
|
#if defined(DEBUG_LATENCY)
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
|
#endif
|
||||||
uint8_t valid;
|
uint8_t valid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ uint8_t storageDirtyMsk;
|
|||||||
tmr10ms_t storageDirtyTime10ms;
|
tmr10ms_t storageDirtyTime10ms;
|
||||||
|
|
||||||
#if defined(RTC_BACKUP_RAM)
|
#if defined(RTC_BACKUP_RAM)
|
||||||
uint8_t rambackupDirtyMsk;
|
uint8_t rambackupDirtyMsk = EE_GENERAL | EE_MODEL;
|
||||||
tmr10ms_t rambackupDirtyTime10ms;
|
tmr10ms_t rambackupDirtyTime10ms;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,9 @@
|
|||||||
|
|
||||||
#include "opentx.h"
|
#include "opentx.h"
|
||||||
|
|
||||||
|
#if defined(INTMODULE_HEARTBEAT_GPIO)
|
||||||
volatile HeartbeatCapture heartbeatCapture;
|
volatile HeartbeatCapture heartbeatCapture;
|
||||||
|
|
||||||
#if defined(INTMODULE_HEARTBEAT_GPIO)
|
|
||||||
void init_intmodule_heartbeat()
|
void init_intmodule_heartbeat()
|
||||||
{
|
{
|
||||||
GPIO_InitTypeDef GPIO_InitStructure;
|
GPIO_InitTypeDef GPIO_InitStructure;
|
||||||
@@ -69,11 +69,13 @@ void check_intmodule_heartbeat()
|
|||||||
{
|
{
|
||||||
if (EXTI_GetITStatus(INTMODULE_HEARTBEAT_EXTI_LINE) != RESET) {
|
if (EXTI_GetITStatus(INTMODULE_HEARTBEAT_EXTI_LINE) != RESET) {
|
||||||
#if defined(INTMODULE_USART)
|
#if defined(INTMODULE_USART)
|
||||||
heartbeatCapture.timestamp = RTOS_GET_MS();
|
nextMixerTime[INTERNAL_MODULE] = RTOS_GET_MS();
|
||||||
#else
|
#else
|
||||||
heartbeatCapture.timestamp = getTmr2MHz();
|
heartbeatCapture.timestamp = getTmr2MHz();
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(DEBUG_LATENCY)
|
||||||
heartbeatCapture.count++;
|
heartbeatCapture.count++;
|
||||||
|
#endif
|
||||||
EXTI_ClearITPendingBit(INTMODULE_HEARTBEAT_EXTI_LINE);
|
EXTI_ClearITPendingBit(INTMODULE_HEARTBEAT_EXTI_LINE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,11 +204,46 @@ set(STM32LIB_SRC
|
|||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma2d.c
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma2d.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
MACRO(GET_GCC_INCLUDE_PATH gcc_include_path)
|
||||||
|
if (WIN32)
|
||||||
|
execute_process(COMMAND arm-none-eabi-gcc -v -x c -E NUL ERROR_VARIABLE _gcc_output OUTPUT_QUIET)
|
||||||
|
else()
|
||||||
|
execute_process(COMMAND arm-none-eabi-gcc -v -x c -E - INPUT_FILE /dev/null ERROR_VARIABLE _gcc_output OUTPUT_QUIET)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Build an array of string from the GCC output
|
||||||
|
string(REPLACE "\n" ";" _gcc_output "${_gcc_output}")
|
||||||
|
|
||||||
|
set(_capture_include FALSE)
|
||||||
|
set(_include_path "")
|
||||||
|
|
||||||
|
# Go through the lines and capture between '"#include <...> search starts here:"' and 'End of search list.'
|
||||||
|
foreach(_line ${_gcc_output})
|
||||||
|
if(${_line} STREQUAL "End of search list.")
|
||||||
|
set(_capture_include FALSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(_capture_include)
|
||||||
|
# Remove the leading and trailing empty characters
|
||||||
|
string(REPLACE "\r" "" _line ${_line})
|
||||||
|
string(SUBSTRING "${_line}" 1 -1 _line)
|
||||||
|
set(_include_path "${_include_path}" "-I${_line}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${_line} STREQUAL "#include <...> search starts here:")
|
||||||
|
set(_capture_include TRUE)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(${gcc_include_path} ${_include_path})
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
if(PYTHONINTERP_FOUND)
|
if(PYTHONINTERP_FOUND)
|
||||||
|
GET_GCC_INCLUDE_PATH(arm_gcc_include_path)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${PROJECT_BINARY_DIR}/radio/src/datacopy.cpp
|
OUTPUT ${PROJECT_BINARY_DIR}/radio/src/datacopy.cpp
|
||||||
WORKING_DIRECTORY ${RADIO_DIRECTORY}/src
|
WORKING_DIRECTORY ${RADIO_DIRECTORY}/src
|
||||||
COMMAND ${PYTHON_EXECUTABLE} ${RADIO_DIRECTORY}/util/generate_datacopy.py datastructs.h -DPCBHORUS -DPCBX10 -DCPUARM -DCOLORLCD -DBACKUP -Itargets/horus > ${PROJECT_BINARY_DIR}/radio/src/datacopy.cpp
|
COMMAND ${PYTHON_EXECUTABLE} ${RADIO_DIRECTORY}/util/generate_datacopy.py datastructs.h -DPCBHORUS -DPCBX10 -DCPUARM -DSTM32F4 -DSTM32F429_439xx -DCOLORLCD -DBACKUP -DSIMU -I. -Itargets/horus -Itargets/common/arm/stm32 -I${THIRDPARTY_DIR} -I${THIRDPARTY_DIR}/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include ${arm_gcc_include_path} > ${PROJECT_BINARY_DIR}/radio/src/datacopy.cpp
|
||||||
DEPENDS ${RADIO_DIRECTORY}/src/datastructs.h ${RADIO_DIRECTORY}/util/generate_datacopy.py
|
DEPENDS ${RADIO_DIRECTORY}/src/datastructs.h ${RADIO_DIRECTORY}/util/generate_datacopy.py
|
||||||
)
|
)
|
||||||
add_custom_target(datacopy
|
add_custom_target(datacopy
|
||||||
|
|||||||
@@ -21,8 +21,8 @@
|
|||||||
#ifndef _BOARD_H_
|
#ifndef _BOARD_H_
|
||||||
#define _BOARD_H_
|
#define _BOARD_H_
|
||||||
|
|
||||||
#include "../definitions.h"
|
#include "definitions.h"
|
||||||
#include "../opentx_constants.h"
|
#include "opentx_constants.h"
|
||||||
#include "board_common.h"
|
#include "board_common.h"
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
#define _BOARD_H_
|
#define _BOARD_H_
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include "../definitions.h"
|
#include "definitions.h"
|
||||||
#include "../opentx_constants.h"
|
#include "opentx_constants.h"
|
||||||
#include "board_common.h"
|
#include "board_common.h"
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
|
||||||
|
|||||||
+13
-27
@@ -73,9 +73,9 @@ bool isForcePowerOffRequested()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isModuleSynchronous(uint8_t module)
|
bool isModuleSynchronous(uint8_t moduleIdx)
|
||||||
{
|
{
|
||||||
uint8_t protocol = moduleState[module].protocol;
|
uint8_t protocol = moduleState[moduleIdx].protocol;
|
||||||
if (protocol == PROTOCOL_CHANNELS_PXX2_HIGHSPEED || protocol == PROTOCOL_CHANNELS_PXX2_LOWSPEED || protocol == PROTOCOL_CHANNELS_CROSSFIRE || protocol == PROTOCOL_CHANNELS_NONE)
|
if (protocol == PROTOCOL_CHANNELS_PXX2_HIGHSPEED || protocol == PROTOCOL_CHANNELS_PXX2_LOWSPEED || protocol == PROTOCOL_CHANNELS_CROSSFIRE || protocol == PROTOCOL_CHANNELS_NONE)
|
||||||
return true;
|
return true;
|
||||||
#if defined(INTMODULE_USART) || defined(EXTMODULE_USART)
|
#if defined(INTMODULE_USART) || defined(EXTMODULE_USART)
|
||||||
@@ -85,16 +85,16 @@ bool isModuleSynchronous(uint8_t module)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendSynchronousPulses()
|
void sendSynchronousPulses(uint8_t runMask)
|
||||||
{
|
{
|
||||||
#if defined(HARDWARE_INTERNAL_MODULE)
|
#if defined(HARDWARE_INTERNAL_MODULE)
|
||||||
if (isModuleSynchronous(INTERNAL_MODULE)) {
|
if ((runMask & (1 << INTERNAL_MODULE)) && isModuleSynchronous(INTERNAL_MODULE)) {
|
||||||
if (setupPulsesInternalModule())
|
if (setupPulsesInternalModule())
|
||||||
intmoduleSendNextFrame();
|
intmoduleSendNextFrame();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (isModuleSynchronous(EXTERNAL_MODULE)) {
|
if ((runMask & (1 << EXTERNAL_MODULE)) && isModuleSynchronous(EXTERNAL_MODULE)) {
|
||||||
if (setupPulsesExternalModule())
|
if (setupPulsesExternalModule())
|
||||||
extmoduleSendNextFrame();
|
extmoduleSendNextFrame();
|
||||||
}
|
}
|
||||||
@@ -104,7 +104,6 @@ uint32_t nextMixerTime[NUM_MODULES];
|
|||||||
|
|
||||||
TASK_FUNCTION(mixerTask)
|
TASK_FUNCTION(mixerTask)
|
||||||
{
|
{
|
||||||
static uint32_t lastRunTime;
|
|
||||||
s_pulses_paused = true;
|
s_pulses_paused = true;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -134,35 +133,22 @@ TASK_FUNCTION(mixerTask)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint32_t now = RTOS_GET_MS();
|
uint32_t now = RTOS_GET_MS();
|
||||||
bool run = false;
|
uint8_t runMask = 0;
|
||||||
|
|
||||||
if (now - lastRunTime >= 10) {
|
if (now >= nextMixerTime[0]) {
|
||||||
// run at least every 10ms
|
runMask |= (1 << 0);
|
||||||
run = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(INTMODULE_USART) && defined(INTMODULE_HEARTBEAT)
|
|
||||||
if ((moduleState[INTERNAL_MODULE].protocol == PROTOCOL_CHANNELS_PXX2_HIGHSPEED || moduleState[INTERNAL_MODULE].protocol == PROTOCOL_CHANNELS_PXX1_SERIAL) && heartbeatCapture.valid && heartbeatCapture.timestamp > lastRunTime) {
|
|
||||||
run = true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (now == nextMixerTime[0]) {
|
|
||||||
run = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NUM_MODULES >= 2
|
#if NUM_MODULES >= 2
|
||||||
if (now == nextMixerTime[1]) {
|
if (now >= nextMixerTime[1]) {
|
||||||
run = true;
|
runMask |= (1 << 1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!run) {
|
if (!runMask) {
|
||||||
continue; // go back to sleep
|
continue; // go back to sleep
|
||||||
}
|
}
|
||||||
|
|
||||||
lastRunTime = now;
|
|
||||||
|
|
||||||
if (!s_pulses_paused) {
|
if (!s_pulses_paused) {
|
||||||
uint16_t t0 = getTmr2MHz();
|
uint16_t t0 = getTmr2MHz();
|
||||||
|
|
||||||
@@ -197,12 +183,12 @@ TASK_FUNCTION(mixerTask)
|
|||||||
if (t0 > maxMixerDuration)
|
if (t0 > maxMixerDuration)
|
||||||
maxMixerDuration = t0;
|
maxMixerDuration = t0;
|
||||||
|
|
||||||
sendSynchronousPulses();
|
sendSynchronousPulses(runMask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void scheduleNextMixerCalculation(uint8_t module, uint16_t period_ms)
|
void scheduleNextMixerCalculation(uint8_t module, uint32_t period_ms)
|
||||||
{
|
{
|
||||||
// Schedule next mixer calculation time,
|
// Schedule next mixer calculation time,
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
#ifndef _FRSKY_H_
|
#ifndef _FRSKY_H_
|
||||||
#define _FRSKY_H_
|
#define _FRSKY_H_
|
||||||
|
|
||||||
#include "../definitions.h"
|
#include "../../definitions.h"
|
||||||
#include "telemetry_holders.h"
|
#include "telemetry_holders.h"
|
||||||
#include "../io/frsky_pxx2.h"
|
#include "../../io/frsky_pxx2.h"
|
||||||
|
|
||||||
// Receive buffer state machine state enum
|
// Receive buffer state machine state enum
|
||||||
enum FrSkyDataState {
|
enum FrSkyDataState {
|
||||||
|
|||||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: a0f482b6d0...04e6ba5ae8
@@ -1,30 +1,33 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import clang.cindex
|
import clang.cindex
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
|
|
||||||
if sys.platform == "darwin":
|
|
||||||
if os.path.exists('/usr/local/Cellar/llvm/6.0.0/lib/libclang.dylib'):
|
|
||||||
clang.cindex.Config.set_library_file('/usr/local/Cellar/llvm/6.0.0/lib/libclang.dylib')
|
|
||||||
elif os.path.exists('/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib'):
|
|
||||||
clang.cindex.Config.set_library_file('/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib')
|
|
||||||
elif os.path.exists('/Library/Developer/CommandLineTools/usr/lib/libclang.dylib'):
|
|
||||||
clang.cindex.Config.set_library_file('/Library/Developer/CommandLineTools/usr/lib/libclang.dylib')
|
|
||||||
elif sys.platform.startswith("linux"):
|
|
||||||
for version in ("7", "6.0", "3.8"):
|
|
||||||
libclang = "/usr/lib/x86_64-linux-gnu/libclang-%s.so.1" % version
|
|
||||||
if os.path.exists(libclang):
|
|
||||||
clang.cindex.Config.set_library_file(libclang)
|
|
||||||
break
|
|
||||||
|
|
||||||
structs = []
|
structs = []
|
||||||
extrastructs = []
|
extrastructs = []
|
||||||
|
|
||||||
|
|
||||||
|
def find_libclang():
|
||||||
|
if sys.platform == "darwin":
|
||||||
|
for path in ("/usr/local/Cellar/llvm/6.0.0/lib/libclang.dylib",
|
||||||
|
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib",
|
||||||
|
"/Library/Developer/CommandLineTools/usr/lib/libclang.dylib"):
|
||||||
|
if os.path.exists(path):
|
||||||
|
return path
|
||||||
|
elif sys.platform.startswith("linux"):
|
||||||
|
for version in ("7", "6.0", "3.8"):
|
||||||
|
path = "/usr/lib/x86_64-linux-gnu/libclang-%s.so.1" % version
|
||||||
|
if os.path.exists(path):
|
||||||
|
return path
|
||||||
|
for path in ("/usr/local/lib/libclang.so",
|
||||||
|
"/usr/lib/libclang.so"):
|
||||||
|
if os.path.exists(path):
|
||||||
|
return path
|
||||||
|
|
||||||
|
|
||||||
def build_struct(cursor, anonymousUnion=False):
|
def build_struct(cursor, anonymousUnion=False):
|
||||||
if not anonymousUnion:
|
if not anonymousUnion:
|
||||||
structs.append(cursor.spelling)
|
structs.append(cursor.spelling)
|
||||||
@@ -98,7 +101,28 @@ def header():
|
|||||||
print("// This file was auto-generated by %s script on %s. Do not edit this file!\n\n\n" % (os.path.basename(sys.argv[0]), time.asctime()))
|
print("// This file was auto-generated by %s script on %s. Do not edit this file!\n\n\n" % (os.path.basename(sys.argv[0]), time.asctime()))
|
||||||
|
|
||||||
|
|
||||||
index = clang.cindex.Index.create()
|
def print_translation_unit_diags(diags, prefix=''):
|
||||||
translation_unit = index.parse(sys.argv[1], ['-x', 'c++', '-std=c++11'] + sys.argv[2:])
|
for diag in diags:
|
||||||
header()
|
print(prefix + str(diag), file=sys.stderr)
|
||||||
build(translation_unit.cursor)
|
print_translation_unit_diags(diag.children, ' ' + prefix)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
libclang = find_libclang()
|
||||||
|
if libclang:
|
||||||
|
# print(libclang, file=sys.stderr)
|
||||||
|
clang.cindex.Config.set_library_file(libclang)
|
||||||
|
|
||||||
|
index = clang.cindex.Index.create()
|
||||||
|
translation_unit = index.parse(sys.argv[1], ['-x', 'c++', '-std=c++11'] + sys.argv[2:])
|
||||||
|
|
||||||
|
if translation_unit.diagnostics:
|
||||||
|
print_translation_unit_diags(translation_unit.diagnostics)
|
||||||
|
sys.exit(-1)
|
||||||
|
|
||||||
|
header()
|
||||||
|
build(translation_unit.cursor)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user