Cosmetics

This commit is contained in:
Damjan Adamic
2016-08-21 19:18:49 +02:00
parent a043c6f649
commit 64966c7d7d
9 changed files with 57 additions and 57 deletions
+2 -2
View File
@@ -446,7 +446,7 @@ void Open9xSim::refreshDisplay()
{
if (simuLcdRefresh) {
simuLcdRefresh = false;
FXColor offColor = isBacklightEnable() ? BL_COLOR : FXRGB(200, 200, 200);
FXColor offColor = isBacklightEnabled() ? BL_COLOR : FXRGB(200, 200, 200);
#if LCD_W == 128
FXColor onColor = FXRGB(0, 0, 0);
#endif
@@ -477,7 +477,7 @@ void Open9xSim::refreshDisplay()
uint8_t z = (y & 1) ? (*p >> 4) : (*p & 0x0F);
if (z) {
FXColor color;
if (isBacklightEnable())
if (isBacklightEnabled())
color = FXRGB(47-(z*47)/15, 123-(z*123)/15, 227-(z*227)/15);
else
color = FXRGB(200-(z*200)/15, 200-(z*200)/15, 200-(z*200)/15);
+1 -1
View File
@@ -349,7 +349,7 @@ void backlightDisable()
bl_target = g_eeGeneral.blOffBright;
}
bool isBacklightEnable()
bool isBacklightEnabled()
{
return (bl_target==g_eeGeneral.blOnBright);
}
+3 -3
View File
@@ -143,16 +143,16 @@ bool checkSlaveMode();
#if defined(PWM_BACKLIGHT)
void backlightEnable();
void backlightDisable();
bool isBacklightEnable();
bool isBacklightEnabled();
void backlightFade();
#elif defined(SP22)
#define backlightEnable() 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
#define backlightEnable() 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
#if defined(VOICE) && !defined(SIMU)
#define BACKLIGHT_ENABLE() Voice.Backlight = 1
+1 -1
View File
@@ -90,7 +90,7 @@ void sdPoll10ms();
#define OUT_C_LIGHT 0
#define backlightEnable() 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_DISABLE() backlightDisable()
+1 -1
View File
@@ -352,7 +352,7 @@ void backlightEnable(uint8_t dutyCycle);
#endif
#define BACKLIGHT_ENABLE() backlightEnable(UNEXPECTED_SHUTDOWN() ? 100 : 100-g_eeGeneral.backlightBright)
#define BACKLIGHT_DISABLE() backlightEnable(UNEXPECTED_SHUTDOWN() ? 100 : g_eeGeneral.blOffBright)
#define isBacklightEnable() true
#define isBacklightEnabled() true
// USB driver
int usbPlugged(void);
+43 -43
View File
@@ -23,7 +23,7 @@
#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
// Board driver
@@ -31,17 +31,17 @@ void boardInit(void);
#define boardOff() pwrOff()
// Keys
#define KEYS_GPIO_REG_MENU pinl
#define KEYS_GPIO_REG_MENU pinl
#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_REG_RIGHT pinl
#define KEYS_GPIO_REG_RIGHT pinl
#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_REG_UP pinl
#define KEYS_GPIO_REG_UP pinl
#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)
// Trims
@@ -78,12 +78,12 @@ void boardInit(void);
// Backlight driver
#define backlightEnable() PORTC |= (1<<OUT_C_LIGHT)
#define backlightDisable() PORTC &= ~(1<<OUT_C_LIGHT)
#define isBacklightEnable() PORTC & (1<<OUT_C_LIGHT)
#define BACKLIGHT_ENABLE() backlightEnable()
#define BACKLIGHT_DISABLE() backlightDisable()
#define isBacklightEnabled() PORTC & (1<<OUT_C_LIGHT)
#define BACKLIGHT_ENABLE() backlightEnable()
#define BACKLIGHT_DISABLE() backlightDisable()
// SD driver
#define BLOCK_SIZE 512 /* Block Size in Bytes */
#define BLOCK_SIZE 512 /* Block Size in Bytes */
#define sdDone()
#define SD_IS_HC() (0)
#define SD_GET_SPEED() (0)
@@ -94,60 +94,60 @@ void sdPoll10ms(void);
#endif
// Switchs driver
#define INP_C_ID2 1
#define INP_C_ID1 0
#define INP_D_AileDR 7
#define INP_G_ThrCt 2
#define INP_G_Gear 1
#define INP_G_RuddDR 0
#define INP_L_ElevDR 6
#define INP_L_Trainer 7
#define INP_C_ID2 1
#define INP_C_ID1 0
#define INP_D_AileDR 7
#define INP_G_ThrCt 2
#define INP_G_Gear 1
#define INP_G_RuddDR 0
#define INP_L_ElevDR 6
#define INP_L_Trainer 7
// Servitudes driver
#define INP_E_PPM_IN 7 //not used (reserved)
#define INP_B_WTV_BUSY 7 //WTV20SD, not used (reserved)
#define OUT_B_PPM 6
#define OUT_B_SIM_CTL 5
#define OUT_B_PPM 6
#define OUT_B_SIM_CTL 5
#define OUT_B_BUZZER 4
#define INP_D_I2C_SCL 1
#define INP_D_I2C_SDA 0
#define OUT_E_WTV_DATA 3 //WTV20SD
#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 INP_H_RF_Activated 6
#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_RF_Activated 6
#define INP_H_DSC_Activated 5 //not used, reserved for pwrCheck()
#define INP_H_Hold_Power 4 //not used, reserved for pwrCheck()
#define OUT_H_Speaker 3
#define OUT_H_WTV_RESET 1 //WTV20SD
#define OUT_H_HAPTIC 0
// Rotary encoders driver
#define INP_E_ROT_ENC_1_A 4
#define INP_E_ROT_ENC_1_B 5
#define INP_D_ROT_ENC_2_A 2
#define INP_D_ROT_ENC_2_B 3
#define INP_J_ROT_ENC_1_PUSH 0
#define INP_J_ROT_ENC_2_PUSH 1
#define REA_DOWN() (~PINJ & (1<<INP_J_ROT_ENC_1_PUSH))
#define REB_DOWN() (~PINJ & (1<<INP_J_ROT_ENC_2_PUSH))
#define ROTENC_DOWN() (REA_DOWN() || REB_DOWN())
#define INP_E_ROT_ENC_1_A 4
#define INP_E_ROT_ENC_1_B 5
#define INP_D_ROT_ENC_2_A 2
#define INP_D_ROT_ENC_2_B 3
#define INP_J_ROT_ENC_1_PUSH 0
#define INP_J_ROT_ENC_2_PUSH 1
#define REA_DOWN() (~PINJ & (1<<INP_J_ROT_ENC_1_PUSH))
#define REB_DOWN() (~PINJ & (1<<INP_J_ROT_ENC_2_PUSH))
#define ROTENC_DOWN() (REA_DOWN() || REB_DOWN())
// LCD driver
#define PORTA_LCD_DAT PORTA
#define PORTC_LCD_CTRL PORTC
#define PORTA_LCD_DAT PORTA
#define PORTC_LCD_CTRL PORTC
#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
#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
#define OUT_C_LCD_E 7
#define OUT_C_LCD_A0 5
#define OUT_C_LCD_RES 4
#define OUT_C_LCD_CS1 3
#define OUT_C_LCD_E 7
#define OUT_C_LCD_A0 5
#define OUT_C_LCD_RES 4
#define OUT_C_LCD_CS1 3
#define OUT_C_LIGHT 2
// DBLKeys driver
// DBLKeys driver
#define KEYS_PRESSED() (~PINL)
// Power driver
+1 -1
View File
@@ -279,7 +279,7 @@ extern "C" {
// Backlight driver
#define backlightEnable() (PWM->PWM_CH_NUM[0].PWM_CDTY = g_eeGeneral.backlightBright)
#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_DISABLE() backlightDisable()
@@ -54,7 +54,7 @@ void backlightDisable()
BACKLIGHT_TIMER->CCR2 = 0;
}
uint8_t isBacklightEnable()
uint8_t isBacklightEnabled()
{
return (BACKLIGHT_TIMER->CCR1 != 0 || BACKLIGHT_TIMER->CCR2 != 0);
}
@@ -93,7 +93,7 @@ void backlightDisable()
BACKLIGHT_TIMER->CCR2 = 0;
}
uint8_t isBacklightEnable()
uint8_t isBacklightEnabled()
{
return (BACKLIGHT_TIMER->CCR4 != 0 || BACKLIGHT_TIMER->CCR2 != 0);
}
@@ -127,7 +127,7 @@ void backlightDisable()
BACKLIGHT_TIMER->CCR2 = 0;
}
uint8_t isBacklightEnable()
uint8_t isBacklightEnabled()
{
return BACKLIGHT_TIMER->CCR2 != 0;
}
@@ -161,7 +161,7 @@ void backlightDisable()
BACKLIGHT_TIMER->CCR1 = 0;
}
uint8_t isBacklightEnable()
uint8_t isBacklightEnabled()
{
return BACKLIGHT_TIMER->CCR1 != 0;
}
+1 -1
View File
@@ -404,7 +404,7 @@ uint32_t pwroffPressed(void);
void backlightInit(void);
void backlightDisable(void);
#define BACKLIGHT_DISABLE() backlightDisable()
uint8_t isBacklightEnable(void);
uint8_t isBacklightEnabled(void);
#if defined(PCBX9E) || defined(PCBX9DP)
void backlightEnable(uint8_t level, uint8_t color);
#define BACKLIGHT_ENABLE() backlightEnable(g_eeGeneral.backlightBright, g_eeGeneral.backlightColor)