Compare commits

...

10 Commits

Author SHA1 Message Date
romolo.manfredini@gmail.com f2ff5bccd3 release 2249 2013-04-09 06:27:44 +00:00
bsongis@gmail.com e064edc69b [stock128] A compromise for RAM! 2013-04-08 20:52:00 +00:00
bsongis@gmail.com 4d03134e9e [stock128] Less RAM used!!! 2013-04-08 19:12:38 +00:00
bsongis@gmail.com 541c5aa000 [stock128] Less RAM used!!! 2013-04-08 17:34:33 +00:00
mhotar@gmail.com ad82ce9c1b tts files synced to EN version 2013-04-08 10:03:40 +00:00
bsongis@gmail.com 7c4bb27ebd Remaining traces removed 2013-04-07 21:01:16 +00:00
bernet.andre@gmail.com e484668033 [taranis] inverted pot 2013-04-07 19:40:13 +00:00
bsongis@gmail.com 5f9a24cddd [gruvin9x] Issue 12 fixed 2013-04-07 19:31:38 +00:00
bsongis@gmail.com 5154ba238a Cosmetics 2013-04-07 19:28:38 +00:00
romolo.manfredini@gmail.com c4a8e121d3 taranis eeprom write 2013-04-07 09:29:21 +00:00
21 changed files with 179 additions and 111 deletions
+14 -9
View File
@@ -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
View File
@@ -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;
}
+2 -2
View File
@@ -813,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
@@ -860,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);
+9 -9
View File
@@ -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;
@@ -2276,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)
@@ -3050,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);
@@ -3077,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
View File
@@ -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
View File
@@ -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
View File
@@ -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];
+20 -27
View File
@@ -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)
@@ -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
View File
@@ -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)
+1 -1
View File
@@ -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()
+13 -7
View File
@@ -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 ;
}
+1 -2
View File
@@ -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
+1 -1
View File
@@ -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 "+=""*="":="
+10 -1
View File
@@ -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) {
+10 -1
View File
@@ -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) {
+10 -1
View File
@@ -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) {
+10 -1
View File
@@ -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) {
+10 -1
View File
@@ -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) {
+10 -1
View File
@@ -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) {
+10 -1
View File
@@ -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
View File
@@ -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