mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 17:25:13 +03:00
Many details commited
This commit is contained in:
parent
c1e7fba8d9
commit
807e76f112
4 changed files with 19 additions and 27 deletions
|
@ -185,6 +185,11 @@ ifeq ($(PCB), STD)
|
||||||
CPPDEFS += -DFRSKY -DFRSKY_HUB
|
CPPDEFS += -DFRSKY -DFRSKY_HUB
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# If FRSKY-Support is enabled
|
||||||
|
ifeq ($(EXT), FRSKY_NOHUB)
|
||||||
|
CPPDEFS += -DFRSKY
|
||||||
|
endif
|
||||||
|
|
||||||
# gruvin: If buzzer speaker replacment supported
|
# gruvin: If buzzer speaker replacment supported
|
||||||
ifeq ($(BEEPER), SPEAKER)
|
ifeq ($(BEEPER), SPEAKER)
|
||||||
CPPDEFS += -DBEEPSPKR
|
CPPDEFS += -DBEEPSPKR
|
||||||
|
|
|
@ -308,10 +308,9 @@ ISR(USART0_RX_vect)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
USART0 (transmit) Data Register Emtpy ISR
|
USART0 Transmit Data Register Emtpy ISR
|
||||||
Usef to transmit FrSky data packets, which are buffered in frskyTXBuffer.
|
Used to transmit FrSky data packets
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ISR(USART0_UDRE_vect)
|
ISR(USART0_UDRE_vect)
|
||||||
{
|
{
|
||||||
if (frskyTxBufferCount > 0) {
|
if (frskyTxBufferCount > 0) {
|
||||||
|
@ -395,24 +394,10 @@ inline void FRSKY_EnableTXD(void)
|
||||||
|
|
||||||
inline void FRSKY_EnableRXD(void)
|
inline void FRSKY_EnableRXD(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
UCSR0B |= (1 << RXEN0); // enable RX
|
UCSR0B |= (1 << RXEN0); // enable RX
|
||||||
UCSR0B |= (1 << RXCIE0); // enable Interrupt
|
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)
|
void FRSKY_Init(void)
|
||||||
{
|
{
|
||||||
// clear frsky variables
|
// clear frsky variables
|
||||||
|
@ -431,7 +416,7 @@ void FRSKY_Init(void)
|
||||||
UBRR0L = UBRRL_VALUE;
|
UBRR0L = UBRRL_VALUE;
|
||||||
UCSR0A &= ~(1 << U2X0); // disable double speed operation.
|
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);
|
UCSR0B = 0 | (0 << RXCIE0) | (0 << TXCIE0) | (0 << UDRIE0) | (0 << RXEN0) | (0 << TXEN0) | (0 << UCSZ02);
|
||||||
UCSR0C = 0 | (1 << UCSZ01) | (1 << UCSZ00);
|
UCSR0C = 0 | (1 << UCSZ01) | (1 << UCSZ00);
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,10 @@ uint8_t tabViews[] = {
|
||||||
1, /*e_outputBars*/
|
1, /*e_outputBars*/
|
||||||
3, /*e_inputs*/
|
3, /*e_inputs*/
|
||||||
1, /*e_timer2*/
|
1, /*e_timer2*/
|
||||||
#ifdef FRSKY
|
#if defined(FRSKY_HUB)
|
||||||
4, /*e_telemetry*/
|
4, /*e_telemetry*/
|
||||||
|
#elif defined(FRSKY)
|
||||||
|
2, /*e_telemetry*/
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -168,8 +170,8 @@ void menuMainView(uint8_t event)
|
||||||
|
|
||||||
uint8_t att = (g_vbat100mV < g_eeGeneral.vBatWarn ? BLINK : 0) | DBLSIZE;
|
uint8_t att = (g_vbat100mV < g_eeGeneral.vBatWarn ? BLINK : 0) | DBLSIZE;
|
||||||
putsModelName(2*FW-2, 0*FH, g_model.name, g_eeGeneral.currModel, DBLSIZE);
|
putsModelName(2*FW-2, 0*FH, g_model.name, g_eeGeneral.currModel, DBLSIZE);
|
||||||
putsVBat(6*FW+1, 2*FH, att|NO_UNIT);
|
putsVBat(6*FW-1, 2*FH, att|NO_UNIT);
|
||||||
lcd_putc(6*FW+2, 3*FH, 'V');
|
lcd_putc(6*FW, 3*FH, 'V');
|
||||||
|
|
||||||
if (s_timerState != TMR_OFF) {
|
if (s_timerState != TMR_OFF) {
|
||||||
uint8_t att = DBLSIZE | (s_timerState==TMR_BEEPING ? BLINK : 0);
|
uint8_t att = DBLSIZE | (s_timerState==TMR_BEEPING ? BLINK : 0);
|
||||||
|
@ -342,14 +344,14 @@ void menuMainView(uint8_t event)
|
||||||
}
|
}
|
||||||
#ifdef FRSKY_HUB
|
#ifdef FRSKY_HUB
|
||||||
else if (g_eeGeneral.view == e_telemetry+2*ALTERNATE) { // if on second alternate telemetry view
|
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_outdezNAtt(1*FW, 1*FH, frskyHubData.year+2000, LEFT, 4);
|
||||||
lcd_putc(lcd_lastPos, 1*FH, '-');
|
lcd_putc(lcd_lastPos, 1*FH, '-');
|
||||||
lcd_outdezNAtt(lcd_lastPos+FW, 1*FH, frskyHubData.month, LEFT|LEADING0, 2);
|
lcd_outdezNAtt(lcd_lastPos+FW, 1*FH, frskyHubData.month, LEFT|LEADING0, 2);
|
||||||
lcd_putc(lcd_lastPos, 1*FH, '-');
|
lcd_putc(lcd_lastPos, 1*FH, '-');
|
||||||
lcd_outdezNAtt(lcd_lastPos+FW, 1*FH, frskyHubData.day, LEFT|LEADING0, 2);
|
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_outdezNAtt(FW*10+8, 1*FH, frskyHubData.hour, LEFT|LEADING0, 2);
|
||||||
lcd_putc(lcd_lastPos, 1*FH, ':');
|
lcd_putc(lcd_lastPos, 1*FH, ':');
|
||||||
lcd_outdezNAtt(lcd_lastPos+FW, 1*FH, frskyHubData.min, LEFT|LEADING0, 2);
|
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 )
|
for( x = -5, y = 4 ; y < 7 ; x += 5, y += 1 )
|
||||||
{
|
{
|
||||||
len = ((calibratedStick[y]+RESX)*BAR_HEIGHT/(RESX*2))+1l ; // calculate once per loop
|
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 )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
#define EEPROM_VER_r584 3
|
#define EEPROM_VER_r584 3
|
||||||
#define EEPROM_VER_r751 5
|
#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 {
|
typedef struct t_TrainerMix {
|
||||||
uint8_t srcChn:6; // 0-7 = ch1-8
|
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_EXTENDED_MIN (-TRIM_EXTENDED_MAX)
|
||||||
#define TRIM_MAX 125
|
#define TRIM_MAX 125
|
||||||
#define TRIM_MIN (-TRIM_MAX)
|
#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[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;
|
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
|
||||||
int8_t swtch; // swtch of phase[0] is not used
|
int8_t swtch; // swtch of phase[0] is not used
|
||||||
char name[6];
|
char name[6];
|
||||||
uint8_t fadeIn:4;
|
uint8_t fadeIn:4;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue