CZ translations update - warnings
This commit is contained in:
+203
-203
@@ -52,9 +52,9 @@ EEGeneral g_eeGeneral;
|
||||
ModelData g_model;
|
||||
|
||||
#if !defined(PCBARM)
|
||||
uint8_t g_tmr1Latency_max;
|
||||
uint8_t g_tmr1Latency_max;
|
||||
uint8_t g_tmr1Latency_min;
|
||||
#endif
|
||||
#endif
|
||||
uint16_t g_timeMain;
|
||||
#ifdef DEBUG
|
||||
uint16_t g_time_per10;
|
||||
@@ -321,12 +321,12 @@ int16_t Expo::expo(int16_t x)
|
||||
#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
|
||||
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;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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++) {
|
||||
if (phase == 0) return 0;
|
||||
@@ -961,7 +961,7 @@ void message(const pm_char *title, const pm_char *t, const char *last)
|
||||
#else
|
||||
lcd_putsAtt(0, 0, PSTR("(!)"), DBLSIZE);
|
||||
#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, 2*FH, title, DBLSIZE);
|
||||
#else
|
||||
@@ -987,7 +987,7 @@ uint8_t checkTrim(uint8_t event)
|
||||
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
|
||||
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);
|
||||
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);
|
||||
@@ -1161,26 +1161,26 @@ void getADC_filt()
|
||||
|
||||
void getADC_osmp()
|
||||
{
|
||||
uint16_t temp_ana;
|
||||
|
||||
for (uint8_t adc_input=0; adc_input<8; adc_input++) {
|
||||
temp_ana = 0;
|
||||
ADMUX = adc_input|ADC_VREF_TYPE;
|
||||
uint16_t temp_ana;
|
||||
|
||||
for (uint8_t adc_input=0; adc_input<8; adc_input++) {
|
||||
temp_ana = 0;
|
||||
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
|
||||
// Start the AD conversion
|
||||
ADCSRA|=0x40;
|
||||
// Wait for the AD conversion to complete
|
||||
while ((ADCSRA & 0x10)==0);
|
||||
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()
|
||||
{
|
||||
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;
|
||||
// Start the AD conversion
|
||||
ADCSRA|=0x40;
|
||||
@@ -1192,7 +1192,7 @@ void getADC_single()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if not defined(PCBARM)
|
||||
#if not defined(PCBARM)
|
||||
void getADC_bandgap()
|
||||
{
|
||||
#if defined (PCBV4)
|
||||
@@ -1316,7 +1316,7 @@ int32_t act [MAX_MIXERS] = {0};
|
||||
uint8_t swOn [MAX_MIXERS] = {0};
|
||||
uint8_t mixWarning;
|
||||
|
||||
FORCEINLINE void evalTrims()
|
||||
FORCEINLINE void evalTrims()
|
||||
{
|
||||
uint8_t phase = s_perout_flight_phase;
|
||||
for (uint8_t i=0; i<NUM_STICKS; i++) {
|
||||
@@ -1325,10 +1325,10 @@ FORCEINLINE void evalTrims()
|
||||
int32_t vv = 2*RESX;
|
||||
int16_t trim = getTrimValue(phase, i);
|
||||
if (i==THR_STICK && g_model.thrTrim) {
|
||||
if (g_eeGeneral.throttleReversed)
|
||||
if (g_eeGeneral.throttleReversed)
|
||||
trim = -trim;
|
||||
int16_t v = anas[i];
|
||||
vv = ((int32_t)trim-TRIM_MIN)*(RESX-v)/(2*RESX);
|
||||
int16_t v = anas[i];
|
||||
vv = ((int32_t)trim-TRIM_MIN)*(RESX-v)/(2*RESX);
|
||||
}
|
||||
else if (trimsCheckTimer > 0) {
|
||||
trim = 0;
|
||||
@@ -1347,7 +1347,7 @@ enum PerOutMode {
|
||||
|
||||
uint8_t s_perout_mode = e_perout_mode_normal;
|
||||
|
||||
BeepANACenter evalSticks()
|
||||
BeepANACenter evalSticks()
|
||||
{
|
||||
BeepANACenter anaCenter = 0;
|
||||
|
||||
@@ -1385,10 +1385,10 @@ BeepANACenter evalSticks()
|
||||
|
||||
if(v < -RESX) v = -RESX;
|
||||
if(v > RESX) v = RESX;
|
||||
|
||||
if (g_eeGeneral.throttleReversed && ch==THR_STICK)
|
||||
v = -v;
|
||||
|
||||
|
||||
if (g_eeGeneral.throttleReversed && ch==THR_STICK)
|
||||
v = -v;
|
||||
|
||||
if (i < NUM_STICKS+NUM_POTS)
|
||||
calibratedStick[ch] = v; //for show in expo
|
||||
|
||||
@@ -1421,17 +1421,17 @@ BeepANACenter evalSticks()
|
||||
}
|
||||
|
||||
/* EXPOs */
|
||||
applyExpos(anas);
|
||||
applyExpos(anas);
|
||||
|
||||
/* TRIMs */
|
||||
evalTrims();
|
||||
evalTrims();
|
||||
|
||||
return anaCenter;
|
||||
}
|
||||
|
||||
#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()
|
||||
{
|
||||
@@ -1549,9 +1549,9 @@ void evalFunctions()
|
||||
}
|
||||
|
||||
uint8_t s_perout_flight_phase;
|
||||
void perOut()
|
||||
void perOut()
|
||||
{
|
||||
BeepANACenter anaCenter = evalSticks();
|
||||
BeepANACenter anaCenter = evalSticks();
|
||||
|
||||
if (s_perout_mode == e_perout_mode_normal) {
|
||||
//===========BEEP CENTER================
|
||||
@@ -1798,9 +1798,9 @@ void perOut()
|
||||
mixWarning = lv_mixWarning;
|
||||
}
|
||||
|
||||
#ifdef DISPLAY_USER_DATA
|
||||
char userDataDisplayBuf[TELEM_SCREEN_BUFFER_SIZE];
|
||||
#endif
|
||||
#ifdef DISPLAY_USER_DATA
|
||||
char userDataDisplayBuf[TELEM_SCREEN_BUFFER_SIZE];
|
||||
#endif
|
||||
|
||||
#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)
|
||||
@@ -1808,7 +1808,7 @@ char userDataDisplayBuf[TELEM_SCREEN_BUFFER_SIZE];
|
||||
#define TIME_TO_WRITE s_eeDirtyMsk
|
||||
#endif
|
||||
|
||||
int32_t sum_chans512[NUM_CHNOUT] = {0};
|
||||
int32_t sum_chans512[NUM_CHNOUT] = {0};
|
||||
void perMain()
|
||||
{
|
||||
static uint16_t lastTMR;
|
||||
@@ -1817,51 +1817,51 @@ void perMain()
|
||||
lastTMR = tmr10ms;
|
||||
|
||||
#define MAX_ACT 0xffff
|
||||
static uint16_t fp_act[MAX_PHASES] = {0};
|
||||
static uint16_t delta = 0;
|
||||
static uint8_t s_fade_flight_phases = 0;
|
||||
static uint16_t fp_act[MAX_PHASES] = {0};
|
||||
static uint16_t delta = 0;
|
||||
static uint8_t s_fade_flight_phases = 0;
|
||||
static uint8_t s_last_phase = 255;
|
||||
uint8_t phase = getFlightPhase();
|
||||
int32_t weight = 0;
|
||||
|
||||
if (s_last_phase != phase) {
|
||||
if (s_last_phase == 255) {
|
||||
fp_act[phase] = MAX_ACT;
|
||||
if (s_last_phase != phase) {
|
||||
if (s_last_phase == 255) {
|
||||
fp_act[phase] = MAX_ACT;
|
||||
}
|
||||
else {
|
||||
uint8_t fadeTime = max(g_model.phaseData[s_last_phase].fadeOut, g_model.phaseData[phase].fadeIn);
|
||||
else {
|
||||
uint8_t fadeTime = max(g_model.phaseData[s_last_phase].fadeOut, g_model.phaseData[phase].fadeIn);
|
||||
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;
|
||||
}
|
||||
else {
|
||||
fp_act[s_last_phase] = 0;
|
||||
fp_act[phase] = MAX_ACT;
|
||||
s_fade_flight_phases &= ~((1<<s_last_phase) + (1<<phase));
|
||||
}
|
||||
}
|
||||
s_last_phase = phase;
|
||||
}
|
||||
}
|
||||
else {
|
||||
fp_act[s_last_phase] = 0;
|
||||
fp_act[phase] = MAX_ACT;
|
||||
s_fade_flight_phases &= ~((1<<s_last_phase) + (1<<phase));
|
||||
}
|
||||
}
|
||||
s_last_phase = phase;
|
||||
}
|
||||
|
||||
if (s_fade_flight_phases) {
|
||||
memset(sum_chans512, 0, sizeof(sum_chans512));
|
||||
memset(sum_chans512, 0, sizeof(sum_chans512));
|
||||
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)) {
|
||||
s_perout_flight_phase = p;
|
||||
perOut();
|
||||
for (uint8_t i=0; i<NUM_CHNOUT; i++)
|
||||
sum_chans512[i] += (chans[i] / 16) * fp_act[p];
|
||||
weight += fp_act[p];
|
||||
}
|
||||
}
|
||||
// printf("sum=%d, weight=%d ", sum_chans512[2], weight); fflush(stdout);
|
||||
weight += fp_act[p];
|
||||
}
|
||||
}
|
||||
// printf("sum=%d, weight=%d ", sum_chans512[2], weight); fflush(stdout);
|
||||
assert(weight);
|
||||
s_perout_flight_phase = phase;
|
||||
s_perout_flight_phase = phase;
|
||||
}
|
||||
else {
|
||||
s_perout_flight_phase = phase;
|
||||
perOut();
|
||||
perOut();
|
||||
}
|
||||
|
||||
//========== LIMITS ===============
|
||||
@@ -2056,27 +2056,27 @@ void perMain()
|
||||
}
|
||||
// Timers end
|
||||
|
||||
if (s_fade_flight_phases) {
|
||||
for (uint8_t p=0; p<MAX_PHASES; p++) {
|
||||
if (s_fade_flight_phases & (1<<p)) {
|
||||
if (p == phase) {
|
||||
if (MAX_ACT - fp_act[p] > delta)
|
||||
fp_act[p] += delta;
|
||||
else {
|
||||
fp_act[p] = MAX_ACT;
|
||||
s_fade_flight_phases -= (1<<p);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (fp_act[p] > delta)
|
||||
fp_act[p] -= delta;
|
||||
else {
|
||||
fp_act[p] = 0;
|
||||
s_fade_flight_phases -= (1<<p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (s_fade_flight_phases) {
|
||||
for (uint8_t p=0; p<MAX_PHASES; p++) {
|
||||
if (s_fade_flight_phases & (1<<p)) {
|
||||
if (p == phase) {
|
||||
if (MAX_ACT - fp_act[p] > delta)
|
||||
fp_act[p] += delta;
|
||||
else {
|
||||
fp_act[p] = MAX_ACT;
|
||||
s_fade_flight_phases -= (1<<p);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (fp_act[p] > delta)
|
||||
fp_act[p] -= delta;
|
||||
else {
|
||||
fp_act[p] = 0;
|
||||
s_fade_flight_phases -= (1<<p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
evalFunctions();
|
||||
@@ -2099,33 +2099,33 @@ void perMain()
|
||||
#if defined(PCBV4) && defined(SDCARD)
|
||||
writeLogs();
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(FRSKY) && defined(DISPLAY_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,
|
||||
// scrolling at the 21 character mark (edge of screen)
|
||||
uint8_t numbytes = frskyGetUserData(userDataRxBuffer, 21); // Get as many bytes as we can
|
||||
|
||||
static uint8_t displayBufferIndex;
|
||||
for (uint8_t byt=0; byt < numbytes; byt++)
|
||||
{
|
||||
displayBufferIndex++;
|
||||
if (displayBufferIndex > 20)
|
||||
{
|
||||
for (int xx=0; xx<20; xx++) // scroll one char left
|
||||
userDataDisplayBuf[xx] = userDataDisplayBuf[xx+1];
|
||||
displayBufferIndex = 20;
|
||||
}
|
||||
userDataDisplayBuf[displayBufferIndex] = userDataRxBuffer[byt];
|
||||
|
||||
// Write the raw byte out to log file, if open
|
||||
if (testLogOpen && (g_oLogFile.fs != 0))
|
||||
f_putc(userDataRxBuffer[byt], &g_oLogFile);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
char userDataRxBuffer[21]; // Temp buffer used to collect fr-sky user data
|
||||
|
||||
// retrieve bytes from user data buffer and insert into display string,
|
||||
// scrolling at the 21 character mark (edge of screen)
|
||||
uint8_t numbytes = frskyGetUserData(userDataRxBuffer, 21); // Get as many bytes as we can
|
||||
|
||||
static uint8_t displayBufferIndex;
|
||||
for (uint8_t byt=0; byt < numbytes; byt++)
|
||||
{
|
||||
displayBufferIndex++;
|
||||
if (displayBufferIndex > 20)
|
||||
{
|
||||
for (int xx=0; xx<20; xx++) // scroll one char left
|
||||
userDataDisplayBuf[xx] = userDataDisplayBuf[xx+1];
|
||||
displayBufferIndex = 20;
|
||||
}
|
||||
userDataDisplayBuf[displayBufferIndex] = userDataRxBuffer[byt];
|
||||
|
||||
// Write the raw byte out to log file, if open
|
||||
if (testLogOpen && (g_oLogFile.fs != 0))
|
||||
f_putc(userDataRxBuffer[byt], &g_oLogFile);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
lcd_clear();
|
||||
uint8_t evt = getEvent();
|
||||
evt = checkTrim(evt);
|
||||
@@ -2153,23 +2153,23 @@ void perMain()
|
||||
else {
|
||||
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? ...
|
||||
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
|
||||
}
|
||||
else{
|
||||
PORTG |= (1<<OUT_G_SIM_CTL); // 1=ppm-in
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
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),
|
||||
// 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.)
|
||||
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;
|
||||
|
||||
uint16_t capture=ICR3;
|
||||
|
||||
// Prevent rentrance for this IRQ only
|
||||
// Prevent rentrance for this IRQ only
|
||||
#if defined (PCBV4)
|
||||
TIMSK3 &= ~(1<<ICIE3);
|
||||
#else
|
||||
ETIMSK &= ~(1<<TICIE3);
|
||||
#endif
|
||||
sei(); // enable other interrupts
|
||||
sei(); // enable other interrupts
|
||||
|
||||
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
|
||||
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
|
||||
else
|
||||
{
|
||||
@@ -2352,7 +2352,7 @@ ISR(TIMER3_CAPT_vect) // G: High frequency noise can cause stack overflo with IS
|
||||
|
||||
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)
|
||||
TIMSK3 |= (1<<ICIE3);
|
||||
#else
|
||||
@@ -2392,55 +2392,55 @@ extern uint16_t g_timeMain;
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
USART0 Transmit Data Register Emtpy ISR
|
||||
Used to transmit FrSky data packets and DSM2 protocol
|
||||
*/
|
||||
/*
|
||||
USART0 Transmit Data Register Emtpy ISR
|
||||
Used to transmit FrSky data packets and DSM2 protocol
|
||||
*/
|
||||
|
||||
// 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 (pulses2MHzRPtr == pulses2MHzWPtr) {
|
||||
UCSR0B &= ~(1 << UDRIE0); // disable UDRE0 interrupt
|
||||
}
|
||||
}
|
||||
#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
|
||||
#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 (pulses2MHzRPtr == pulses2MHzWPtr) {
|
||||
UCSR0B &= ~(1 << UDRIE0); // disable UDRE0 interrupt
|
||||
}
|
||||
}
|
||||
#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
|
||||
|
||||
void instantTrim()
|
||||
@@ -2448,9 +2448,9 @@ void instantTrim()
|
||||
for (uint8_t i=0; i<NUM_STICKS; i++) {
|
||||
if (i!=THR_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;
|
||||
evalSticks();
|
||||
evalSticks();
|
||||
s_perout_mode = e_perout_mode_normal;
|
||||
int16_t trim = (anas[i] + trims[i]) / 2;
|
||||
if (trim < TRIM_EXTENDED_MIN) {
|
||||
@@ -2506,40 +2506,40 @@ void moveTrimsToOffsets() // copy state of 3 primary to subtrim
|
||||
AUDIO_WARNING2();
|
||||
}
|
||||
|
||||
#if defined (PCBV4)
|
||||
// Rotary encoder interrupts
|
||||
#if defined (PCBV4)
|
||||
// Rotary encoder interrupts
|
||||
volatile uint8_t g_rotenc[2] = {0};
|
||||
#endif
|
||||
|
||||
#ifndef SIMU
|
||||
#ifndef SIMU
|
||||
|
||||
#if defined (PCBV4)
|
||||
#if !defined(EXTRA_ROTARY_ENCODERS)
|
||||
ISR(INT2_vect)
|
||||
{
|
||||
uint8_t input = PIND & 0b00001100;
|
||||
if (input == 0 || input == 0b00001100) incRotaryEncoder(0, -1);
|
||||
}
|
||||
ISR(INT3_vect)
|
||||
{
|
||||
uint8_t input = PIND & 0b00001100;
|
||||
if (input == 0 || input == 0b00001100) incRotaryEncoder(0, +1);
|
||||
}
|
||||
#endif //EXTRA_ROTARY_ENCODERS
|
||||
|
||||
ISR(INT5_vect)
|
||||
{
|
||||
uint8_t input = PINE & 0b01100000;
|
||||
if (input == 0 || input == 0b01100000) incRotaryEncoder(1, +1);
|
||||
}
|
||||
ISR(INT6_vect)
|
||||
{
|
||||
uint8_t input = PINE & 0b01100000;
|
||||
if (input == 0 || input == 0b01100000) incRotaryEncoder(1, -1);
|
||||
}
|
||||
ISR(INT2_vect)
|
||||
{
|
||||
uint8_t input = PIND & 0b00001100;
|
||||
if (input == 0 || input == 0b00001100) incRotaryEncoder(0, -1);
|
||||
}
|
||||
ISR(INT3_vect)
|
||||
{
|
||||
uint8_t input = PIND & 0b00001100;
|
||||
if (input == 0 || input == 0b00001100) incRotaryEncoder(0, +1);
|
||||
}
|
||||
#endif //EXTRA_ROTARY_ENCODERS
|
||||
|
||||
ISR(INT5_vect)
|
||||
{
|
||||
uint8_t input = PINE & 0b01100000;
|
||||
if (input == 0 || input == 0b01100000) incRotaryEncoder(1, +1);
|
||||
}
|
||||
ISR(INT6_vect)
|
||||
{
|
||||
uint8_t input = PINE & 0b01100000;
|
||||
if (input == 0 || input == 0b01100000) incRotaryEncoder(1, -1);
|
||||
}
|
||||
#endif //PCBV4
|
||||
|
||||
#if !defined(PCBARM)
|
||||
#if !defined(PCBARM)
|
||||
extern unsigned char __bss_end ;
|
||||
|
||||
uint16_t stack_free()
|
||||
@@ -2584,16 +2584,16 @@ int main(void)
|
||||
|
||||
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)
|
||||
FRSKY_Init();
|
||||
#endif
|
||||
|
||||
#if defined (DSM2_SERIAL) and !defined (FRSKY)
|
||||
DSM2_Init();
|
||||
#endif
|
||||
|
||||
#if defined (DSM2_SERIAL) and !defined (FRSKY)
|
||||
DSM2_Init();
|
||||
#endif
|
||||
|
||||
#ifdef JETI
|
||||
JETI_Init();
|
||||
#endif
|
||||
@@ -2657,7 +2657,7 @@ int main(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
clearKeyEvents(); //make sure no keys are down before proceeding
|
||||
clearKeyEvents(); //make sure no keys are down before proceeding
|
||||
|
||||
lcdSetRefVolt(g_eeGeneral.contrast);
|
||||
g_LightOffCounter = g_eeGeneral.lightAutoOff*500; //turn on light for x seconds - no need to press key Issue 152
|
||||
|
||||
Reference in New Issue
Block a user