diff --git a/src/Makefile b/src/Makefile index e5c8ad7dc..d0776f561 100644 --- a/src/Makefile +++ b/src/Makefile @@ -184,6 +184,11 @@ ifeq ($(PCB), STD) ifeq ($(EXT), FRSKY) CPPDEFS += -DFRSKY -DFRSKY_HUB endif + +# If FRSKY-Support is enabled + ifeq ($(EXT), FRSKY_NOHUB) + CPPDEFS += -DFRSKY + endif # gruvin: If buzzer speaker replacment supported ifeq ($(BEEPER), SPEAKER) diff --git a/src/frsky.cpp b/src/frsky.cpp index 332d350da..5a56c7bd6 100644 --- a/src/frsky.cpp +++ b/src/frsky.cpp @@ -308,10 +308,9 @@ ISR(USART0_RX_vect) } /* - USART0 (transmit) Data Register Emtpy ISR - Usef to transmit FrSky data packets, which are buffered in frskyTXBuffer. + USART0 Transmit Data Register Emtpy ISR + Used to transmit FrSky data packets */ - ISR(USART0_UDRE_vect) { if (frskyTxBufferCount > 0) { @@ -395,24 +394,10 @@ inline void FRSKY_EnableTXD(void) inline void FRSKY_EnableRXD(void) { - UCSR0B |= (1 << RXEN0); // enable RX UCSR0B |= (1 << RXCIE0); // enable Interrupt } -#if 0 -void FRSKY_DisableTXD(void) -{ - UCSR0B &= ~((1 << TXEN0) | (1 << UDRIE0)); // disable TX pin and interrupt -} - -void FRSKY_DisableRXD(void) -{ - UCSR0B &= ~(1 << RXEN0); // disable RX - UCSR0B &= ~(1 << RXCIE0); // disable Interrupt -} -#endif - void FRSKY_Init(void) { // clear frsky variables @@ -431,7 +416,7 @@ void FRSKY_Init(void) UBRR0L = UBRRL_VALUE; UCSR0A &= ~(1 << U2X0); // disable double speed operation. - // set 8 N1 + // set 8N1 UCSR0B = 0 | (0 << RXCIE0) | (0 << TXCIE0) | (0 << UDRIE0) | (0 << RXEN0) | (0 << TXEN0) | (0 << UCSZ02); UCSR0C = 0 | (1 << UCSZ01) | (1 << UCSZ00); diff --git a/src/main_views.cpp b/src/main_views.cpp index 11a02badb..7f67532f5 100644 --- a/src/main_views.cpp +++ b/src/main_views.cpp @@ -39,8 +39,10 @@ uint8_t tabViews[] = { 1, /*e_outputBars*/ 3, /*e_inputs*/ 1, /*e_timer2*/ -#ifdef FRSKY +#if defined(FRSKY_HUB) 4, /*e_telemetry*/ +#elif defined(FRSKY) + 2, /*e_telemetry*/ #endif }; @@ -168,8 +170,8 @@ void menuMainView(uint8_t event) uint8_t att = (g_vbat100mV < g_eeGeneral.vBatWarn ? BLINK : 0) | DBLSIZE; putsModelName(2*FW-2, 0*FH, g_model.name, g_eeGeneral.currModel, DBLSIZE); - putsVBat(6*FW+1, 2*FH, att|NO_UNIT); - lcd_putc(6*FW+2, 3*FH, 'V'); + putsVBat(6*FW-1, 2*FH, att|NO_UNIT); + lcd_putc(6*FW, 3*FH, 'V'); if (s_timerState != TMR_OFF) { uint8_t att = DBLSIZE | (s_timerState==TMR_BEEPING ? BLINK : 0); @@ -342,14 +344,14 @@ void menuMainView(uint8_t event) } #ifdef FRSKY_HUB else if (g_eeGeneral.view == e_telemetry+2*ALTERNATE) { // if on second alternate telemetry view - // date + // Date lcd_outdezNAtt(1*FW, 1*FH, frskyHubData.year+2000, LEFT, 4); lcd_putc(lcd_lastPos, 1*FH, '-'); lcd_outdezNAtt(lcd_lastPos+FW, 1*FH, frskyHubData.month, LEFT|LEADING0, 2); lcd_putc(lcd_lastPos, 1*FH, '-'); lcd_outdezNAtt(lcd_lastPos+FW, 1*FH, frskyHubData.day, LEFT|LEADING0, 2); - // time + // Time lcd_outdezNAtt(FW*10+8, 1*FH, frskyHubData.hour, LEFT|LEADING0, 2); lcd_putc(lcd_lastPos, 1*FH, ':'); lcd_outdezNAtt(lcd_lastPos+FW, 1*FH, frskyHubData.min, LEFT|LEADING0, 2); @@ -505,7 +507,7 @@ void menuMainView(uint8_t event) for( x = -5, y = 4 ; y < 7 ; x += 5, y += 1 ) { len = ((calibratedStick[y]+RESX)*BAR_HEIGHT/(RESX*2))+1l ; // calculate once per loop - V_BAR(SCREEN_WIDTH/2+x,SCREEN_HEIGHT-10, len ) + V_BAR(SCREEN_WIDTH/2+x,SCREEN_HEIGHT-8, len ) } } diff --git a/src/myeeprom.h b/src/myeeprom.h index f6332e0d5..b923d7cfa 100644 --- a/src/myeeprom.h +++ b/src/myeeprom.h @@ -41,7 +41,7 @@ #define EEPROM_VER_r584 3 #define EEPROM_VER_r751 5 -#define EEPROM_VER 105 // TODO make it 201 +#define EEPROM_VER 106 // TODO make it 201 typedef struct t_TrainerMix { uint8_t srcChn:6; // 0-7 = ch1-8 @@ -201,8 +201,8 @@ typedef struct t_PhaseData { #define TRIM_EXTENDED_MIN (-TRIM_EXTENDED_MAX) #define TRIM_MAX 125 #define TRIM_MIN (-TRIM_MAX) - int8_t trim[4]; // -125..125 => trim value, 127 => use trim of phase 0, -128, -127, -126 => use trim of phases 1|2|3|4 instead - int8_t trim_ext:8; + int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead + int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims) int8_t swtch; // swtch of phase[0] is not used char name[6]; uint8_t fadeIn:4;