mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 16:55:20 +03:00
Cosmetics
This commit is contained in:
parent
a043c6f649
commit
64966c7d7d
9 changed files with 57 additions and 57 deletions
|
@ -446,7 +446,7 @@ void Open9xSim::refreshDisplay()
|
||||||
{
|
{
|
||||||
if (simuLcdRefresh) {
|
if (simuLcdRefresh) {
|
||||||
simuLcdRefresh = false;
|
simuLcdRefresh = false;
|
||||||
FXColor offColor = isBacklightEnable() ? BL_COLOR : FXRGB(200, 200, 200);
|
FXColor offColor = isBacklightEnabled() ? BL_COLOR : FXRGB(200, 200, 200);
|
||||||
#if LCD_W == 128
|
#if LCD_W == 128
|
||||||
FXColor onColor = FXRGB(0, 0, 0);
|
FXColor onColor = FXRGB(0, 0, 0);
|
||||||
#endif
|
#endif
|
||||||
|
@ -477,7 +477,7 @@ void Open9xSim::refreshDisplay()
|
||||||
uint8_t z = (y & 1) ? (*p >> 4) : (*p & 0x0F);
|
uint8_t z = (y & 1) ? (*p >> 4) : (*p & 0x0F);
|
||||||
if (z) {
|
if (z) {
|
||||||
FXColor color;
|
FXColor color;
|
||||||
if (isBacklightEnable())
|
if (isBacklightEnabled())
|
||||||
color = FXRGB(47-(z*47)/15, 123-(z*123)/15, 227-(z*227)/15);
|
color = FXRGB(47-(z*47)/15, 123-(z*123)/15, 227-(z*227)/15);
|
||||||
else
|
else
|
||||||
color = FXRGB(200-(z*200)/15, 200-(z*200)/15, 200-(z*200)/15);
|
color = FXRGB(200-(z*200)/15, 200-(z*200)/15, 200-(z*200)/15);
|
||||||
|
|
|
@ -349,7 +349,7 @@ void backlightDisable()
|
||||||
bl_target = g_eeGeneral.blOffBright;
|
bl_target = g_eeGeneral.blOffBright;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isBacklightEnable()
|
bool isBacklightEnabled()
|
||||||
{
|
{
|
||||||
return (bl_target==g_eeGeneral.blOnBright);
|
return (bl_target==g_eeGeneral.blOnBright);
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,16 +143,16 @@ bool checkSlaveMode();
|
||||||
#if defined(PWM_BACKLIGHT)
|
#if defined(PWM_BACKLIGHT)
|
||||||
void backlightEnable();
|
void backlightEnable();
|
||||||
void backlightDisable();
|
void backlightDisable();
|
||||||
bool isBacklightEnable();
|
bool isBacklightEnabled();
|
||||||
void backlightFade();
|
void backlightFade();
|
||||||
#elif defined(SP22)
|
#elif defined(SP22)
|
||||||
#define backlightEnable() PORTB &= ~(1<<OUT_B_LIGHT)
|
#define backlightEnable() PORTB &= ~(1<<OUT_B_LIGHT)
|
||||||
#define backlightDisable() PORTB |= (1<<OUT_B_LIGHT)
|
#define backlightDisable() PORTB |= (1<<OUT_B_LIGHT)
|
||||||
#define isBacklightEnable() (~PORTB & (1<<OUT_B_LIGHT))
|
#define isBacklightEnabled() (~PORTB & (1<<OUT_B_LIGHT))
|
||||||
#else
|
#else
|
||||||
#define backlightEnable() PORTB |= (1<<OUT_B_LIGHT)
|
#define backlightEnable() PORTB |= (1<<OUT_B_LIGHT)
|
||||||
#define backlightDisable() PORTB &= ~(1<<OUT_B_LIGHT)
|
#define backlightDisable() PORTB &= ~(1<<OUT_B_LIGHT)
|
||||||
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
|
#define isBacklightEnabled() (PORTB & (1<<OUT_B_LIGHT))
|
||||||
#endif
|
#endif
|
||||||
#if defined(VOICE) && !defined(SIMU)
|
#if defined(VOICE) && !defined(SIMU)
|
||||||
#define BACKLIGHT_ENABLE() Voice.Backlight = 1
|
#define BACKLIGHT_ENABLE() Voice.Backlight = 1
|
||||||
|
|
|
@ -90,7 +90,7 @@ void sdPoll10ms();
|
||||||
#define OUT_C_LIGHT 0
|
#define OUT_C_LIGHT 0
|
||||||
#define backlightEnable() PORTC |= (1<<OUT_C_LIGHT)
|
#define backlightEnable() PORTC |= (1<<OUT_C_LIGHT)
|
||||||
#define backlightDisable() PORTC &= ~(1<<OUT_C_LIGHT)
|
#define backlightDisable() PORTC &= ~(1<<OUT_C_LIGHT)
|
||||||
#define isBacklightEnable() (PORTC & (1<<OUT_C_LIGHT))
|
#define isBacklightEnabled() (PORTC & (1<<OUT_C_LIGHT))
|
||||||
#define BACKLIGHT_ENABLE() backlightEnable()
|
#define BACKLIGHT_ENABLE() backlightEnable()
|
||||||
#define BACKLIGHT_DISABLE() backlightDisable()
|
#define BACKLIGHT_DISABLE() backlightDisable()
|
||||||
|
|
||||||
|
|
|
@ -352,7 +352,7 @@ void backlightEnable(uint8_t dutyCycle);
|
||||||
#endif
|
#endif
|
||||||
#define BACKLIGHT_ENABLE() backlightEnable(UNEXPECTED_SHUTDOWN() ? 100 : 100-g_eeGeneral.backlightBright)
|
#define BACKLIGHT_ENABLE() backlightEnable(UNEXPECTED_SHUTDOWN() ? 100 : 100-g_eeGeneral.backlightBright)
|
||||||
#define BACKLIGHT_DISABLE() backlightEnable(UNEXPECTED_SHUTDOWN() ? 100 : g_eeGeneral.blOffBright)
|
#define BACKLIGHT_DISABLE() backlightEnable(UNEXPECTED_SHUTDOWN() ? 100 : g_eeGeneral.blOffBright)
|
||||||
#define isBacklightEnable() true
|
#define isBacklightEnabled() true
|
||||||
|
|
||||||
// USB driver
|
// USB driver
|
||||||
int usbPlugged(void);
|
int usbPlugged(void);
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include "../common/avr/board_avr.h"
|
#include "../common/avr/board_avr.h"
|
||||||
|
|
||||||
//Mods for futur use ? Beta tester love it
|
//Mods for futur use ? Beta tester love it
|
||||||
//#define ROTENC_DIV2 // rotenc resolution/2
|
//#define ROTENC_DIV2 // rotenc resolution/2
|
||||||
|
|
||||||
// Board driver
|
// Board driver
|
||||||
|
@ -31,17 +31,17 @@ void boardInit(void);
|
||||||
#define boardOff() pwrOff()
|
#define boardOff() pwrOff()
|
||||||
|
|
||||||
// Keys
|
// Keys
|
||||||
#define KEYS_GPIO_REG_MENU pinl
|
#define KEYS_GPIO_REG_MENU pinl
|
||||||
#define KEYS_GPIO_PIN_MENU (1<<4)
|
#define KEYS_GPIO_PIN_MENU (1<<4)
|
||||||
#define KEYS_GPIO_REG_EXIT pinl
|
#define KEYS_GPIO_REG_EXIT pinl
|
||||||
#define KEYS_GPIO_PIN_EXIT (1<<5)
|
#define KEYS_GPIO_PIN_EXIT (1<<5)
|
||||||
#define KEYS_GPIO_REG_RIGHT pinl
|
#define KEYS_GPIO_REG_RIGHT pinl
|
||||||
#define KEYS_GPIO_PIN_RIGHT (1<<2)
|
#define KEYS_GPIO_PIN_RIGHT (1<<2)
|
||||||
#define KEYS_GPIO_REG_LEFT pinl
|
#define KEYS_GPIO_REG_LEFT pinl
|
||||||
#define KEYS_GPIO_PIN_LEFT (1<<3)
|
#define KEYS_GPIO_PIN_LEFT (1<<3)
|
||||||
#define KEYS_GPIO_REG_UP pinl
|
#define KEYS_GPIO_REG_UP pinl
|
||||||
#define KEYS_GPIO_PIN_UP (1<<1)
|
#define KEYS_GPIO_PIN_UP (1<<1)
|
||||||
#define KEYS_GPIO_REG_DOWN pinl
|
#define KEYS_GPIO_REG_DOWN pinl
|
||||||
#define KEYS_GPIO_PIN_DOWN (1<<0)
|
#define KEYS_GPIO_PIN_DOWN (1<<0)
|
||||||
|
|
||||||
// Trims
|
// Trims
|
||||||
|
@ -78,12 +78,12 @@ void boardInit(void);
|
||||||
// Backlight driver
|
// Backlight driver
|
||||||
#define backlightEnable() PORTC |= (1<<OUT_C_LIGHT)
|
#define backlightEnable() PORTC |= (1<<OUT_C_LIGHT)
|
||||||
#define backlightDisable() PORTC &= ~(1<<OUT_C_LIGHT)
|
#define backlightDisable() PORTC &= ~(1<<OUT_C_LIGHT)
|
||||||
#define isBacklightEnable() PORTC & (1<<OUT_C_LIGHT)
|
#define isBacklightEnabled() PORTC & (1<<OUT_C_LIGHT)
|
||||||
#define BACKLIGHT_ENABLE() backlightEnable()
|
#define BACKLIGHT_ENABLE() backlightEnable()
|
||||||
#define BACKLIGHT_DISABLE() backlightDisable()
|
#define BACKLIGHT_DISABLE() backlightDisable()
|
||||||
|
|
||||||
// SD driver
|
// SD driver
|
||||||
#define BLOCK_SIZE 512 /* Block Size in Bytes */
|
#define BLOCK_SIZE 512 /* Block Size in Bytes */
|
||||||
#define sdDone()
|
#define sdDone()
|
||||||
#define SD_IS_HC() (0)
|
#define SD_IS_HC() (0)
|
||||||
#define SD_GET_SPEED() (0)
|
#define SD_GET_SPEED() (0)
|
||||||
|
@ -94,60 +94,60 @@ void sdPoll10ms(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Switchs driver
|
// Switchs driver
|
||||||
#define INP_C_ID2 1
|
#define INP_C_ID2 1
|
||||||
#define INP_C_ID1 0
|
#define INP_C_ID1 0
|
||||||
#define INP_D_AileDR 7
|
#define INP_D_AileDR 7
|
||||||
#define INP_G_ThrCt 2
|
#define INP_G_ThrCt 2
|
||||||
#define INP_G_Gear 1
|
#define INP_G_Gear 1
|
||||||
#define INP_G_RuddDR 0
|
#define INP_G_RuddDR 0
|
||||||
#define INP_L_ElevDR 6
|
#define INP_L_ElevDR 6
|
||||||
#define INP_L_Trainer 7
|
#define INP_L_Trainer 7
|
||||||
|
|
||||||
// Servitudes driver
|
// Servitudes driver
|
||||||
#define INP_E_PPM_IN 7 //not used (reserved)
|
#define INP_E_PPM_IN 7 //not used (reserved)
|
||||||
#define INP_B_WTV_BUSY 7 //WTV20SD, not used (reserved)
|
#define INP_B_WTV_BUSY 7 //WTV20SD, not used (reserved)
|
||||||
#define OUT_B_PPM 6
|
#define OUT_B_PPM 6
|
||||||
#define OUT_B_SIM_CTL 5
|
#define OUT_B_SIM_CTL 5
|
||||||
#define OUT_B_BUZZER 4
|
#define OUT_B_BUZZER 4
|
||||||
#define INP_D_I2C_SCL 1
|
#define INP_D_I2C_SCL 1
|
||||||
#define INP_D_I2C_SDA 0
|
#define INP_D_I2C_SDA 0
|
||||||
#define OUT_E_WTV_DATA 3 //WTV20SD
|
#define OUT_E_WTV_DATA 3 //WTV20SD
|
||||||
#define INP_E_TELEM_RX 1
|
#define INP_E_TELEM_RX 1
|
||||||
#define OUT_E_TELEM_TX 0
|
#define OUT_E_TELEM_TX 0
|
||||||
#define OUT_G_WTV_CLK 5 //WTV20SD
|
#define OUT_G_WTV_CLK 5 //WTV20SD
|
||||||
#define INP_H_RF_Activated 6
|
#define INP_H_RF_Activated 6
|
||||||
#define INP_H_DSC_Activated 5 //not used, reserved for pwrCheck()
|
#define INP_H_DSC_Activated 5 //not used, reserved for pwrCheck()
|
||||||
#define INP_H_Hold_Power 4 //not used, reserved for pwrCheck()
|
#define INP_H_Hold_Power 4 //not used, reserved for pwrCheck()
|
||||||
#define OUT_H_Speaker 3
|
#define OUT_H_Speaker 3
|
||||||
#define OUT_H_WTV_RESET 1 //WTV20SD
|
#define OUT_H_WTV_RESET 1 //WTV20SD
|
||||||
#define OUT_H_HAPTIC 0
|
#define OUT_H_HAPTIC 0
|
||||||
|
|
||||||
// Rotary encoders driver
|
// Rotary encoders driver
|
||||||
#define INP_E_ROT_ENC_1_A 4
|
#define INP_E_ROT_ENC_1_A 4
|
||||||
#define INP_E_ROT_ENC_1_B 5
|
#define INP_E_ROT_ENC_1_B 5
|
||||||
#define INP_D_ROT_ENC_2_A 2
|
#define INP_D_ROT_ENC_2_A 2
|
||||||
#define INP_D_ROT_ENC_2_B 3
|
#define INP_D_ROT_ENC_2_B 3
|
||||||
#define INP_J_ROT_ENC_1_PUSH 0
|
#define INP_J_ROT_ENC_1_PUSH 0
|
||||||
#define INP_J_ROT_ENC_2_PUSH 1
|
#define INP_J_ROT_ENC_2_PUSH 1
|
||||||
#define REA_DOWN() (~PINJ & (1<<INP_J_ROT_ENC_1_PUSH))
|
#define REA_DOWN() (~PINJ & (1<<INP_J_ROT_ENC_1_PUSH))
|
||||||
#define REB_DOWN() (~PINJ & (1<<INP_J_ROT_ENC_2_PUSH))
|
#define REB_DOWN() (~PINJ & (1<<INP_J_ROT_ENC_2_PUSH))
|
||||||
#define ROTENC_DOWN() (REA_DOWN() || REB_DOWN())
|
#define ROTENC_DOWN() (REA_DOWN() || REB_DOWN())
|
||||||
|
|
||||||
// LCD driver
|
// LCD driver
|
||||||
#define PORTA_LCD_DAT PORTA
|
#define PORTA_LCD_DAT PORTA
|
||||||
#define PORTC_LCD_CTRL PORTC
|
#define PORTC_LCD_CTRL PORTC
|
||||||
#if defined(LCD_KS108) // (For KS108 LCd only) MEGA R/W pin always at 0 state in Opentx then
|
#if defined(LCD_KS108) // (For KS108 LCd only) MEGA R/W pin always at 0 state in Opentx then
|
||||||
#define OUT_C_LCD_CS2 6 // Use this pin to control second KS108
|
#define OUT_C_LCD_CS2 6 // Use this pin to control second KS108
|
||||||
#else // And connect LCD R/W pin to ground via a 1k resistor
|
#else // And connect LCD R/W pin to ground via a 1k resistor
|
||||||
#define OUT_C_LCD_RnW 6
|
#define OUT_C_LCD_RnW 6
|
||||||
#endif
|
#endif
|
||||||
#define OUT_C_LCD_E 7
|
#define OUT_C_LCD_E 7
|
||||||
#define OUT_C_LCD_A0 5
|
#define OUT_C_LCD_A0 5
|
||||||
#define OUT_C_LCD_RES 4
|
#define OUT_C_LCD_RES 4
|
||||||
#define OUT_C_LCD_CS1 3
|
#define OUT_C_LCD_CS1 3
|
||||||
#define OUT_C_LIGHT 2
|
#define OUT_C_LIGHT 2
|
||||||
|
|
||||||
// DBLKeys driver
|
// DBLKeys driver
|
||||||
#define KEYS_PRESSED() (~PINL)
|
#define KEYS_PRESSED() (~PINL)
|
||||||
|
|
||||||
// Power driver
|
// Power driver
|
||||||
|
|
|
@ -279,7 +279,7 @@ extern "C" {
|
||||||
// Backlight driver
|
// Backlight driver
|
||||||
#define backlightEnable() (PWM->PWM_CH_NUM[0].PWM_CDTY = g_eeGeneral.backlightBright)
|
#define backlightEnable() (PWM->PWM_CH_NUM[0].PWM_CDTY = g_eeGeneral.backlightBright)
|
||||||
#define backlightDisable() (PWM->PWM_CH_NUM[0].PWM_CDTY = 100)
|
#define backlightDisable() (PWM->PWM_CH_NUM[0].PWM_CDTY = 100)
|
||||||
#define isBacklightEnable() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
|
#define isBacklightEnabled() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
|
||||||
#define BACKLIGHT_ENABLE() backlightEnable()
|
#define BACKLIGHT_ENABLE() backlightEnable()
|
||||||
#define BACKLIGHT_DISABLE() backlightDisable()
|
#define BACKLIGHT_DISABLE() backlightDisable()
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ void backlightDisable()
|
||||||
BACKLIGHT_TIMER->CCR2 = 0;
|
BACKLIGHT_TIMER->CCR2 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t isBacklightEnable()
|
uint8_t isBacklightEnabled()
|
||||||
{
|
{
|
||||||
return (BACKLIGHT_TIMER->CCR1 != 0 || BACKLIGHT_TIMER->CCR2 != 0);
|
return (BACKLIGHT_TIMER->CCR1 != 0 || BACKLIGHT_TIMER->CCR2 != 0);
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ void backlightDisable()
|
||||||
BACKLIGHT_TIMER->CCR2 = 0;
|
BACKLIGHT_TIMER->CCR2 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t isBacklightEnable()
|
uint8_t isBacklightEnabled()
|
||||||
{
|
{
|
||||||
return (BACKLIGHT_TIMER->CCR4 != 0 || BACKLIGHT_TIMER->CCR2 != 0);
|
return (BACKLIGHT_TIMER->CCR4 != 0 || BACKLIGHT_TIMER->CCR2 != 0);
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ void backlightDisable()
|
||||||
BACKLIGHT_TIMER->CCR2 = 0;
|
BACKLIGHT_TIMER->CCR2 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t isBacklightEnable()
|
uint8_t isBacklightEnabled()
|
||||||
{
|
{
|
||||||
return BACKLIGHT_TIMER->CCR2 != 0;
|
return BACKLIGHT_TIMER->CCR2 != 0;
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ void backlightDisable()
|
||||||
BACKLIGHT_TIMER->CCR1 = 0;
|
BACKLIGHT_TIMER->CCR1 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t isBacklightEnable()
|
uint8_t isBacklightEnabled()
|
||||||
{
|
{
|
||||||
return BACKLIGHT_TIMER->CCR1 != 0;
|
return BACKLIGHT_TIMER->CCR1 != 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -404,7 +404,7 @@ uint32_t pwroffPressed(void);
|
||||||
void backlightInit(void);
|
void backlightInit(void);
|
||||||
void backlightDisable(void);
|
void backlightDisable(void);
|
||||||
#define BACKLIGHT_DISABLE() backlightDisable()
|
#define BACKLIGHT_DISABLE() backlightDisable()
|
||||||
uint8_t isBacklightEnable(void);
|
uint8_t isBacklightEnabled(void);
|
||||||
#if defined(PCBX9E) || defined(PCBX9DP)
|
#if defined(PCBX9E) || defined(PCBX9DP)
|
||||||
void backlightEnable(uint8_t level, uint8_t color);
|
void backlightEnable(uint8_t level, uint8_t color);
|
||||||
#define BACKLIGHT_ENABLE() backlightEnable(g_eeGeneral.backlightBright, g_eeGeneral.backlightColor)
|
#define BACKLIGHT_ENABLE() backlightEnable(g_eeGeneral.backlightBright, g_eeGeneral.backlightColor)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue