Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f2ff5bccd3 | |||
| e064edc69b | |||
| 4d03134e9e | |||
| 541c5aa000 | |||
| ad82ce9c1b | |||
| 7c4bb27ebd | |||
| e484668033 | |||
| 5f9a24cddd | |||
| 5154ba238a | |||
| c4a8e121d3 | |||
| 6c068076e4 | |||
| 8b5165c271 | |||
| 61f430cb43 | |||
| 144f47b6cf | |||
| a493e022a7 | |||
| 517c5521be | |||
| aedb5211ab | |||
| 8833a3e451 | |||
| 79c0754af9 | |||
| 49cb4f97d6 | |||
| a5bf114f2b | |||
| 022caee996 |
+14
-9
@@ -130,9 +130,6 @@ GRAPHICS = YES
|
||||
BOLD = YES
|
||||
BATTGRAPH = NO
|
||||
|
||||
# THR trace (in STATS screen)
|
||||
THR_TRACE = YES
|
||||
|
||||
# PPM center adjustable
|
||||
# Values = YES, NO
|
||||
PPM_CENTER_ADJUSTABLE = NO
|
||||
@@ -239,6 +236,12 @@ ifneq ($(PCB), $(filter $(PCB), STD 9X 9XR STD128 9X128 9XR128 GRUVIN9X MEGA2560
|
||||
$(error Sorry, the PCB $(PCB) is not supported yet in openTx)
|
||||
endif
|
||||
|
||||
GVARS_VARIANT = +1
|
||||
FRSKY_VARIANT = +2
|
||||
3POS_VARIANT = +4
|
||||
M128_VARIANT = +32768
|
||||
EEPROM_VARIANT = 0
|
||||
|
||||
ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR))
|
||||
# 9x/9xr radio
|
||||
ARCH = AVR
|
||||
@@ -247,6 +250,7 @@ ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR))
|
||||
OPT = s
|
||||
XCURVES = NO
|
||||
SDCARD = NO
|
||||
THR_TRACE = NO
|
||||
EXTRAINCDIRS = stock
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBSTD -DCPUM64 -DEEPROM_VARIANT=$(shell echo ${EEPROM_VARIANT} | bc)
|
||||
BOARDSRC = stock/board_stock.cpp
|
||||
@@ -298,7 +302,9 @@ ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128))
|
||||
MCU = atmega128
|
||||
OPT = 2
|
||||
SDCARD = NO
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBSTD -DCPUM128 -DEEPROM_VARIANT=0x8000
|
||||
THR_TRACE = NO
|
||||
EEPROM_VARIANT += ${M128_VARIANT}
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBSTD -DCPUM128 -DEEPROM_VARIANT=$(shell echo ${EEPROM_VARIANT} | bc)
|
||||
EXTRAINCDIRS = stock
|
||||
BOARDSRC = stock/board_stock.cpp
|
||||
EXTRABOARDSRC = stock/lcd_driver.cpp
|
||||
@@ -356,6 +362,7 @@ ifeq ($(PCB), GRUVIN9X)
|
||||
CPPDEFS += -DF_CPU=$(F_CPU)UL -DPCBGRUVIN9X -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC
|
||||
SDCARD = NO
|
||||
BEEPER = NO
|
||||
THR_TRACE = YES
|
||||
EXTRAINCDIRS = gruvin9x stock FatFs FatFs/option
|
||||
BOARDSRC = gruvin9x/board_gruvin9x.cpp
|
||||
EXTRABOARDSRC = stock/lcd_driver.cpp
|
||||
@@ -393,6 +400,7 @@ ifeq ($(PCB), MEGA2560)
|
||||
OPT = 2
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBGRUVIN9X -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC
|
||||
SDCARD = NO
|
||||
THR_TRACE = YES
|
||||
EXTRAINCDIRS = gruvin9x stock FatFs FatFs/option
|
||||
BOARDSRC = mega2560/board_mega2560.cpp
|
||||
EXTRABOARDSRC = mega2560/lcd_driver_ST7565R.cpp
|
||||
@@ -436,6 +444,7 @@ ifeq ($(PCB), SKY9X)
|
||||
OPT = 2
|
||||
SDCARD = YES
|
||||
BEEPER = NO
|
||||
THR_TRACE = YES
|
||||
CPPDEFS += -DPCBSKY9X -DCPUARM -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1
|
||||
EXTRAINCDIRS = sky9x CoOS/kernel CoOS/portable
|
||||
BOARDSRC = sky9x/board_sky9x.cpp
|
||||
@@ -493,6 +502,7 @@ ifeq ($(PCB), TARANIS)
|
||||
OPT = 2
|
||||
CPPDEFS += -DHSE_VALUE=12000000
|
||||
SDCARD = YES
|
||||
THR_TRACE = YES
|
||||
EXT = FRSKY
|
||||
CPPDEFS += -DPCBTARANIS -DCPUARM -DEEPROM_VARIANT=0 -DAUDIO -DPXX
|
||||
EXTRAINCDIRS = taranis CoOS/kernel CoOS/portable
|
||||
@@ -592,11 +602,6 @@ CPPDEFS += -DTRANSLATIONS_$(TRANSLATIONS)
|
||||
# TTS language
|
||||
CPPDEFS += -DTTS_$(TTS)
|
||||
|
||||
GVARS_VARIANT = +1
|
||||
FRSKY_VARIANT = +2
|
||||
3POS_VARIANT = +4
|
||||
EEPROM_VARIANT = 0
|
||||
|
||||
ifeq ($(UNITS), IMPERIAL)
|
||||
CPPDEFS += -DIMPERIAL_UNITS
|
||||
endif
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ void beep(uint8_t val);
|
||||
#endif
|
||||
|
||||
#if !defined(CPUARM)
|
||||
inline void BEEPER_HEARTBEAT()
|
||||
inline void BUZZER_HEARTBEAT()
|
||||
{
|
||||
if(g_beepCnt) {
|
||||
if(!beepAgainOrig) {
|
||||
|
||||
+1
-1
@@ -813,7 +813,7 @@ bool eeLoadGeneral()
|
||||
if (theFile.readRlc((uint8_t*)&g_eeGeneral, 1) == 1 && g_eeGeneral.version == EEPROM_VER) {
|
||||
theFile.openRlc(FILE_GENERAL);
|
||||
if (theFile.readRlc((uint8_t*)&g_eeGeneral, sizeof(g_eeGeneral)) <= sizeof(EEGeneral)) {
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
if (g_eeGeneral.variant == EEPROM_VARIANT && g_eeGeneral.chkSum == evalChkSum()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
+4
-3
@@ -730,11 +730,12 @@ void putsTime(xcoord_t x, uint8_t y, putstime_t tme, LcdFlags att, LcdFlags att2
|
||||
|
||||
qr = div(tme, 60);
|
||||
|
||||
#if defined(CPUARM)
|
||||
#if defined(PCBTARANIS)
|
||||
if (att & MIDSIZE) {
|
||||
div_t qr2 = div(qr.quot, 60);
|
||||
LCD_2DOTS(x+2*8-6, y, att);
|
||||
lcd_outdezNAtt(x, y, qr2.quot, att|LEADING0|LEFT, 2);
|
||||
qr.quot = qr2.rem;
|
||||
x += 2*8+1;
|
||||
}
|
||||
#define separator ':'
|
||||
@@ -812,7 +813,7 @@ void putsMixerSource(xcoord_t x, uint8_t y, uint8_t idx, LcdFlags att)
|
||||
putsStrIdx(x, y, STR_PPM, idx-MIXSRC_PPM1+1, att);
|
||||
else if (idx <= MIXSRC_LAST_CH)
|
||||
putsStrIdx(x, y, STR_CH, idx-MIXSRC_CH1+1, att);
|
||||
#if defined(GVARS) || !defined(CPUM64)
|
||||
#if defined(GVARS) || !defined(PCBSTD)
|
||||
else if (idx <= MIXSRC_LAST_GVAR)
|
||||
putsStrIdx(x, y, STR_GV, idx-MIXSRC_GVAR1+1, att);
|
||||
#endif
|
||||
@@ -859,7 +860,7 @@ void putsSwitches(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(CPUM64)
|
||||
#if !defined(PCBSTD)
|
||||
else if (idx >= SWSRC_TRAINER_SHORT) {
|
||||
idx -= SWSRC_TRAINER_SHORT;
|
||||
lcd_putcAtt(x+3*FW, y, (idx & 1) ? CHR_LONG : CHR_SHORT, att);
|
||||
|
||||
+10
-11
@@ -599,10 +599,10 @@ void menuModelSelect(uint8_t event)
|
||||
putsModelName(4*FW, y, name, k, 0);
|
||||
lcd_outdezAtt(20*FW, y, eeModelSize(k), 0);
|
||||
#endif
|
||||
if (k==g_eeGeneral.currModel && (s_copyMode!=COPY_MODE || s_copySrcRow<0 || i+s_pgOfs!=(pgofs_t)sub)) lcd_putc(1, y, '*');
|
||||
if (k==g_eeGeneral.currModel && (s_copyMode!=COPY_MODE || s_copySrcRow<0 || i+s_pgOfs!=(vertpos_t)sub)) lcd_putc(1, y, '*');
|
||||
}
|
||||
|
||||
if (s_copyMode && (pgofs_t)sub==i+s_pgOfs) {
|
||||
if (s_copyMode && (vertpos_t)sub==i+s_pgOfs) {
|
||||
lcd_filled_rect(9, y, LCD_W-1-9, 7);
|
||||
lcd_rect(8, y-1, LCD_W-1-7, 9, s_copyMode == COPY_MODE ? SOLID : DOTTED);
|
||||
}
|
||||
@@ -1447,7 +1447,7 @@ enum menuModelPhaseItems {
|
||||
IF_ROTARY_ENCODERS(ITEM_MODEL_PHASE_ROTARY_ENCODERS)
|
||||
ITEM_MODEL_PHASE_FADE_IN,
|
||||
ITEM_MODEL_PHASE_FADE_OUT,
|
||||
#if defined(GVARS) && !defined(CPUM64)
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
ITEM_MODEL_PHASE_GVARS_LABEL,
|
||||
ITEM_MODEL_PHASE_GV1,
|
||||
ITEM_MODEL_PHASE_GV2,
|
||||
@@ -1463,7 +1463,7 @@ void menuModelPhaseOne(uint8_t event)
|
||||
PhaseData *phase = phaseaddress(s_currIdx);
|
||||
putsFlightPhase(13*FW, 0, s_currIdx+1, (getFlightPhase()==s_currIdx ? BOLD : 0));
|
||||
|
||||
#if defined(GVARS) && !defined(CPUM64)
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
static const pm_uint8_t mstate_tab_phase1[] PROGMEM = {0, 0, 0, (uint8_t)-1, 2, 2, 2, 2, 2};
|
||||
static const pm_uint8_t mstate_tab_others[] PROGMEM = {0, 0, 3, IF_ROTARY_ENCODERS(NUM_ROTARY_ENCODERS-1) 0, 0, (uint8_t)-1, 2, 2, 2, 2, 2};
|
||||
|
||||
@@ -1480,7 +1480,7 @@ void menuModelPhaseOne(uint8_t event)
|
||||
int8_t sub = m_posVert;
|
||||
int8_t editMode = s_editMode;
|
||||
|
||||
#if defined(GVARS) && !defined(CPUM64)
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
if (s_currIdx == 0 && sub>=ITEM_MODEL_PHASE_SWITCH) sub += ITEM_MODEL_PHASE_FADE_IN-ITEM_MODEL_PHASE_SWITCH;
|
||||
|
||||
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
||||
@@ -1557,7 +1557,7 @@ void menuModelPhaseOne(uint8_t event)
|
||||
phase->fadeOut = EDIT_DELAY(0, y, event, attr, STR_FADEOUT, phase->fadeOut);
|
||||
break;
|
||||
|
||||
#if defined(GVARS) && !defined(CPUM64)
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
case ITEM_MODEL_PHASE_GVARS_LABEL:
|
||||
lcd_putsLeft(y, STR_GLOBAL_VARS);
|
||||
break;
|
||||
@@ -1717,8 +1717,7 @@ void menuModelHeli(uint8_t event)
|
||||
|
||||
for (uint8_t i=0; i<6; i++) {
|
||||
uint8_t y = 1 + 1*FH + i*FH;
|
||||
uint8_t attr = (sub == i ? INVERS : 0);
|
||||
|
||||
uint8_t attr = (sub == i ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||
switch(i) {
|
||||
case ITEM_HELI_SWASHTYPE:
|
||||
g_model.swashR.type = selectMenuItem(HELI_PARAM_OFS, y, STR_SWASHTYPE, STR_VSWASHTYPE, g_model.swashR.type, 0, SWASH_TYPE_NUM, attr, event);
|
||||
@@ -2277,7 +2276,7 @@ void menuModelMixOne(uint8_t event)
|
||||
|
||||
TITLE(s_currCh ? STR_INSERTMIX : STR_EDITMIX);
|
||||
MixData *md2 = mixaddress(s_currIdx) ;
|
||||
putsChn(lcdLastPos+1*FW,0,md2->destCh+1,0);
|
||||
putsChn(lcdLastPos+1*FW, 0, md2->destCh+1,0);
|
||||
|
||||
#if defined(ROTARY_ENCODERS)
|
||||
#if defined(CURVES)
|
||||
@@ -3051,7 +3050,7 @@ void menuModelLimits(uint8_t event)
|
||||
|
||||
void menuModelCurvesAll(uint8_t event)
|
||||
{
|
||||
#if defined(GVARS) && defined(CPUM64)
|
||||
#if defined(GVARS) && defined(PCBSTD)
|
||||
SIMPLE_MENU(STR_MENUCURVES, menuTabModel, e_CurvesAll, 1+MAX_CURVES+MAX_GVARS);
|
||||
#else
|
||||
SIMPLE_MENU(STR_MENUCURVES, menuTabModel, e_CurvesAll, 1+MAX_CURVES);
|
||||
@@ -3078,7 +3077,7 @@ void menuModelCurvesAll(uint8_t event)
|
||||
uint8_t y = 1 + FH + i*FH;
|
||||
uint8_t k = i + s_pgOfs;
|
||||
uint8_t attr = (sub == k ? INVERS : 0);
|
||||
#if defined(GVARS) && defined(CPUM64)
|
||||
#if defined(GVARS) && defined(PCBSTD)
|
||||
if (k < MAX_CURVES) {
|
||||
putsStrIdx(0, y, STR_CV, k+1, attr);
|
||||
}
|
||||
|
||||
+3
-3
@@ -36,7 +36,7 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
pgofs_t s_pgOfs;
|
||||
vertpos_t s_pgOfs;
|
||||
int8_t s_editMode;
|
||||
uint8_t s_noHi;
|
||||
uint8_t s_noScroll;
|
||||
@@ -675,8 +675,8 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
||||
|
||||
uint8_t max = menuTab ? LCD_LINES-1 : LCD_LINES-2;
|
||||
if (l_posVert<1) s_pgOfs=0;
|
||||
else if (l_posVert-s_pgOfs>max) s_pgOfs = l_posVert-max;
|
||||
else if (l_posVert-s_pgOfs<1) s_pgOfs = l_posVert-1;
|
||||
else if (l_posVert>max+s_pgOfs) s_pgOfs = l_posVert-max;
|
||||
else if (l_posVert<1+s_pgOfs) s_pgOfs = l_posVert-1;
|
||||
m_posVert = l_posVert;
|
||||
m_posHorz = l_posHorz;
|
||||
#if !defined(CPUM64)
|
||||
|
||||
+14
-21
@@ -73,13 +73,24 @@ inline void displayColumnHeader(const char **headers, uint8_t index)
|
||||
#define lcd_putsColumnLeft(x, y, str) lcd_putsLeft(y, str)
|
||||
#endif
|
||||
|
||||
// Menus related stuff ...
|
||||
#if defined(SDCARD)
|
||||
typedef uint16_t pgofs_t;
|
||||
typedef uint16_t vertpos_t;
|
||||
#else
|
||||
typedef uint8_t pgofs_t;
|
||||
typedef uint8_t vertpos_t;
|
||||
#endif
|
||||
|
||||
extern pgofs_t s_pgOfs;
|
||||
#if defined(PCBTARANIS)
|
||||
typedef uint8_t & check_event_t;
|
||||
#define horzpos_t int8_t
|
||||
#else
|
||||
typedef uint8_t check_event_t;
|
||||
#define horzpos_t uint8_t
|
||||
#endif
|
||||
|
||||
extern vertpos_t m_posVert;
|
||||
extern horzpos_t m_posHorz;
|
||||
extern vertpos_t s_pgOfs;
|
||||
extern uint8_t s_noHi;
|
||||
extern uint8_t s_noScroll;
|
||||
|
||||
@@ -173,24 +184,6 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
|
||||
#define CHECK_INCDEC_GENVAR(event, var, min, max) \
|
||||
var = checkIncDecGen(event,var,min,max)
|
||||
|
||||
// Menus related stuff ...
|
||||
#if defined(SDCARD)
|
||||
#define vertpos_t uint16_t
|
||||
#else
|
||||
#define vertpos_t uint8_t
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
typedef uint8_t & check_event_t;
|
||||
#define horzpos_t int8_t
|
||||
#else
|
||||
typedef uint8_t check_event_t;
|
||||
#define horzpos_t uint8_t
|
||||
#endif
|
||||
|
||||
extern vertpos_t m_posVert;
|
||||
extern horzpos_t m_posHorz;
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define NAVIGATION_LINE_BY_LINE 0x40
|
||||
#else
|
||||
|
||||
+26
-17
@@ -52,35 +52,36 @@
|
||||
#define BEEP_VAL ( (g_eeGeneral.warnOpts & WARN_BVAL_BIT) >>3 )
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define EEPROM_VER 214
|
||||
#define EEPROM_VER 214
|
||||
#elif defined(PCBSKY9X)
|
||||
#define EEPROM_VER 214
|
||||
#elif defined(PCBGRUVIN9X) || defined(CPUM128)
|
||||
#define EEPROM_VER 214
|
||||
#define EEPROM_VER 214
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#define EEPROM_VER 214
|
||||
#elif defined(CPUM128)
|
||||
#define EEPROM_VER 215
|
||||
#else
|
||||
#define EEPROM_VER 213
|
||||
#define EEPROM_VER 213
|
||||
#endif
|
||||
|
||||
#ifndef PACK
|
||||
#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
|
||||
#endif
|
||||
|
||||
|
||||
typedef int16_t gvar_t;
|
||||
|
||||
#if !defined(CPUM64)
|
||||
#if !defined(PCBSTD)
|
||||
typedef char gvar_name_t[6];
|
||||
#define GVAR_MAX 1024
|
||||
#endif
|
||||
|
||||
#define RESERVE_RANGE_FOR_GVARS 10
|
||||
// even we do not spend space in EEPROM for 10 GVARS, we reserve the space inside the range of values, like offset, weight, etc.
|
||||
#if defined(CPUM64) && defined(GVARS)
|
||||
#if defined(PCBSTD) && defined(GVARS)
|
||||
#define MAX_GVARS 5
|
||||
#define MODEL_GVARS_DATA gvar_t gvars[MAX_GVARS];
|
||||
#define PHASE_GVARS_DATA
|
||||
#define GVAR_VALUE(x, p) g_model.gvars[x]
|
||||
#elif defined(CPUM64)
|
||||
#elif defined(PCBSTD)
|
||||
#define MAX_GVARS 0
|
||||
#define MODEL_GVARS_DATA
|
||||
#define PHASE_GVARS_DATA
|
||||
@@ -252,7 +253,7 @@ PACK(typedef struct t_ExpoData {
|
||||
char name[LEN_EXPOMIX_NAME];
|
||||
int8_t curveParam;
|
||||
}) ExpoData;
|
||||
#elif defined(CPUM64)
|
||||
#elif defined(PCBSTD)
|
||||
PACK(typedef struct t_ExpoData {
|
||||
uint8_t mode:2; // 0=end, 1=pos, 2=neg, 3=both
|
||||
int8_t swtch:6;
|
||||
@@ -354,7 +355,7 @@ PACK( union u_int8int16_t {
|
||||
#define DELAY_MAX 15 /* 7.5 seconds */
|
||||
#define SLOW_MAX 15 /* 7.5 seconds */
|
||||
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
PACK(typedef struct t_MixData {
|
||||
uint8_t destCh:4; // 0, 1..NUM_CHNOUT
|
||||
uint8_t curveMode:1; // O=curve, 1=differential
|
||||
@@ -823,7 +824,7 @@ PACK(typedef struct t_SwashRingData { // Swash Ring data
|
||||
#define ROTARY_ENCODER_ARRAY_EXTRA
|
||||
#endif
|
||||
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
#define TRIM_ARRAY int8_t trim[4]; int8_t trim_ext:8
|
||||
#else
|
||||
#define TRIM_ARRAY int16_t trim[4]
|
||||
@@ -859,7 +860,7 @@ PACK(typedef struct t_PhaseData {
|
||||
#define MAX_EXPOS 32
|
||||
#define NUM_CSW 32 // number of custom switches
|
||||
#define NUM_CFN 32 // number of functions assigned to switches
|
||||
#elif defined(PCBGRUVIN9X) || defined(CPUM128)
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#define MAX_MODELS 30
|
||||
#define NUM_CHNOUT 16 // number of real output channels CH1-CH16
|
||||
#define MAX_PHASES 6
|
||||
@@ -867,6 +868,14 @@ PACK(typedef struct t_PhaseData {
|
||||
#define MAX_EXPOS 16
|
||||
#define NUM_CSW 15 // number of custom switches
|
||||
#define NUM_CFN 24 // number of functions assigned to switches
|
||||
#elif defined(CPUM128)
|
||||
#define MAX_MODELS 30
|
||||
#define NUM_CHNOUT 16 // number of real output channels CH1-CH16
|
||||
#define MAX_PHASES 5
|
||||
#define MAX_MIXERS 32
|
||||
#define MAX_EXPOS 14
|
||||
#define NUM_CSW 15 // number of custom switches
|
||||
#define NUM_CFN 24 // number of functions assigned to switches
|
||||
#else
|
||||
#define MAX_MODELS 16
|
||||
#define NUM_CHNOUT 16 // number of real output channels CH1-CH16
|
||||
@@ -952,7 +961,7 @@ enum SwitchSources {
|
||||
SWSRC_FIRST_MOMENT_SWITCH,
|
||||
SWSRC_LAST_MOMENT_SWITCH = SWSRC_FIRST_MOMENT_SWITCH+SWSRC_ON-1,
|
||||
|
||||
#if !defined(CPUM64)
|
||||
#if !defined(PCBSTD)
|
||||
SWSRC_TRAINER_SHORT,
|
||||
SWSRC_TRAINER_LONG,
|
||||
#endif
|
||||
@@ -1142,7 +1151,7 @@ enum FailsafeModes {
|
||||
|
||||
#if defined(MAVLINK)
|
||||
#define TELEMETRY_DATA MavlinkData mavlink;
|
||||
#elif defined(FRSKY) || !defined(CPUM64)
|
||||
#elif defined(FRSKY)
|
||||
#define TELEMETRY_DATA FrSkyData frsky;
|
||||
#else
|
||||
#define TELEMETRY_DATA
|
||||
@@ -1168,7 +1177,7 @@ PACK(typedef struct t_ModelData {
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare1:1;
|
||||
int8_t ppmDelay;
|
||||
BeepANACenter beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
BeepANACenter beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
MixData mixData[MAX_MIXERS];
|
||||
LimitData limitData[NUM_CHNOUT];
|
||||
ExpoData expoData[MAX_EXPOS];
|
||||
@@ -1177,7 +1186,7 @@ PACK(typedef struct t_ModelData {
|
||||
int8_t points[NUM_POINTS];
|
||||
|
||||
CustomSwData customSw[NUM_CSW];
|
||||
CustomFnData funcSw[NUM_CFN];
|
||||
CustomFnData funcSw[NUM_CFN];
|
||||
SwashRingData swashR;
|
||||
PhaseData phaseData[MAX_PHASES];
|
||||
|
||||
|
||||
+21
-28
@@ -670,14 +670,13 @@ void applyExpos(int16_t *anas)
|
||||
else
|
||||
v = expo(v, GET_GVAR(curveParam, -100, 100, s_perout_flight_phase));
|
||||
}
|
||||
int16_t weight=GET_GVAR(ed.weight, 0, 100, s_perout_flight_phase);
|
||||
weight=calc100to256(weight);
|
||||
int16_t weight = GET_GVAR(ed.weight, 0, 100, s_perout_flight_phase);
|
||||
weight = calc100to256(weight);
|
||||
v = ((int32_t)v * weight) >> 8;
|
||||
// v = ((int32_t)v * GET_GVAR(ed.weight, 0, 100, s_perout_flight_phase)) / 100;
|
||||
anas[cur_chn] = v;
|
||||
} //endif
|
||||
} //endif getSwitch
|
||||
} //endfor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
@@ -1228,7 +1227,7 @@ uint8_t getFlightPhase()
|
||||
int16_t getRawTrimValue(uint8_t phase, uint8_t idx)
|
||||
{
|
||||
PhaseData *p = phaseaddress(phase);
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
return (((int16_t)p->trim[idx]) << 2) + ((p->trim_ext >> (2*idx)) & 0x03);
|
||||
#else
|
||||
return p->trim[idx];
|
||||
@@ -1243,7 +1242,7 @@ int16_t getTrimValue(uint8_t phase, uint8_t idx)
|
||||
void setTrimValue(uint8_t phase, uint8_t idx, int16_t trim)
|
||||
{
|
||||
PhaseData *p = phaseaddress(phase);
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
p->trim[idx] = (int8_t)(trim >> 2);
|
||||
p->trim_ext = (p->trim_ext & ~(0x03 << (2*idx))) + (((trim & 0x03) << (2*idx)));
|
||||
#else
|
||||
@@ -1318,7 +1317,7 @@ void incRotaryEncoder(uint8_t idx, int8_t inc)
|
||||
uint8_t s_gvar_timer = 0;
|
||||
uint8_t s_gvar_last = 0;
|
||||
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
int16_t getGVarValue(int16_t x, int16_t min, int16_t max)
|
||||
{
|
||||
if (GV_IS_GV_VALUE(x,min,max)) {
|
||||
@@ -1736,7 +1735,7 @@ uint8_t checkTrim(uint8_t event)
|
||||
#if defined(GVARS)
|
||||
#define TRIM_REUSED() trimGvar[idx] >= 0
|
||||
if (TRIM_REUSED()) {
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
phase = 0;
|
||||
#else
|
||||
phase = getGVarFlightPhase(s_perout_flight_phase, trimGvar[idx]);
|
||||
@@ -2321,7 +2320,7 @@ PLAY_FUNCTION(playValue, uint8_t idx)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(CPUM64)
|
||||
#if !defined(PCBSTD)
|
||||
uint8_t mSwitchDuration[1+NUM_ROTARY_ENCODERS] = { 0 };
|
||||
#define CFN_PRESSLONG_DURATION 100
|
||||
#endif
|
||||
@@ -2367,7 +2366,7 @@ void evalFunctions()
|
||||
MASK_CFN_TYPE switch_mask = ((MASK_CFN_TYPE)1 << i);
|
||||
uint8_t momentary = 0;
|
||||
|
||||
#if !defined(CPUM64)
|
||||
#if !defined(PCBSTD)
|
||||
|
||||
#define MOMENTARY_START_TEST() ( (momentary && !(activeSwitches & switch_mask) && active) || \
|
||||
(short_long==1 && !active && mSwitchDuration[mswitch]>0 && mSwitchDuration[mswitch]<CFN_PRESSLONG_DURATION) || \
|
||||
@@ -2408,7 +2407,7 @@ void evalFunctions()
|
||||
if (active) newActiveSwitches |= switch_mask;
|
||||
if (momentary || short_long) {
|
||||
|
||||
#if !defined(CPUM64)
|
||||
#if !defined(PCBSTD)
|
||||
bool swState = active;
|
||||
#endif
|
||||
|
||||
@@ -2439,7 +2438,7 @@ void evalFunctions()
|
||||
active = (activeFnSwitches & switch_mask);
|
||||
momentary = false;
|
||||
}
|
||||
#if !defined(CPUM64)
|
||||
#if !defined(PCBSTD)
|
||||
if (short_long) {
|
||||
if (swState) {
|
||||
if (mSwitchDuration[mswitch] < 255)
|
||||
@@ -2459,13 +2458,6 @@ void evalFunctions()
|
||||
|
||||
if (active || momentary) {
|
||||
|
||||
if (active)
|
||||
TRACE_DEBUG("ACTIVE ");
|
||||
if (momentary)
|
||||
TRACE_DEBUG("MOMENTARY ");
|
||||
|
||||
TRACE_DEBUG("\n");
|
||||
|
||||
if (CFN_ACTIVE(sd)) {
|
||||
if (CFN_FUNC(sd) < FUNC_TRAINER) {
|
||||
safetyCh[CFN_CH_NUMBER(sd)] = CFN_PARAM(sd);
|
||||
@@ -2989,7 +2981,8 @@ void perOut(uint8_t mode, uint8_t tick10ms)
|
||||
|
||||
if (tmp.dword<0) {
|
||||
if ((tmp.words_t.hi&0xFF80)!=0xFF80) tmp.words_t.hi=0xFF86; // set to min nearly
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ((tmp.words_t.hi|0x007F)!=0x007F) tmp.words_t.hi=0x0079; // set to max nearly
|
||||
}
|
||||
*ptr=tmp.dword;
|
||||
@@ -3320,9 +3313,9 @@ void doMixerCalculations()
|
||||
AUDIO_INACTIVITY();
|
||||
|
||||
#if defined(AUDIO)
|
||||
if (mixWarning & 1) if ((s_timeCumTot&0x03)== 0) AUDIO_MIX_WARNING(1);
|
||||
if (mixWarning & 2) if ((s_timeCumTot&0x03)== 1) AUDIO_MIX_WARNING(2);
|
||||
if (mixWarning & 4) if ((s_timeCumTot&0x03)== 2) AUDIO_MIX_WARNING(3);
|
||||
if (mixWarning & 1) if ((s_timeCumTot&0x03)==0) AUDIO_MIX_WARNING(1);
|
||||
if (mixWarning & 2) if ((s_timeCumTot&0x03)==1) AUDIO_MIX_WARNING(2);
|
||||
if (mixWarning & 4) if ((s_timeCumTot&0x03)==2) AUDIO_MIX_WARNING(3);
|
||||
#endif
|
||||
|
||||
#if defined(ACCURAT_THROTTLE_TIMER)
|
||||
@@ -3640,7 +3633,7 @@ uint16_t getTmr16KHz()
|
||||
ISR(TIMER2_OVF_vect, ISR_NOBLOCK)
|
||||
{
|
||||
cli();
|
||||
TIMSK &= ~ (1<<TOIE2) ; // stop reentrance
|
||||
TIMSK &= ~(1<<TOIE2) ; // stop reentrance
|
||||
sei();
|
||||
|
||||
#if defined(AUDIO)
|
||||
@@ -3667,7 +3660,7 @@ ISR(TIMER_10MS_VECT, ISR_NOBLOCK)
|
||||
AUDIO_HEARTBEAT();
|
||||
#endif
|
||||
|
||||
#if defined(BUZZER)
|
||||
#if defined(BEEPER)
|
||||
BUZZER_HEARTBEAT();
|
||||
#endif
|
||||
|
||||
@@ -3796,7 +3789,7 @@ ISR(USART0_UDRE_vect)
|
||||
else {
|
||||
FRSKY_USART0_vect();
|
||||
}
|
||||
#elif defined (FRSKY)
|
||||
#elif defined(FRSKY)
|
||||
FRSKY_USART0_vect();
|
||||
#else
|
||||
DSM2_USART0_vect();
|
||||
|
||||
+1
-1
@@ -772,7 +772,7 @@ extern void setTrimValue(uint8_t phase, uint8_t idx, int16_t trim);
|
||||
#endif
|
||||
|
||||
#if defined(GVARS)
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
int16_t getGVarValue(int16_t x, int16_t min, int16_t max);
|
||||
void setGVarValue(uint8_t x, int8_t value);
|
||||
#define GET_GVAR(x, min, max, p) getGVarValue(x, min, max)
|
||||
|
||||
+2
-2
@@ -241,8 +241,8 @@ long Open9xSim::onTimeout(FXObject*,FXSelector,void*)
|
||||
KEY_Page_Down, KEY_PAGE,
|
||||
KEY_Return, KEY_ENTER,
|
||||
KEY_BackSpace, KEY_EXIT,
|
||||
KEY_Right, KEY_PLUS,
|
||||
KEY_Left, KEY_MINUS,
|
||||
KEY_Up, KEY_PLUS,
|
||||
KEY_Down, KEY_MINUS,
|
||||
#else
|
||||
KEY_Return, KEY_MENU,
|
||||
KEY_BackSpace, KEY_EXIT,
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
volatile uint16_t Analog_values[NUMBER_ANALOG];
|
||||
#if !defined(REV3)
|
||||
const char ana_direction[NUMBER_ANALOG] = {0,1,1,1, 1,0,1,0, 0};
|
||||
const char ana_direction[NUMBER_ANALOG] = {0,1,1,1, 1,1,1,0, 0};
|
||||
#endif
|
||||
|
||||
void adcInit()
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../opentx.h"
|
||||
#include "../FatFs/diskio.h"
|
||||
#include "board_taranis.h"
|
||||
|
||||
extern "C" {
|
||||
#include "STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/misc.h"
|
||||
@@ -404,7 +405,7 @@ const FATDirEntry_t g_DIRroot[16] =
|
||||
{
|
||||
{ 'T', 'A', 'R', 'A', 'N', 'I', 'S', ' '},
|
||||
{ 'B', 'I', 'N'},
|
||||
0x26, // Archive, hidden, system
|
||||
0x24, // Archive, hidden, system
|
||||
0x00,
|
||||
0x3E,
|
||||
0xA301,
|
||||
@@ -652,22 +653,27 @@ int32_t fat12Read( uint8_t *buffer, uint16_t sector, uint16_t count )
|
||||
eeprom_read_block (buffer, (sector-3)*512, 512);
|
||||
}
|
||||
buffer += 512 ;
|
||||
sector += 1 ;
|
||||
count -= 1 ;
|
||||
sector++ ;
|
||||
count-- ;
|
||||
}
|
||||
return 0 ;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int32_t fat12Write( const uint8_t *buffer, uint16_t sector, uint32_t count )
|
||||
int32_t fat12Write(const uint8_t *buffer, uint16_t sector, uint32_t count )
|
||||
{
|
||||
// TO DO, actually write to the EEPROM
|
||||
if ( sector > 2 )
|
||||
if ( sector >3 )
|
||||
{
|
||||
sector -= 2 ; // Indexes EEPROM in 512 byte blocks
|
||||
sector -= 4 ; // Indexes EEPROM in 512 byte blocks
|
||||
// Look for a 4K block boundary, writing 4K+
|
||||
|
||||
while (count) {
|
||||
eeWriteBlockCmp((uint8_t *)buffer, sector*512, 512);
|
||||
buffer+=512;
|
||||
sector++;
|
||||
count--;
|
||||
}
|
||||
}
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
@@ -474,8 +474,7 @@ ISR(USART0_RX_vect)
|
||||
uint8_t data;
|
||||
|
||||
UCSR0B &= ~(1 << RXCIE0); // disable Interrupt
|
||||
sei() ;
|
||||
|
||||
sei();
|
||||
|
||||
stat = UCSR0A; // USART control and Status Register 0 A
|
||||
|
||||
|
||||
+10
-10
@@ -127,7 +127,7 @@
|
||||
#define TR_VCURVEFUNC "---""x>0""x<0""|x|""f>0""f<0""|f|"
|
||||
|
||||
#define LEN_VMLTPX "\010"
|
||||
#define TR_VMLTPX "Add ""Multiply""Replace "
|
||||
#define TR_VMLTPX "Add\0 ""Multiply""Replace\0"
|
||||
|
||||
#define LEN_VMLTPX2 "\002"
|
||||
#define TR_VMLTPX2 "+=""*="":="
|
||||
@@ -273,7 +273,7 @@
|
||||
#define TR_VTEMPLATES "Clear Mixes\0\0""Simple 4-CH \0""Sticky-T-Cut\0""V-Tail \0""Elevon\\Delta\0""eCCPM \0""Heli Setup \0""Servo Test \0"
|
||||
|
||||
#define LEN_VSWASHTYPE "\004"
|
||||
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
|
||||
#define TR_VSWASHTYPE "---\0""120\0""120X""140\0""90\0"
|
||||
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS TR(" Menu"" Exit"" Down"" Up""Right"" Left", " Menu"" Exit""Enter"" Page"" Plus""Minus")
|
||||
@@ -354,7 +354,7 @@
|
||||
#define TR_LOADINGMODEL "Loading model..."
|
||||
#define TR_NAME "Name"
|
||||
#define TR_MODELNAME "Model Name"
|
||||
#define TR_PHASENAME "Phase Name"
|
||||
#define TR_PHASENAME "Mode Name"
|
||||
#define TR_MIXNAME "Mix Name"
|
||||
#define TR_EXPONAME "Expo Name"
|
||||
#define TR_BITMAP "Model Image"
|
||||
@@ -395,7 +395,7 @@
|
||||
#define TR_TRIM "Trim"
|
||||
#define TR_DREX "DRex"
|
||||
#define TR_CURVE "Curve"
|
||||
#define TR_FPHASE TR("Phase","Phases")
|
||||
#define TR_FPHASE TR("Mode","Modes")
|
||||
#define TR_MIXWARNING "Warning"
|
||||
#define TR_OFF "OFF"
|
||||
#define TR_MULTPX "Multpx"
|
||||
@@ -420,14 +420,14 @@
|
||||
#define TR_HAPTICSTRENGTH INDENT"Strength"
|
||||
#define TR_CONTRAST "Contrast"
|
||||
#define TR_ALARMS_LABEL "Alarms"
|
||||
#define TR_BATTERY_RANGE "Battery Range"
|
||||
#define TR_BATTERY_RANGE TR("Battery range","Battery meter range")
|
||||
#define TR_BATTERYWARNING INDENT"Battery Low"
|
||||
#define TR_INACTIVITYALARM INDENT"Inactivity"
|
||||
#define TR_MEMORYWARNING INDENT"Memory Low"
|
||||
#define TR_ALARMWARNING INDENT"Sound Off"
|
||||
#define TR_RENAVIG "RotEnc Navig"
|
||||
#define TR_THROTTLEREVERSE TR("Thr reverse","Throttle reverse")
|
||||
#define TR_MINUTEBEEP TR(INDENT"Minute",INDENT"Every minute")
|
||||
#define TR_MINUTEBEEP TR(INDENT"Minute",INDENT"Minute call")
|
||||
#define TR_BEEPCOUNTDOWN INDENT"Countdown"
|
||||
#define TR_PERSISTENT TR(INDENT"Persist.",INDENT"Persistent")
|
||||
#define TR_BACKLIGHT_LABEL "Backlight"
|
||||
@@ -473,7 +473,7 @@
|
||||
#define TR_PPM "PPM"
|
||||
#define TR_CH "CH"
|
||||
#define TR_MODEL "MODEL"
|
||||
#define TR_FP "FP"
|
||||
#define TR_FP "FM"
|
||||
#define TR_MIX "MIX"
|
||||
#define TR_EEPROMLOWMEM "EEPROM low mem"
|
||||
#define TR_ALERT "\016ALERT"
|
||||
@@ -494,13 +494,13 @@
|
||||
#define TR_TRIMS2OFFSETS "\006Trims => Offsets"
|
||||
#define TR_MENUMODELSEL TR("MODELSEL","MODEL SELECTION")
|
||||
#define TR_MENUSETUP TR("SETUP","MODEL SETUP")
|
||||
#define TR_MENUFLIGHTPHASE "FLIGHT PHASE"
|
||||
#define TR_MENUFLIGHTPHASES "FLIGHT PHASES"
|
||||
#define TR_MENUFLIGHTPHASE "FLIGHT MODE"
|
||||
#define TR_MENUFLIGHTPHASES "FLIGHT MODES"
|
||||
#define TR_MENUHELISETUP "HELI SETUP"
|
||||
|
||||
#if defined(PPM_CENTER_ADJUSTABLE) || defined(PPM_LIMITS_SYMETRICAL) // The right menu titles for the gurus ...
|
||||
#define TR_MENUDREXPO "STICKS"
|
||||
#define TR_MENULIMITS "OUTPUTS"
|
||||
#define TR_MENULIMITS "SERVOS"
|
||||
#else
|
||||
#define TR_MENUDREXPO "DR/EXPO"
|
||||
#define TR_MENULIMITS "LIMITS"
|
||||
|
||||
@@ -429,7 +429,7 @@
|
||||
#define TR_THROTTLEREVERSE "Reverserad Gas"
|
||||
#define TR_MINUTEBEEP INDENT"Varje Minut"
|
||||
#define TR_BEEPCOUNTDOWN INDENT"R\201kna Ned"
|
||||
#define TR_PERSISTENT TR("J\201mt p\200 ","INDENT"Alltid P\200")
|
||||
#define TR_PERSISTENT TR("J\201mt p\200 ",INDENT"Alltid P\200")
|
||||
#define TR_BACKLIGHT_LABEL "Belysning"
|
||||
#define TR_BLDELAY INDENT"Av efter"
|
||||
#define TR_BLONBRIGHTNESS INDENT"P\200 Ljusstyrka"
|
||||
|
||||
@@ -116,7 +116,16 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
number = -number;
|
||||
}
|
||||
|
||||
convertUnit(number, unit);
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
|
||||
@@ -106,7 +106,16 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
number = -number;
|
||||
}
|
||||
|
||||
convertUnit(number, unit);
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
|
||||
@@ -130,7 +130,16 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
number = -number;
|
||||
}
|
||||
|
||||
convertUnit(number, unit);
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
|
||||
@@ -112,7 +112,16 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
number = -number;
|
||||
}
|
||||
|
||||
convertUnit(number, unit);
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
|
||||
@@ -102,7 +102,16 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
number = -number;
|
||||
}
|
||||
|
||||
convertUnit(number, unit);
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
|
||||
@@ -115,7 +115,16 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
number = -number;
|
||||
}
|
||||
|
||||
convertUnit(number, unit);
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
|
||||
@@ -131,7 +131,16 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
number = -number;
|
||||
}
|
||||
|
||||
convertUnit(number, unit);
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
|
||||
+3
-3
@@ -765,7 +765,7 @@ void menuMainView(uint8_t event)
|
||||
}
|
||||
#endif // PCBGRUVIN9X && ROTARY_ENCODERS
|
||||
|
||||
// Curstom Switches
|
||||
// Custom Switches
|
||||
#if defined(PCBSKY9X)
|
||||
for (uint8_t i=0; i<NUM_CSW; i++) {
|
||||
int8_t len = getSwitch(SWSRC_SW1+i, 0) ? BAR_HEIGHT : 1;
|
||||
@@ -779,7 +779,7 @@ void menuMainView(uint8_t event)
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
for (uint8_t i=0; i<NUM_CSW; i++)
|
||||
putsSwitches(2*FW-2 + (i/3)*(4*FW-2) + (i/3>1 ? 3*FW : 0), 4*FH+1 + (i%3)*FH, SWSRC_SW1+i, getSwitch(SWSRC_SW1+i, 0) ? INVERS : 0);
|
||||
#elif !defined(CPUM64)
|
||||
#elif !defined(PCBSTD)
|
||||
for (uint8_t i=0; i<NUM_CSW; i++)
|
||||
putsSwitches(2*FW-2 + (i/3)*(4*FW-1), 4*FH+1 + (i%3)*FH, SWSRC_SW1+i, getSwitch(SWSRC_SW1+i, 0) ? INVERS : 0);
|
||||
#else
|
||||
@@ -814,7 +814,7 @@ void menuMainView(uint8_t event)
|
||||
s_gvar_timer--;
|
||||
s_warning = PSTR("Global Variable");
|
||||
displayBox();
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
lcd_putsAtt(16+4*FW, 5*FH, PSTR("[\010]"), BOLD);
|
||||
lcd_outdezAtt(16+4*FW+4*FW+FW/2, 5*FH, GVAR_VALUE(s_gvar_last, s_perout_flight_phase), BOLD);
|
||||
#else
|
||||
|
||||
+79
-77
@@ -26,6 +26,8 @@
|
||||
|
||||
import os, sys, shutil, platform, subprocess, wave, zipfile
|
||||
|
||||
NO_ALTERNATE = 1024
|
||||
|
||||
def generate(str, idx, alternate=0):
|
||||
result = None
|
||||
if "speak" in sys.argv:
|
||||
@@ -41,7 +43,7 @@ def generate(str, idx, alternate=0):
|
||||
elif board == 'sky9x':
|
||||
result = idx + ".wav"
|
||||
else:
|
||||
if alternate == 0:
|
||||
if alternate >= NO_ALTERNATE:
|
||||
return []
|
||||
result = "%04d.wav" % alternate
|
||||
|
||||
@@ -197,19 +199,19 @@ if __name__ == "__main__":
|
||||
"point four", "point five", "point six",
|
||||
"point seven", "point eight", "point nine"]):
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+160+i))
|
||||
for s, f, a in [(u"trim center", "midtrim", 244),
|
||||
(u"maximum trim reached", "endtrim", 0),
|
||||
(u"transmitter battery low", "lowbatt", 231),
|
||||
(u"inactivity alarm", "inactiv", 230),
|
||||
(u"throttle warning", "thralert", 232),
|
||||
(u"switch warning", "swalert", 233),
|
||||
(u"Welcome to open nine ex!", "tada", 245),
|
||||
(u"tick. tock", "timerlt3", 250),
|
||||
(u"ten. seconds", "timer10", 251),
|
||||
(u"twenty. seconds", "timer20", 252),
|
||||
(u"thirty. seconds", "timer30", 253),
|
||||
for s, f, a in [(u"trim center", "midtrim", 494),
|
||||
(u"maximum trim reached", "endtrim", NO_ALTERNATE),
|
||||
(u"transmitter battery low", "lowbatt", 481),
|
||||
(u"inactivity alarm", "inactiv", 480),
|
||||
(u"throttle warning", "thralert", 482),
|
||||
(u"switch warning", "swalert", 483),
|
||||
(u"Welcome to open nine ex!", "tada", 495),
|
||||
(u"tick. tock", "timerlt3", 500),
|
||||
(u"ten. seconds", "timer10", 501),
|
||||
(u"twenty. seconds", "timer20", 502),
|
||||
(u"thirty. seconds", "timer30", 503),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, PROMPT_SYSTEM_BASE+a))
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, (s, f) in enumerate([
|
||||
(u"gear!, up!", "gearup"),
|
||||
(u"gear!, down!", "geardn"),
|
||||
@@ -307,23 +309,23 @@ if __name__ == "__main__":
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+103+i))
|
||||
for i, s in enumerate(["volt", "amper", "meetri per secondo", "", "chilomeetri ora", "meetri", "gradi", "percento", "milliamper", "milliamper ora", "watt", "db", "piedi", "nodi", "ore", "minuti", "secondi", "R P M", "g"]):
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+113+i))
|
||||
for s, f, a in [(u"radio inattiva controllare", "inactiv", 230),
|
||||
(u"batteria della radio scarica", "lowbatt", 231),
|
||||
(u"controllo motore non in posizione, verificare", "thralert", 232),
|
||||
(u"interruttori non in posizione, verificare", "swalert", 233),
|
||||
(u"eeprom corrotta", "eebad", 0),
|
||||
(u"formattazone eeprom in corso", "eeformat", 0),
|
||||
(u"errore", "error", 0),
|
||||
(u"trim centrato", "midtrim", 244),
|
||||
(u"tada", "tada", 245),
|
||||
(u"potenziometro centrato", "midpot", 246),
|
||||
(u"massimo trim raggiunto", "endtrim", 0),
|
||||
(u"3 secondi al termine", "timerlt3", 250),
|
||||
(u"dieci secondi", "timer10", 251),
|
||||
(u"venti secondi", "timer20", 252),
|
||||
(u"trenta secondi", "timer30", 253),
|
||||
for s, f, a in [(u"radio inattiva controllare", "inactiv", 480),
|
||||
(u"batteria della radio scarica", "lowbatt", 481),
|
||||
(u"controllo motore non in posizione, verificare", "thralert", 482),
|
||||
(u"interruttori non in posizione, verificare", "swalert", 483),
|
||||
(u"eeprom corrotta", "eebad", NO_ALTERNATE),
|
||||
(u"formattazone eeprom in corso", "eeformat", NO_ALTERNATE),
|
||||
(u"errore", "error", NO_ALTERNATE),
|
||||
(u"trim centrato", "midtrim", 494),
|
||||
(u"tada", "tada", 495),
|
||||
(u"potenziometro centrato", "midpot", 496),
|
||||
(u"massimo trim raggiunto", "endtrim", NO_ALTERNATE),
|
||||
(u"3 secondi al termine", "timerlt3", 500),
|
||||
(u"dieci secondi", "timer10", 501),
|
||||
(u"venti secondi", "timer20", 502),
|
||||
(u"trenta secondi", "timer30", 503),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, PROMPT_SYSTEM_BASE+a))
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, s in enumerate(["timer", "timer", "trasmissione", "ricezione", "A1", "A2", "altitudine", "motore",
|
||||
"carburante", "temperatura", "temperatura", "velocita'", "distanza", "altitudine", "cella lipo",
|
||||
"totale lipo", "tensione", "corrente", "consumo", "potenza", "accelerazione X", "accellerazione Y", "accelerazione Z",
|
||||
@@ -376,23 +378,23 @@ if __name__ == "__main__":
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+102+i))
|
||||
for i, s in enumerate(["Volt", "Ampere", "Meter pro sekunde", "", "kilometer pro stunde", "Meter", "Grad", "Prozent", "Milliampere", "Milliampere pro stunde", "Watt", "db", "Fuesse", "Knoten", "Uhr", "Minuten", "Secunden", "R P M", "g"]):
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+110+i))
|
||||
for s, f, a in [(u"Sender ist inaktiv,bitte Ueberpruefen Sie", "inactiv", 230),
|
||||
(u"Senderakku niedrig", "lowbatt", 231),
|
||||
(u"Gaskanal nicht Null, bitte pruefen", "thralert", 232),
|
||||
(u"Schalten fehlpositioniert, bitte pruefen", "swalert", 233),
|
||||
(u"Das EEPROM ist fehlerhaft", "eebad", 0),
|
||||
(u"Das EEPROM ist immer formatiert", "eeformat", 0),
|
||||
(u"fehler", "error", 0),
|
||||
(u"Trim zentriert", "midtrim", 244),
|
||||
(u"tada", "tada", 245),
|
||||
(u"Poti zentriert", "midpot", 246),
|
||||
(u"Maximale trimmung erreicht", "endtrim", 0),
|
||||
(u"Noch drei sekunden", "timerlt3", 250),
|
||||
(u"10 sekunden", "timer10", 251),
|
||||
(u"20 sekunden", "timer20", 252),
|
||||
(u"30 sekunden", "timer30", 253),
|
||||
for s, f, a in [(u"Sender ist inaktiv,bitte Ueberpruefen Sie", "inactiv", 480),
|
||||
(u"Senderakku niedrig", "lowbatt", 481),
|
||||
(u"Gaskanal nicht Null, bitte pruefen", "thralert", 482),
|
||||
(u"Schalten fehlpositioniert, bitte pruefen", "swalert", 483),
|
||||
(u"Das EEPROM ist fehlerhaft", "eebad", NO_ALTERNATE),
|
||||
(u"Das EEPROM ist immer formatiert", "eeformat", NO_ALTERNATE),
|
||||
(u"fehler", "error", NO_ALTERNATE),
|
||||
(u"Trim zentriert", "midtrim", 494),
|
||||
(u"tada", "tada", 495),
|
||||
(u"Poti zentriert", "midpot", 496),
|
||||
(u"Maximale trimmung erreicht", "endtrim", NO_ALTERNATE),
|
||||
(u"Noch drei sekunden", "timerlt3", 500),
|
||||
(u"10 sekunden", "timer10", 501),
|
||||
(u"20 sekunden", "timer20", 502),
|
||||
(u"30 sekunden", "timer30", 503),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, PROMPT_SYSTEM_BASE+a))
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, s in enumerate(["Timer", "Timer", "Sendung", "Empfang", "A1", "A2", "Hoehe", "Motor",
|
||||
"Treibstoff", "Temperatur", "Temperatur", "Geschwindigkeit", "Ferne", "Hoehe", "Lipo-Zelle",
|
||||
"Zellen gesamt", "Spannung", "Strom", "Verbrauch", "Power", "Beschleunigung X", "Beschleunigung Y", "Beschleunigung Z",
|
||||
@@ -454,23 +456,23 @@ if __name__ == "__main__":
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+111+i))
|
||||
for i, s in enumerate([u"Volt", u"ampére", u"metros por segundo", u"", u"quilômetros por hora", u"metros", u"graus", u"cento", u"miliamperes", u"miliamperes por hora", u"watt", u"db", u"pés", u"nós", u"horas", u"minutos", u"segundos", u"RPM", u"g"]):
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+122+i))
|
||||
for s, f, a in [(u"atenção, o rádio foi esquecido ligado, por favor desligue-o", "inactiv", 230),
|
||||
(u"bateria do rádio fraca", "lowbatt", 231),
|
||||
(u"atenção,acelerador não está no mínimo", "thralert", 232),
|
||||
(u"atenção, certifique-se que os interruptores estão na posição certa", "swalert", 233),
|
||||
(u"eeprom corrompida", "eebad", 0),
|
||||
(u"formatação da eeprom em curso", "eeformat", 0),
|
||||
(u"erro", "error", 0),
|
||||
(u"trim centrado", "midtrim", 244),
|
||||
(u"tada", "tada", 245),
|
||||
(u"potenciómetro centrado", "midpot", 246),
|
||||
(u"trim no máximo", "endtrim", 0),
|
||||
(u"3 segundos", "timerlt3", 250),
|
||||
(u"10 segundos", "timer10", 251),
|
||||
(u"20 segundos", "timer20", 252),
|
||||
(u"30 segundos", "timer30", 253),
|
||||
for s, f, a in [(u"atenção, o rádio foi esquecido ligado, por favor desligue-o", "inactiv", 480),
|
||||
(u"bateria do rádio fraca", "lowbatt", 481),
|
||||
(u"atenção,acelerador não está no mínimo", "thralert", 482),
|
||||
(u"atenção, certifique-se que os interruptores estão na posição certa", "swalert", 483),
|
||||
(u"eeprom corrompida", "eebad", NO_ALTERNATE),
|
||||
(u"formatação da eeprom em curso", "eeformat", NO_ALTERNATE),
|
||||
(u"erro", "error", NO_ALTERNATE),
|
||||
(u"trim centrado", "midtrim", 494),
|
||||
(u"tada", "tada", 495),
|
||||
(u"potenciómetro centrado", "midpot", 496),
|
||||
(u"trim no máximo", "endtrim", NO_ALTERNATE),
|
||||
(u"3 segundos", "timerlt3", 500),
|
||||
(u"10 segundos", "timer10", 501),
|
||||
(u"20 segundos", "timer20", 502),
|
||||
(u"30 segundos", "timer30", 503),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, PROMPT_SYSTEM_BASE+a))
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, s in enumerate([u"cronómetro", u"cronómetro", u"transmissão", u"recepção", u"A1", u"A2", u"altitude", u"motor",
|
||||
u"combustível", u"temperatura", u"temperatura", u"velocidade", u"distância", u"altitude", u"célula lipo"
|
||||
u"Total lipo", u"tensão", u"corrente", u"consumo", u"potência", u"aceleração X", u"aceleração Y", u"aceleração Z"
|
||||
@@ -547,19 +549,19 @@ if __name__ == "__main__":
|
||||
u"gé", u"gé", u"gé", u"gé"]):
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+118+i))
|
||||
|
||||
for s, f, a in [(u"střed trimu", "midtrim", 244),
|
||||
(u"maximum trimu", "endtrim", 0),
|
||||
(u"baterie rádia je vybitá", "lowbatt", 231),
|
||||
(u"zapoměl jsi na mě!", "inactiv", 230),
|
||||
(u"plyn není na nule", "thralert", 232),
|
||||
(u"přepínače nejsou ve výchozí poloze", "swalert", 233),
|
||||
(u"tadá", "tada", 245),
|
||||
(u"ťik ťak", "timerlt3", 250),
|
||||
(u"deset sekund", "timer10", 251),
|
||||
(u"dvacet sekund", "timer20", 252),
|
||||
(u"třicet sekund", "timer30", 253),
|
||||
for s, f, a in [(u"střed trimu", "midtrim", 494),
|
||||
(u"maximum trimu", "endtrim", NO_ALTERNATE),
|
||||
(u"baterie rádia je vybitá", "lowbatt", 481),
|
||||
(u"zapoměl jsi na mě!", "inactiv", 480),
|
||||
(u"plyn není na nule", "thralert", 482),
|
||||
(u"přepínače nejsou ve výchozí poloze", "swalert", 483),
|
||||
(u"tadá", "tada", 495),
|
||||
(u"ťik ťak", "timerlt3", 500),
|
||||
(u"deset sekund", "timer10", 501),
|
||||
(u"dvacet sekund", "timer20", 502),
|
||||
(u"třicet sekund", "timer30", 503),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, PROMPT_SYSTEM_BASE+a))
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, (s, f) in enumerate([
|
||||
(u"podvozek je zasunut", "gearup"),
|
||||
(u"podvozek je vysunut", "geardn"),
|
||||
@@ -599,13 +601,13 @@ if __name__ == "__main__":
|
||||
for f, s in systemSounds:
|
||||
l = u""
|
||||
if board == "sky9x":
|
||||
l += u"9XSOUNDS/SYSTEM;"
|
||||
l += u"SOUNDS/SYSTEM;"
|
||||
l += f + u";" + s + u"\n"
|
||||
csvFile.write(l.encode("latin-1"))
|
||||
for f, s in sounds:
|
||||
l = u""
|
||||
if board == "sky9x":
|
||||
l += u"9XSOUNDS;"
|
||||
l += u"SOUNDS;"
|
||||
l += f + u";" + s + u"\n"
|
||||
csvFile.write(l.encode("latin-1"))
|
||||
csvFile.close()
|
||||
@@ -615,13 +617,13 @@ if __name__ == "__main__":
|
||||
zip = zipfile.ZipFile(zip_name, "w", zipfile.ZIP_DEFLATED)
|
||||
for f, s in systemSounds:
|
||||
if board == "sky9x":
|
||||
zip.write(f, "9XSOUNDS/SYSTEM/" + f)
|
||||
zip.write(f, "SOUNDS/SYSTEM/" + f)
|
||||
else:
|
||||
zip.write(f, f)
|
||||
os.remove(f)
|
||||
for f, s in sounds:
|
||||
if board == "sky9x":
|
||||
zip.write(f, "9XSOUNDS/" + f)
|
||||
zip.write(f, "SOUNDS/" + f)
|
||||
else:
|
||||
zip.write(f, f)
|
||||
os.remove(f)
|
||||
|
||||
Reference in New Issue
Block a user