CZ translations update - warnings

This commit is contained in:
mhotar@gmail.com
2012-05-24 18:42:57 +00:00
parent 29f91b4024
commit c1e61fdd38
2 changed files with 209 additions and 209 deletions
+203 -203
View File
@@ -52,9 +52,9 @@ EEGeneral g_eeGeneral;
ModelData g_model; ModelData g_model;
#if !defined(PCBARM) #if !defined(PCBARM)
uint8_t g_tmr1Latency_max; uint8_t g_tmr1Latency_max;
uint8_t g_tmr1Latency_min; uint8_t g_tmr1Latency_min;
#endif #endif
uint16_t g_timeMain; uint16_t g_timeMain;
#ifdef DEBUG #ifdef DEBUG
uint16_t g_time_per10; uint16_t g_time_per10;
@@ -321,12 +321,12 @@ int16_t Expo::expo(int16_t x)
#endif #endif
void applyExpos(int16_t *anas) void applyExpos(int16_t *anas)
{ {
static int16_t anas2[NUM_STICKS]; // values before expo, to ensure same expo base when multiple expo lines are used static int16_t anas2[NUM_STICKS]; // values before expo, to ensure same expo base when multiple expo lines are used
memcpy(anas2, anas, sizeof(anas2)); memcpy(anas2, anas, sizeof(anas2));
uint8_t phase = s_perout_flight_phase + 1; uint8_t phase = s_perout_flight_phase + 1;
int8_t cur_chn = -1; int8_t cur_chn = -1;
for (uint8_t i=0; i<MAX_EXPOS; i++) { for (uint8_t i=0; i<MAX_EXPOS; i++) {
@@ -672,7 +672,7 @@ void setTrimValue(uint8_t phase, uint8_t idx, int16_t trim)
STORE_MODELVARS; STORE_MODELVARS;
} }
uint8_t getTrimFlightPhase(uint8_t phase, uint8_t idx) uint8_t getTrimFlightPhase(uint8_t phase, uint8_t idx)
{ {
for (uint8_t i=0; i<MAX_PHASES; i++) { for (uint8_t i=0; i<MAX_PHASES; i++) {
if (phase == 0) return 0; if (phase == 0) return 0;
@@ -961,7 +961,7 @@ void message(const pm_char *title, const pm_char *t, const char *last)
#else #else
lcd_putsAtt(0, 0, PSTR("(!)"), DBLSIZE); lcd_putsAtt(0, 0, PSTR("(!)"), DBLSIZE);
#endif #endif
#if defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_IT) #if defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_IT) || defined(TRANSLATIONS_CZ)
lcd_putsAtt(6*FW, 0, STR_WARNING, DBLSIZE); lcd_putsAtt(6*FW, 0, STR_WARNING, DBLSIZE);
lcd_putsAtt(6*FW, 2*FH, title, DBLSIZE); lcd_putsAtt(6*FW, 2*FH, title, DBLSIZE);
#else #else
@@ -987,7 +987,7 @@ uint8_t checkTrim(uint8_t event)
if (k>=0 && k<8) { // && (event & _MSK_KEY_REPT)) if (k>=0 && k<8) { // && (event & _MSK_KEY_REPT))
//LH_DWN LH_UP LV_DWN LV_UP RV_DWN RV_UP RH_DWN RH_UP //LH_DWN LH_UP LV_DWN LV_UP RV_DWN RV_UP RH_DWN RH_UP
uint8_t idx = CONVERT_MODE(1+k/2) - 1; uint8_t idx = CONVERT_MODE(1+k/2) - 1;
uint8_t phase = getTrimFlightPhase(s_perout_flight_phase, idx); uint8_t phase = getTrimFlightPhase(s_perout_flight_phase, idx);
int16_t before = getRawTrimValue(phase, idx); int16_t before = getRawTrimValue(phase, idx);
int8_t v = (s==0) ? min(32, abs(before)/4+1) : 1 << (s-1); // 1=>1 2=>2 3=>4 4=>8 int8_t v = (s==0) ? min(32, abs(before)/4+1) : 1 << (s-1); // 1=>1 2=>2 3=>4 4=>8
bool thro = (idx==THR_STICK && g_model.thrTrim); bool thro = (idx==THR_STICK && g_model.thrTrim);
@@ -1161,26 +1161,26 @@ void getADC_filt()
void getADC_osmp() void getADC_osmp()
{ {
uint16_t temp_ana; uint16_t temp_ana;
for (uint8_t adc_input=0; adc_input<8; adc_input++) { for (uint8_t adc_input=0; adc_input<8; adc_input++) {
temp_ana = 0; temp_ana = 0;
ADMUX = adc_input|ADC_VREF_TYPE; ADMUX = adc_input|ADC_VREF_TYPE;
for (uint8_t i=0; i<4;i++) { // Going from 10bits to 11 bits. Addition = n. Loop 4^n times for (uint8_t i=0; i<4;i++) { // Going from 10bits to 11 bits. Addition = n. Loop 4^n times
// Start the AD conversion // Start the AD conversion
ADCSRA|=0x40; ADCSRA|=0x40;
// Wait for the AD conversion to complete // Wait for the AD conversion to complete
while ((ADCSRA & 0x10)==0); while ((ADCSRA & 0x10)==0);
ADCSRA|=0x10; ADCSRA|=0x10;
temp_ana += ADCW; temp_ana += ADCW;
} }
s_anaFilt[adc_input] = temp_ana / 2; // divide by 2^n to normalize result. s_anaFilt[adc_input] = temp_ana / 2; // divide by 2^n to normalize result.
} }
} }
void getADC_single() void getADC_single()
{ {
for (uint8_t adc_input=0; adc_input<8; adc_input++) { for (uint8_t adc_input=0; adc_input<8; adc_input++) {
ADMUX=adc_input|ADC_VREF_TYPE; ADMUX=adc_input|ADC_VREF_TYPE;
// Start the AD conversion // Start the AD conversion
ADCSRA|=0x40; ADCSRA|=0x40;
@@ -1192,7 +1192,7 @@ void getADC_single()
} }
#endif #endif
#if not defined(PCBARM) #if not defined(PCBARM)
void getADC_bandgap() void getADC_bandgap()
{ {
#if defined (PCBV4) #if defined (PCBV4)
@@ -1316,7 +1316,7 @@ int32_t act [MAX_MIXERS] = {0};
uint8_t swOn [MAX_MIXERS] = {0}; uint8_t swOn [MAX_MIXERS] = {0};
uint8_t mixWarning; uint8_t mixWarning;
FORCEINLINE void evalTrims() FORCEINLINE void evalTrims()
{ {
uint8_t phase = s_perout_flight_phase; uint8_t phase = s_perout_flight_phase;
for (uint8_t i=0; i<NUM_STICKS; i++) { for (uint8_t i=0; i<NUM_STICKS; i++) {
@@ -1325,10 +1325,10 @@ FORCEINLINE void evalTrims()
int32_t vv = 2*RESX; int32_t vv = 2*RESX;
int16_t trim = getTrimValue(phase, i); int16_t trim = getTrimValue(phase, i);
if (i==THR_STICK && g_model.thrTrim) { if (i==THR_STICK && g_model.thrTrim) {
if (g_eeGeneral.throttleReversed) if (g_eeGeneral.throttleReversed)
trim = -trim; trim = -trim;
int16_t v = anas[i]; int16_t v = anas[i];
vv = ((int32_t)trim-TRIM_MIN)*(RESX-v)/(2*RESX); vv = ((int32_t)trim-TRIM_MIN)*(RESX-v)/(2*RESX);
} }
else if (trimsCheckTimer > 0) { else if (trimsCheckTimer > 0) {
trim = 0; trim = 0;
@@ -1347,7 +1347,7 @@ enum PerOutMode {
uint8_t s_perout_mode = e_perout_mode_normal; uint8_t s_perout_mode = e_perout_mode_normal;
BeepANACenter evalSticks() BeepANACenter evalSticks()
{ {
BeepANACenter anaCenter = 0; BeepANACenter anaCenter = 0;
@@ -1385,10 +1385,10 @@ BeepANACenter evalSticks()
if(v < -RESX) v = -RESX; if(v < -RESX) v = -RESX;
if(v > RESX) v = RESX; if(v > RESX) v = RESX;
if (g_eeGeneral.throttleReversed && ch==THR_STICK) if (g_eeGeneral.throttleReversed && ch==THR_STICK)
v = -v; v = -v;
if (i < NUM_STICKS+NUM_POTS) if (i < NUM_STICKS+NUM_POTS)
calibratedStick[ch] = v; //for show in expo calibratedStick[ch] = v; //for show in expo
@@ -1421,17 +1421,17 @@ BeepANACenter evalSticks()
} }
/* EXPOs */ /* EXPOs */
applyExpos(anas); applyExpos(anas);
/* TRIMs */ /* TRIMs */
evalTrims(); evalTrims();
return anaCenter; return anaCenter;
} }
#ifdef DEBUG #ifdef DEBUG
/* /*
* This is a test function for debugging purpose, you may insert there your code and compile with the option DEBUG=YES * This is a test function for debugging purpose, you may insert there your code and compile with the option DEBUG=YES
*/ */
void testFunc() void testFunc()
{ {
@@ -1549,9 +1549,9 @@ void evalFunctions()
} }
uint8_t s_perout_flight_phase; uint8_t s_perout_flight_phase;
void perOut() void perOut()
{ {
BeepANACenter anaCenter = evalSticks(); BeepANACenter anaCenter = evalSticks();
if (s_perout_mode == e_perout_mode_normal) { if (s_perout_mode == e_perout_mode_normal) {
//===========BEEP CENTER================ //===========BEEP CENTER================
@@ -1798,9 +1798,9 @@ void perOut()
mixWarning = lv_mixWarning; mixWarning = lv_mixWarning;
} }
#ifdef DISPLAY_USER_DATA #ifdef DISPLAY_USER_DATA
char userDataDisplayBuf[TELEM_SCREEN_BUFFER_SIZE]; char userDataDisplayBuf[TELEM_SCREEN_BUFFER_SIZE];
#endif #endif
#if (defined(PCBARM) && !defined(REVA) && !defined(SIMU)) || (defined(PCBV4) && !defined(REV0) && !defined(SIMU)) #if (defined(PCBARM) && !defined(REVA) && !defined(SIMU)) || (defined(PCBV4) && !defined(REV0) && !defined(SIMU))
#define TIME_TO_WRITE (s_eeDirtyMsk && (get_tmr10ms() - s_eeDirtyTime10ms) >= WRITE_DELAY_10MS) #define TIME_TO_WRITE (s_eeDirtyMsk && (get_tmr10ms() - s_eeDirtyTime10ms) >= WRITE_DELAY_10MS)
@@ -1808,7 +1808,7 @@ char userDataDisplayBuf[TELEM_SCREEN_BUFFER_SIZE];
#define TIME_TO_WRITE s_eeDirtyMsk #define TIME_TO_WRITE s_eeDirtyMsk
#endif #endif
int32_t sum_chans512[NUM_CHNOUT] = {0}; int32_t sum_chans512[NUM_CHNOUT] = {0};
void perMain() void perMain()
{ {
static uint16_t lastTMR; static uint16_t lastTMR;
@@ -1817,51 +1817,51 @@ void perMain()
lastTMR = tmr10ms; lastTMR = tmr10ms;
#define MAX_ACT 0xffff #define MAX_ACT 0xffff
static uint16_t fp_act[MAX_PHASES] = {0}; static uint16_t fp_act[MAX_PHASES] = {0};
static uint16_t delta = 0; static uint16_t delta = 0;
static uint8_t s_fade_flight_phases = 0; static uint8_t s_fade_flight_phases = 0;
static uint8_t s_last_phase = 255; static uint8_t s_last_phase = 255;
uint8_t phase = getFlightPhase(); uint8_t phase = getFlightPhase();
int32_t weight = 0; int32_t weight = 0;
if (s_last_phase != phase) { if (s_last_phase != phase) {
if (s_last_phase == 255) { if (s_last_phase == 255) {
fp_act[phase] = MAX_ACT; fp_act[phase] = MAX_ACT;
} }
else { else {
uint8_t fadeTime = max(g_model.phaseData[s_last_phase].fadeOut, g_model.phaseData[phase].fadeIn); uint8_t fadeTime = max(g_model.phaseData[s_last_phase].fadeOut, g_model.phaseData[phase].fadeIn);
if (fadeTime) { if (fadeTime) {
s_fade_flight_phases |= (1<<s_last_phase) + (1<<phase); s_fade_flight_phases |= (1<<s_last_phase) + (1<<phase);
delta = (MAX_ACT / 100) / fadeTime; delta = (MAX_ACT / 100) / fadeTime;
} }
else { else {
fp_act[s_last_phase] = 0; fp_act[s_last_phase] = 0;
fp_act[phase] = MAX_ACT; fp_act[phase] = MAX_ACT;
s_fade_flight_phases &= ~((1<<s_last_phase) + (1<<phase)); s_fade_flight_phases &= ~((1<<s_last_phase) + (1<<phase));
} }
} }
s_last_phase = phase; s_last_phase = phase;
} }
if (s_fade_flight_phases) { if (s_fade_flight_phases) {
memset(sum_chans512, 0, sizeof(sum_chans512)); memset(sum_chans512, 0, sizeof(sum_chans512));
weight = 0; weight = 0;
for (uint8_t p=0; p<MAX_PHASES; p++) { for (uint8_t p=0; p<MAX_PHASES; p++) {
if (s_fade_flight_phases & (1<<p)) { if (s_fade_flight_phases & (1<<p)) {
s_perout_flight_phase = p; s_perout_flight_phase = p;
perOut(); perOut();
for (uint8_t i=0; i<NUM_CHNOUT; i++) for (uint8_t i=0; i<NUM_CHNOUT; i++)
sum_chans512[i] += (chans[i] / 16) * fp_act[p]; sum_chans512[i] += (chans[i] / 16) * fp_act[p];
weight += fp_act[p]; weight += fp_act[p];
} }
} }
// printf("sum=%d, weight=%d ", sum_chans512[2], weight); fflush(stdout); // printf("sum=%d, weight=%d ", sum_chans512[2], weight); fflush(stdout);
assert(weight); assert(weight);
s_perout_flight_phase = phase; s_perout_flight_phase = phase;
} }
else { else {
s_perout_flight_phase = phase; s_perout_flight_phase = phase;
perOut(); perOut();
} }
//========== LIMITS =============== //========== LIMITS ===============
@@ -2056,27 +2056,27 @@ void perMain()
} }
// Timers end // Timers end
if (s_fade_flight_phases) { if (s_fade_flight_phases) {
for (uint8_t p=0; p<MAX_PHASES; p++) { for (uint8_t p=0; p<MAX_PHASES; p++) {
if (s_fade_flight_phases & (1<<p)) { if (s_fade_flight_phases & (1<<p)) {
if (p == phase) { if (p == phase) {
if (MAX_ACT - fp_act[p] > delta) if (MAX_ACT - fp_act[p] > delta)
fp_act[p] += delta; fp_act[p] += delta;
else { else {
fp_act[p] = MAX_ACT; fp_act[p] = MAX_ACT;
s_fade_flight_phases -= (1<<p); s_fade_flight_phases -= (1<<p);
} }
} }
else { else {
if (fp_act[p] > delta) if (fp_act[p] > delta)
fp_act[p] -= delta; fp_act[p] -= delta;
else { else {
fp_act[p] = 0; fp_act[p] = 0;
s_fade_flight_phases -= (1<<p); s_fade_flight_phases -= (1<<p);
} }
} }
} }
} }
} }
evalFunctions(); evalFunctions();
@@ -2099,33 +2099,33 @@ void perMain()
#if defined(PCBV4) && defined(SDCARD) #if defined(PCBV4) && defined(SDCARD)
writeLogs(); writeLogs();
#endif #endif
#if defined(FRSKY) && defined(DISPLAY_USER_DATA) #if defined(FRSKY) && defined(DISPLAY_USER_DATA)
char userDataRxBuffer[21]; // Temp buffer used to collect fr-sky user data char userDataRxBuffer[21]; // Temp buffer used to collect fr-sky user data
// retrieve bytes from user data buffer and insert into display string, // retrieve bytes from user data buffer and insert into display string,
// scrolling at the 21 character mark (edge of screen) // scrolling at the 21 character mark (edge of screen)
uint8_t numbytes = frskyGetUserData(userDataRxBuffer, 21); // Get as many bytes as we can uint8_t numbytes = frskyGetUserData(userDataRxBuffer, 21); // Get as many bytes as we can
static uint8_t displayBufferIndex; static uint8_t displayBufferIndex;
for (uint8_t byt=0; byt < numbytes; byt++) for (uint8_t byt=0; byt < numbytes; byt++)
{ {
displayBufferIndex++; displayBufferIndex++;
if (displayBufferIndex > 20) if (displayBufferIndex > 20)
{ {
for (int xx=0; xx<20; xx++) // scroll one char left for (int xx=0; xx<20; xx++) // scroll one char left
userDataDisplayBuf[xx] = userDataDisplayBuf[xx+1]; userDataDisplayBuf[xx] = userDataDisplayBuf[xx+1];
displayBufferIndex = 20; displayBufferIndex = 20;
} }
userDataDisplayBuf[displayBufferIndex] = userDataRxBuffer[byt]; userDataDisplayBuf[displayBufferIndex] = userDataRxBuffer[byt];
// Write the raw byte out to log file, if open // Write the raw byte out to log file, if open
if (testLogOpen && (g_oLogFile.fs != 0)) if (testLogOpen && (g_oLogFile.fs != 0))
f_putc(userDataRxBuffer[byt], &g_oLogFile); f_putc(userDataRxBuffer[byt], &g_oLogFile);
} }
#endif #endif
lcd_clear(); lcd_clear();
uint8_t evt = getEvent(); uint8_t evt = getEvent();
evt = checkTrim(evt); evt = checkTrim(evt);
@@ -2153,23 +2153,23 @@ void perMain()
else { else {
PIOC->PIO_PER = PIO_PC22 ; // Enable bit C22 as input PIOC->PIO_PER = PIO_PC22 ; // Enable bit C22 as input
} }
#elif defined(PCBV4) #elif defined(PCBV4)
// PPM signal on phono-jack. In or out? ...
if(checkSlaveMode()) {
PORTG |= (1<<OUT_G_SIM_CTL); // 1=ppm out
}
else{
PORTG &= ~(1<<OUT_G_SIM_CTL); // 0=ppm in
}
#elif defined(PCBSTD)
// PPM signal on phono-jack. In or out? ... // PPM signal on phono-jack. In or out? ...
if(checkSlaveMode()) { if(checkSlaveMode()) {
PORTG |= (1<<OUT_G_SIM_CTL); // 1=ppm out
}
else{
PORTG &= ~(1<<OUT_G_SIM_CTL); // 0=ppm in
}
#elif defined(PCBSTD)
// PPM signal on phono-jack. In or out? ...
if(checkSlaveMode()) {
PORTG &= ~(1<<OUT_G_SIM_CTL); // 0=ppm out PORTG &= ~(1<<OUT_G_SIM_CTL); // 0=ppm out
} }
else{ else{
PORTG |= (1<<OUT_G_SIM_CTL); // 1=ppm-in PORTG |= (1<<OUT_G_SIM_CTL); // 1=ppm-in
} }
#endif #endif
switch( tmr10ms & 0x1f ) { //alle 10ms*32 switch( tmr10ms & 0x1f ) { //alle 10ms*32
@@ -2316,25 +2316,25 @@ ISR(TIMER0_COMP_vect, ISR_NOBLOCK) //10ms timer
// count delta values thus can range from about 1600 to 4400 counts (800us to 2200us), // count delta values thus can range from about 1600 to 4400 counts (800us to 2200us),
// corresponding to a PPM signal in the range 0.8ms to 2.2ms (1.5ms at center). // corresponding to a PPM signal in the range 0.8ms to 2.2ms (1.5ms at center).
// (The timer is free-running and is thus not reset to zero at each capture interval.) // (The timer is free-running and is thus not reset to zero at each capture interval.)
ISR(TIMER3_CAPT_vect) // G: High frequency noise can cause stack overflo with ISR_NOBLOCK ISR(TIMER3_CAPT_vect) // G: High frequency noise can cause stack overflo with ISR_NOBLOCK
{ {
static uint16_t lastCapt; static uint16_t lastCapt;
uint16_t capture=ICR3; uint16_t capture=ICR3;
// Prevent rentrance for this IRQ only // Prevent rentrance for this IRQ only
#if defined (PCBV4) #if defined (PCBV4)
TIMSK3 &= ~(1<<ICIE3); TIMSK3 &= ~(1<<ICIE3);
#else #else
ETIMSK &= ~(1<<TICIE3); ETIMSK &= ~(1<<TICIE3);
#endif #endif
sei(); // enable other interrupts sei(); // enable other interrupts
uint16_t val = (capture - lastCapt) / 2; uint16_t val = (capture - lastCapt) / 2;
// G: We prcoess g_ppmIns immediately here, to make servo movement as smooth as possible // G: We prcoess g_ppmIns immediately here, to make servo movement as smooth as possible
// while under trainee control // while under trainee control
if (val>4000 && val < 16000) // G: Prioritize reset pulse. (Needed when less than 8 incoming pulses) if (val>4000 && val < 16000) // G: Prioritize reset pulse. (Needed when less than 8 incoming pulses)
ppmInState = 1; // triggered ppmInState = 1; // triggered
else else
{ {
@@ -2352,7 +2352,7 @@ ISR(TIMER3_CAPT_vect) // G: High frequency noise can cause stack overflo with IS
lastCapt = capture; lastCapt = capture;
cli(); // disable other interrupts for stack pops before this function's RETI cli(); // disable other interrupts for stack pops before this function's RETI
#if defined (PCBV4) #if defined (PCBV4)
TIMSK3 |= (1<<ICIE3); TIMSK3 |= (1<<ICIE3);
#else #else
@@ -2392,55 +2392,55 @@ extern uint16_t g_timeMain;
#endif #endif
/* /*
USART0 Transmit Data Register Emtpy ISR USART0 Transmit Data Register Emtpy ISR
Used to transmit FrSky data packets and DSM2 protocol Used to transmit FrSky data packets and DSM2 protocol
*/ */
// TODO serial_arm and serial_avr // TODO serial_arm and serial_avr
#if defined (FRSKY) && !defined(PCBARM)
FORCEINLINE void FRSKY_USART0_vect()
{
if (frskyTxBufferCount > 0) {
UDR0 = frskyTxBuffer[--frskyTxBufferCount];
}
else {
UCSR0B &= ~(1 << UDRIE0); // disable UDRE0 interrupt
}
}
#endif
#if defined (DSM2_SERIAL) && !defined(PCBARM)
FORCEINLINE void DSM2_USART0_vect()
{
UDR0 = *((uint16_t*)pulses2MHzRPtr);
pulses2MHzRPtr += sizeof(uint16_t); #if defined (FRSKY) && !defined(PCBARM)
if (pulses2MHzRPtr == pulses2MHzWPtr) { FORCEINLINE void FRSKY_USART0_vect()
UCSR0B &= ~(1 << UDRIE0); // disable UDRE0 interrupt {
} if (frskyTxBufferCount > 0) {
} UDR0 = frskyTxBuffer[--frskyTxBufferCount];
#endif }
else {
#if !defined(SIMU) && !defined(PCBARM) UCSR0B &= ~(1 << UDRIE0); // disable UDRE0 interrupt
#if defined (FRSKY) or defined(DSM2_SERIAL) }
ISR(USART0_UDRE_vect) }
{ #endif
#if defined (FRSKY) and defined (DSM2_SERIAL)
if (g_model.protocol == PROTO_DSM2) { #if defined (DSM2_SERIAL) && !defined(PCBARM)
DSM2_USART0_vect(); FORCEINLINE void DSM2_USART0_vect()
} {
else { UDR0 = *((uint16_t*)pulses2MHzRPtr);
FRSKY_USART0_vect();
} pulses2MHzRPtr += sizeof(uint16_t);
#elif defined (FRSKY) if (pulses2MHzRPtr == pulses2MHzWPtr) {
FRSKY_USART0_vect(); UCSR0B &= ~(1 << UDRIE0); // disable UDRE0 interrupt
#else }
DSM2_USART0_vect(); }
#endif #endif
}
#endif #if !defined(SIMU) && !defined(PCBARM)
#if defined (FRSKY) or defined(DSM2_SERIAL)
ISR(USART0_UDRE_vect)
{
#if defined (FRSKY) and defined (DSM2_SERIAL)
if (g_model.protocol == PROTO_DSM2) {
DSM2_USART0_vect();
}
else {
FRSKY_USART0_vect();
}
#elif defined (FRSKY)
FRSKY_USART0_vect();
#else
DSM2_USART0_vect();
#endif
}
#endif
#endif #endif
void instantTrim() void instantTrim()
@@ -2448,9 +2448,9 @@ void instantTrim()
for (uint8_t i=0; i<NUM_STICKS; i++) { for (uint8_t i=0; i<NUM_STICKS; i++) {
if (i!=THR_STICK) { if (i!=THR_STICK) {
// don't instant trim the throttle stick // don't instant trim the throttle stick
uint8_t trim_phase = getTrimFlightPhase(s_perout_flight_phase, i); uint8_t trim_phase = getTrimFlightPhase(s_perout_flight_phase, i);
s_perout_mode = e_instant_trim; s_perout_mode = e_instant_trim;
evalSticks(); evalSticks();
s_perout_mode = e_perout_mode_normal; s_perout_mode = e_perout_mode_normal;
int16_t trim = (anas[i] + trims[i]) / 2; int16_t trim = (anas[i] + trims[i]) / 2;
if (trim < TRIM_EXTENDED_MIN) { if (trim < TRIM_EXTENDED_MIN) {
@@ -2506,40 +2506,40 @@ void moveTrimsToOffsets() // copy state of 3 primary to subtrim
AUDIO_WARNING2(); AUDIO_WARNING2();
} }
#if defined (PCBV4) #if defined (PCBV4)
// Rotary encoder interrupts // Rotary encoder interrupts
volatile uint8_t g_rotenc[2] = {0}; volatile uint8_t g_rotenc[2] = {0};
#endif #endif
#ifndef SIMU #ifndef SIMU
#if defined (PCBV4) #if defined (PCBV4)
#if !defined(EXTRA_ROTARY_ENCODERS) #if !defined(EXTRA_ROTARY_ENCODERS)
ISR(INT2_vect) ISR(INT2_vect)
{ {
uint8_t input = PIND & 0b00001100; uint8_t input = PIND & 0b00001100;
if (input == 0 || input == 0b00001100) incRotaryEncoder(0, -1); if (input == 0 || input == 0b00001100) incRotaryEncoder(0, -1);
} }
ISR(INT3_vect) ISR(INT3_vect)
{ {
uint8_t input = PIND & 0b00001100; uint8_t input = PIND & 0b00001100;
if (input == 0 || input == 0b00001100) incRotaryEncoder(0, +1); if (input == 0 || input == 0b00001100) incRotaryEncoder(0, +1);
} }
#endif //EXTRA_ROTARY_ENCODERS #endif //EXTRA_ROTARY_ENCODERS
ISR(INT5_vect) ISR(INT5_vect)
{ {
uint8_t input = PINE & 0b01100000; uint8_t input = PINE & 0b01100000;
if (input == 0 || input == 0b01100000) incRotaryEncoder(1, +1); if (input == 0 || input == 0b01100000) incRotaryEncoder(1, +1);
} }
ISR(INT6_vect) ISR(INT6_vect)
{ {
uint8_t input = PINE & 0b01100000; uint8_t input = PINE & 0b01100000;
if (input == 0 || input == 0b01100000) incRotaryEncoder(1, -1); if (input == 0 || input == 0b01100000) incRotaryEncoder(1, -1);
} }
#endif //PCBV4 #endif //PCBV4
#if !defined(PCBARM) #if !defined(PCBARM)
extern unsigned char __bss_end ; extern unsigned char __bss_end ;
uint16_t stack_free() uint16_t stack_free()
@@ -2584,16 +2584,16 @@ int main(void)
lcdSetRefVolt(25); lcdSetRefVolt(25);
sei(); // interrupts needed for FRSKY_Init and eeReadAll. sei(); // interrupts needed for FRSKY_Init and eeReadAll.
#if defined (FRSKY) and !defined (DSM2_SERIAL) #if defined (FRSKY) and !defined (DSM2_SERIAL)
FRSKY_Init(); FRSKY_Init();
#endif #endif
#if defined (DSM2_SERIAL) and !defined (FRSKY) #if defined (DSM2_SERIAL) and !defined (FRSKY)
DSM2_Init(); DSM2_Init();
#endif #endif
#ifdef JETI #ifdef JETI
JETI_Init(); JETI_Init();
#endif #endif
@@ -2657,7 +2657,7 @@ int main(void)
} }
#endif #endif
clearKeyEvents(); //make sure no keys are down before proceeding clearKeyEvents(); //make sure no keys are down before proceeding
lcdSetRefVolt(g_eeGeneral.contrast); lcdSetRefVolt(g_eeGeneral.contrast);
g_LightOffCounter = g_eeGeneral.lightAutoOff*500; //turn on light for x seconds - no need to press key Issue 152 g_LightOffCounter = g_eeGeneral.lightAutoOff*500; //turn on light for x seconds - no need to press key Issue 152
+6 -6
View File
@@ -304,7 +304,7 @@
#define TR_SPLASHSCREEN "\210vodn\204Logo" #define TR_SPLASHSCREEN "\210vodn\204Logo"
#define TR_THROTTLEWARNING "Upoz:Plyn" #define TR_THROTTLEWARNING "Upoz:Plyn"
#define TR_SWITCHWARNING ":=Sp\204na\201e" #define TR_SWITCHWARNING ":=Sp\204na\201e"
#define TR_MEMORYWARNING "UpozNaPlnPam\203t" #define TR_MEMORYWARNING "UpozNaPlnPam\203t'"
#define TR_ALARMWARNING "UpozNaVypZvuk" #define TR_ALARMWARNING "UpozNaVypZvuk"
#define TR_TIMEZONE "\201asov\202 p\200smo" #define TR_TIMEZONE "\201asov\202 p\200smo"
#define TR_RXCHANNELORD "Po\206ad\204 Kan\200l\211" #define TR_RXCHANNELORD "Po\206ad\204 Kan\200l\211"
@@ -342,7 +342,7 @@
#define TR_ALERT "\003(!)POZOR" #define TR_ALERT "\003(!)POZOR"
#define TR_PRESSANYKEYTOSKIP "Kl\200vesa >>> p\206esko\201it" #define TR_PRESSANYKEYTOSKIP "Kl\200vesa >>> p\206esko\201it"
#define TR_THROTTLENOTIDLE "P\200ka plynu je pohnut\200." #define TR_THROTTLENOTIDLE "P\200ka plynu je pohnut\200."
#define TR_ALARMSDISABLED "Alarmy Zak\200z\200ny" #define TR_ALARMSDISABLED "Alarmy jsou zak\200z\200ny"
#define TR_PRESSANYKEY "\003Stiskni Kl\200vesu" #define TR_PRESSANYKEY "\003Stiskni Kl\200vesu"
#define TR_BADEEPROMDATA "\003Chyba dat EEprom" #define TR_BADEEPROMDATA "\003Chyba dat EEprom"
#define TR_EEPROMFORMATTING " Formatov\200n\204 EEPROM" #define TR_EEPROMFORMATTING " Formatov\200n\204 EEPROM"
@@ -392,8 +392,8 @@
#define TR_RESTORE_MODEL "Restore Model" #define TR_RESTORE_MODEL "Restore Model"
#define TR_SDCARD_ERROR "SDCARD Error" #define TR_SDCARD_ERROR "SDCARD Error"
#define TR_NO_SDCARD "No SDCARD" #define TR_NO_SDCARD "No SDCARD"
#define TR_WARNING "WARNING" #define TR_WARNING "KONTROLA"
#define TR_EEPROMWARN "EEPROM" #define TR_EEPROMWARN "EEPROM"
#define TR_THROTTLEWARN "THROTTLE" #define TR_THROTTLEWARN "PLYNU"
#define TR_ALARMSWARN "ALARMS" #define TR_ALARMSWARN "ALARMU"
#define TR_SWITCHWARN "SWITCH" #define TR_SWITCHWARN "POZICE"