Compilation fixes
This commit is contained in:
@@ -476,7 +476,7 @@ PACK(struct ModuleData {
|
||||
uint8_t spare2:1;
|
||||
int8_t refreshRate; // definition as framelength for ppm (* 5 + 225 = time in 1/10 ms)
|
||||
} sbus);
|
||||
NOBACKUP(struct {
|
||||
NOBACKUP(PACK(struct {
|
||||
uint8_t power:2; // 0=10 mW, 1=100 mW, 2=500 mW, 3=1W
|
||||
uint8_t external_antenna:1; // false = internal antenna, true = external antenna
|
||||
#if defined(PCBHORUS)
|
||||
@@ -497,7 +497,7 @@ PACK(struct ModuleData {
|
||||
NOBACKUP(inline void clearReceiverSlot(uint8_t receiver) {
|
||||
setReceiverSlot(receiver, 0);
|
||||
})
|
||||
} pxx2);
|
||||
}) pxx2);
|
||||
};
|
||||
|
||||
// Helper functions to set both of the rfProto protocol at the same time
|
||||
@@ -916,7 +916,12 @@ static inline void check_struct()
|
||||
|
||||
CHKSIZE(LogicalSwitchData, 9);
|
||||
CHKSIZE(TelemetrySensor, 13);
|
||||
CHKSIZE(ModuleData, 12);
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
CHKSIZE(ModuleData, 9);
|
||||
#else
|
||||
CHKSIZE(ModuleData, 6);
|
||||
#endif
|
||||
|
||||
CHKSIZE(GVarData, 7);
|
||||
|
||||
@@ -943,7 +948,7 @@ static inline void check_struct()
|
||||
CHKSIZE(ModelData, 5188);
|
||||
#elif defined(PCBHORUS)
|
||||
CHKSIZE(RadioData, 855);
|
||||
CHKSIZE(ModelData, 9777);
|
||||
CHKSIZE(ModelData, 9771);
|
||||
#endif
|
||||
|
||||
#undef CHKSIZE
|
||||
|
||||
@@ -73,7 +73,6 @@ inline MenuHandlerFunc lastPopMenu()
|
||||
}
|
||||
|
||||
void onMainViewMenu(const char * result);
|
||||
|
||||
void menuFirstCalib(event_t event);
|
||||
void menuMainView(event_t event);
|
||||
void menuViewTelemetryFrsky(event_t event);
|
||||
@@ -83,11 +82,9 @@ enum MenuRadioIndexes
|
||||
{
|
||||
MENU_RADIO_SETUP,
|
||||
CASE_SDCARD(MENU_RADIO_SD_MANAGER)
|
||||
MENU_RADIO_TOOLS,
|
||||
MENU_RADIO_SPECIAL_FUNCTIONS,
|
||||
MENU_RADIO_TRAINER,
|
||||
#if defined(RADIO_SPECTRUM)
|
||||
MENU_RADIO_SPECTRUM,
|
||||
#endif
|
||||
MENU_RADIO_HARDWARE,
|
||||
MENU_RADIO_VERSION,
|
||||
MENU_RADIO_PAGES_COUNT
|
||||
@@ -101,17 +98,16 @@ void menuRadioVersion(event_t event);
|
||||
void menuRadioDiagKeys(event_t event);
|
||||
void menuRadioDiagAnalogs(event_t event);
|
||||
void menuRadioHardware(event_t event);
|
||||
void menuRadioTools(event_t event);
|
||||
void menuRadioSpectrum(event_t event);
|
||||
void menuRadioCalibration(event_t event);
|
||||
|
||||
static const MenuHandlerFunc menuTabGeneral[] = {
|
||||
menuRadioSetup,
|
||||
CASE_SDCARD(menuRadioSdManager)
|
||||
menuRadioTools,
|
||||
menuRadioSpecialFunctions,
|
||||
menuRadioTrainer,
|
||||
#if defined(RADIO_SPECTRUM)
|
||||
menuRadioSpectrum,
|
||||
#endif
|
||||
menuRadioHardware,
|
||||
menuRadioVersion
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
void menuRadioSpectrum(event_t event)
|
||||
{
|
||||
SIMPLE_MENU("SPECTRUM ANALYSER", menuTabGeneral, MENU_RADIO_SPECTRUM, 1);
|
||||
SIMPLE_SUBMENU("SPECTRUM ANALYSER", 1);
|
||||
|
||||
if (menuEvent) {
|
||||
INTERNAL_MODULE_OFF();
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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"
|
||||
|
||||
void addRadioTool(uint8_t index, const char * label, void (* tool)(event_t event), event_t event)
|
||||
{
|
||||
int8_t sub = menuVerticalPosition - HEADER_LINE;
|
||||
LcdFlags attr = (sub == index ? INVERS : 0);
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + index * FH;
|
||||
lcdDrawNumber(3, y, index + 1, LEADING0|LEFT, 2);
|
||||
lcdDrawText(3*FW, y, label, (sub == index ? INVERS : 0));
|
||||
if (attr && s_editMode > 0) {
|
||||
s_editMode = 0;
|
||||
pushMenu(tool);
|
||||
}
|
||||
}
|
||||
|
||||
void menuRadioTools(event_t event)
|
||||
{
|
||||
SIMPLE_MENU("TOOLS", menuTabGeneral, MENU_RADIO_TOOLS, HEADER_LINE + 1);
|
||||
|
||||
addRadioTool(0, "Spectrum Analyser", menuRadioSpectrum, event);
|
||||
|
||||
}
|
||||
@@ -387,7 +387,7 @@ void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t l
|
||||
#if defined(BOOT)
|
||||
unsigned char c = *s;
|
||||
#else
|
||||
unsigned char c = (flags & ZCHAR) ? idx2char(*s) : *s;
|
||||
unsigned char c = (flags & ZCHAR) ? zchar2char(*s) : *s;
|
||||
#endif
|
||||
if (setpos) {
|
||||
pos = c;
|
||||
|
||||
@@ -130,7 +130,7 @@ int getTextWidth(const char * s, int len, LcdFlags flags)
|
||||
for (int i=0; len==0 || i<len; ++i) {
|
||||
|
||||
#if !defined(BOOT)
|
||||
char c = (flags & ZCHAR) ? idx2char(*s) : *s;
|
||||
char c = (flags & ZCHAR) ? zchar2char(*s) : *s;
|
||||
#else
|
||||
char c = *s;
|
||||
#endif
|
||||
|
||||
@@ -1215,11 +1215,11 @@ bool menuModelFailsafe(event_t event)
|
||||
|
||||
if (menuVerticalPosition < sentModuleChannels(g_moduleIdx)) {
|
||||
if (s_editMode) {
|
||||
g_model.moduleData[g_moduleIdx].failsafeChannels[menuVerticalPosition] = channelOutputs[menuVerticalPosition+channelStart];
|
||||
g_model.failsafeChannels[menuVerticalPosition] = channelOutputs[menuVerticalPosition+channelStart];
|
||||
s_editMode = 0;
|
||||
}
|
||||
else {
|
||||
int16_t & failsafe = g_model.moduleData[g_moduleIdx].failsafeChannels[menuVerticalPosition];
|
||||
int16_t & failsafe = g_model.failsafeChannels[menuVerticalPosition];
|
||||
if (failsafe < FAILSAFE_CHANNEL_HOLD)
|
||||
failsafe = FAILSAFE_CHANNEL_HOLD;
|
||||
else if (failsafe == FAILSAFE_CHANNEL_HOLD)
|
||||
@@ -1246,7 +1246,7 @@ bool menuModelFailsafe(event_t event)
|
||||
coord_t x = col*(LCD_W/2);
|
||||
const coord_t y = MENU_CONTENT_TOP - FH + line*(FH+2);
|
||||
const int32_t channelValue = channelOutputs[ch+channelStart];
|
||||
int32_t failsafeValue = g_model.moduleData[g_moduleIdx].failsafeChannels[8*col+line];
|
||||
int32_t failsafeValue = g_model.failsafeChannels[8*col+line];
|
||||
|
||||
// Channel name if present, number if not
|
||||
if (g_model.limitData[ch+channelStart].name[0] != '\0') {
|
||||
@@ -1267,7 +1267,7 @@ bool menuModelFailsafe(event_t event)
|
||||
}
|
||||
else {
|
||||
flags |= BLINK;
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[g_moduleIdx].failsafeChannels[8*col+line], -lim, +lim);
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.failsafeChannels[8*col+line], -lim, +lim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <io/frsky_device_firmware_update.h>
|
||||
#include "opentx.h"
|
||||
#include "storage/modelslist.h"
|
||||
|
||||
@@ -141,15 +142,18 @@ void onSdManagerMenu(const char * result)
|
||||
}
|
||||
else if (result == STR_FLASH_INTERNAL_MODULE) {
|
||||
getSelectionFullPath(lfn);
|
||||
sportFlashDevice(INTERNAL_MODULE, lfn);
|
||||
DeviceFirmwareUpdate device(INTERNAL_MODULE);
|
||||
device.flashFile(lfn);
|
||||
}
|
||||
else if (result == STR_FLASH_EXTERNAL_MODULE) {
|
||||
getSelectionFullPath(lfn);
|
||||
sportFlashDevice(EXTERNAL_MODULE, lfn);
|
||||
DeviceFirmwareUpdate device(EXTERNAL_MODULE);
|
||||
device.flashFile(lfn);
|
||||
}
|
||||
else if (result == STR_FLASH_EXTERNAL_DEVICE) {
|
||||
getSelectionFullPath(lfn);
|
||||
sportFlashDevice(FLASHING_MODULE, lfn);
|
||||
DeviceFirmwareUpdate device(FLASHING_MODULE);
|
||||
device.flashFile(lfn);
|
||||
}
|
||||
#if defined(LUA)
|
||||
else if (result == STR_EXECUTE_FILE) {
|
||||
|
||||
@@ -37,7 +37,6 @@ PACK(union SportTelemetryPacket
|
||||
|
||||
bool isSportOutputBufferAvailable();
|
||||
void sportOutputPushPacket(SportTelemetryPacket * packet);
|
||||
void sportFlashDevice(ModuleIndex module, const char * filename);
|
||||
#endif
|
||||
|
||||
#if defined(STM32)
|
||||
|
||||
@@ -2,10 +2,14 @@ if(PCB STREQUAL X9D OR PCB STREQUAL X9DP OR PCB STREQUAL SKY9X)
|
||||
set(EEPROM_CONVERSIONS 216)
|
||||
endif()
|
||||
|
||||
if(PCB STREQUAL X12S OR PCB STREQUAL X10 OR PCB STREQUAL X7 OR PCB STREQUAL XLITE)
|
||||
if(PCB STREQUAL X7 OR PCB STREQUAL XLITE)
|
||||
set(EEPROM_CONVERSIONS 218)
|
||||
endif()
|
||||
|
||||
if(PCB STREQUAL X12S OR PCB STREQUAL X10)
|
||||
# TODO set(EEPROM_CONVERSIONS 218)
|
||||
endif()
|
||||
|
||||
if(EEPROM_CONVERSIONS)
|
||||
add_definitions(-DEEPROM_CONVERSIONS=${EEPROM_CONVERSIONS})
|
||||
set(SRC
|
||||
|
||||
@@ -139,6 +139,16 @@ void delay_ms(uint32_t ms);
|
||||
#define IS_FIRMWARE_COMPATIBLE_WITH_BOARD() (!IS_HORUS_PROD())
|
||||
#endif
|
||||
|
||||
// Hardware options
|
||||
PACK(typedef struct {
|
||||
#if NUM_PWMSTICKS > 0
|
||||
uint8_t sticksPwmDisabled:1;
|
||||
#endif
|
||||
uint8_t pxx2Enabled:1;
|
||||
}) HardwareOptions;
|
||||
|
||||
extern HardwareOptions hardwareOptions;
|
||||
|
||||
// SD driver
|
||||
#define BLOCK_SIZE 512 /* Block Size in Bytes */
|
||||
#if !defined(SIMU) || defined(SIMU_DISKIO)
|
||||
@@ -196,15 +206,6 @@ void SDRAM_Init(void);
|
||||
#define IS_INTERNAL_MODULE_ON() (GPIO_ReadInputDataBit(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN) == Bit_SET)
|
||||
#define IS_EXTERNAL_MODULE_ON() (GPIO_ReadInputDataBit(EXTMODULE_PWR_GPIO, EXTMODULE_PWR_GPIO_PIN) == Bit_SET)
|
||||
|
||||
PACK(typedef struct {
|
||||
#if NUM_PWMSTICKS > 0
|
||||
uint8_t sticksPwmDisabled:1;
|
||||
#endif
|
||||
uint8_t pxx2Enabled:1;
|
||||
}) HardwareOptions;
|
||||
|
||||
extern HardwareOptions hardwareOptions;
|
||||
|
||||
#if !defined(PXX2)
|
||||
#define IS_PXX2_INTERNAL_ENABLED() (false)
|
||||
#define IS_PXX1_INTERNAL_ENABLED() (true)
|
||||
@@ -218,7 +219,6 @@ extern HardwareOptions hardwareOptions;
|
||||
#define IS_PXX1_INTERNAL_ENABLED() (true)
|
||||
#endif
|
||||
|
||||
|
||||
void init_ppm(uint8_t module);
|
||||
void disable_ppm(uint8_t module);
|
||||
void init_pxx1_pulses(uint8_t module);
|
||||
@@ -228,6 +228,8 @@ void disable_pxx2(uint8_t module);
|
||||
void init_serial(uint8_t module, uint32_t baudrate, uint32_t period_half_us);
|
||||
void intmoduleSerialStart(uint32_t baudrate, uint8_t rxEnable);
|
||||
void disable_serial(uint8_t module);
|
||||
void intmoduleStop();
|
||||
void intmoduleSendBuffer(const uint8_t * data, uint8_t size);
|
||||
void intmoduleSendNextFrame();
|
||||
void extmoduleSendNextFrame();
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ set(GUI_SRC
|
||||
radio_diagkeys.cpp
|
||||
radio_diaganas.cpp
|
||||
radio_hardware.cpp
|
||||
|
||||
radio_tools.cpp
|
||||
view_channels.cpp
|
||||
view_telemetry.cpp
|
||||
view_about.cpp
|
||||
|
||||
Reference in New Issue
Block a user