Cosmetics
This commit is contained in:
@@ -47,7 +47,7 @@ namespace Er9x {
|
||||
uint8_t pxxFlag = 0;
|
||||
int16_t g_anas[7];
|
||||
|
||||
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
|
||||
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
@@ -151,7 +151,7 @@ void simuSetKey(uint8_t key, bool state)
|
||||
}
|
||||
}
|
||||
|
||||
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
|
||||
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Ersky9x {
|
||||
#include "../ersky9x/sound.cpp"
|
||||
#include "../ersky9x/diskio.cpp"
|
||||
|
||||
#define IS_BACKLIGHT_ON() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
|
||||
#define isBacklightEnable() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
|
||||
|
||||
//uint8_t pxxFlag = 0;
|
||||
int16_t g_anas[7];
|
||||
|
||||
@@ -156,7 +156,7 @@ void simuSetKey(uint8_t key, bool state)
|
||||
}
|
||||
}
|
||||
|
||||
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
|
||||
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ for (int fm=0; fm<MAX_FLIGHT_MODES; fm++) {
|
||||
#ifdef LCDCHANGED_IMPORT
|
||||
#undef LCDCHANGED_IMPORT
|
||||
if (lcd_refresh) {
|
||||
lightEnable = IS_BACKLIGHT_ON();
|
||||
lightEnable = isBacklightEnable();
|
||||
lcd_refresh = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
-2
@@ -1009,8 +1009,8 @@ void checkBacklight();
|
||||
#define BACKLIGHT_ON() (Voice.Backlight = 1)
|
||||
#define BACKLIGHT_OFF() (Voice.Backlight = 0)
|
||||
#else
|
||||
#define BACKLIGHT_ON() __BACKLIGHT_ON
|
||||
#define BACKLIGHT_OFF() __BACKLIGHT_OFF
|
||||
#define BACKLIGHT_ON() backlightEnable()
|
||||
#define BACKLIGHT_OFF() backlightDisable()
|
||||
#endif
|
||||
|
||||
#define BITMASK(bit) (1<<(bit))
|
||||
|
||||
+2
-2
@@ -362,7 +362,7 @@ void Open9xSim::refreshDisplay()
|
||||
{
|
||||
if (lcd_refresh) {
|
||||
lcd_refresh = false;
|
||||
FXColor offColor = IS_BACKLIGHT_ON() ? BL_COLOR : FXRGB(200, 200, 200);
|
||||
FXColor offColor = isBacklightEnable() ? BL_COLOR : FXRGB(200, 200, 200);
|
||||
#if LCD_W == 128
|
||||
FXColor onColor = FXRGB(0, 0, 0);
|
||||
#endif
|
||||
@@ -373,7 +373,7 @@ void Open9xSim::refreshDisplay()
|
||||
uint8_t z = (y & 1) ? (*p >> 4) : (*p & 0x0F);
|
||||
if (z) {
|
||||
FXColor color;
|
||||
if (IS_BACKLIGHT_ON())
|
||||
if (isBacklightEnable())
|
||||
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);
|
||||
|
||||
@@ -266,7 +266,6 @@ FORCEINLINE void readKeysAndTrims()
|
||||
in = (tin & 0x0f) << 3;
|
||||
in |= (tin & 0x30) >> 3;
|
||||
for (int i=1; i<7; i++) {
|
||||
// INP_B_KEY_MEN 1 .. INP_B_KEY_LFT 6
|
||||
keys[enuk].input(in & (1<<i));
|
||||
++enuk;
|
||||
}
|
||||
|
||||
@@ -92,12 +92,14 @@ void sdMountPoll();
|
||||
void sdPoll10ms();
|
||||
#endif
|
||||
|
||||
#define speakerOn() TCCR0A |= (1 << COM0A0)
|
||||
#define speakerOff() TCCR0A &= ~(1 << COM0A0)
|
||||
#define __BACKLIGHT_ON PORTC |= (1 << OUT_C_LIGHT)
|
||||
#define __BACKLIGHT_OFF PORTC &= ~(1 << OUT_C_LIGHT)
|
||||
#define IS_BACKLIGHT_ON() (PORTC & (1<<OUT_C_LIGHT))
|
||||
#define speakerOn() TCCR0A |= (1 << COM0A0)
|
||||
#define speakerOff() TCCR0A &= ~(1 << COM0A0)
|
||||
|
||||
// Backlight driver
|
||||
#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 INP_L_SPARE6 7
|
||||
#define INP_L_SPARE5 6
|
||||
@@ -144,7 +146,6 @@ void sdPoll10ms();
|
||||
|
||||
#define INP_C_AileDR 7
|
||||
#define INP_C_ElevDR 6
|
||||
#define OUT_C_LIGHT 0
|
||||
|
||||
#define OUT_B_Speaker 7
|
||||
#define OUT_B_PPM 6 // will be switched by TCNT1==OCR1B in hardware
|
||||
|
||||
@@ -192,7 +192,6 @@ FORCEINLINE void readKeysAndTrims()
|
||||
in |= (tin & 0x30) >> 3;
|
||||
|
||||
for (int i=1; i<7; i++) {
|
||||
//INP_B_KEY_MEN 1 .. INP_B_KEY_LFT 6
|
||||
keys[enuk].input(in & (1<<i));
|
||||
++enuk;
|
||||
}
|
||||
|
||||
@@ -82,9 +82,11 @@
|
||||
#define SLAVE_MODE() ~PINH & (1<<INP_H_RF_Activated)
|
||||
#define JACK_PPM_OUT() PORTB |= (1<<OUT_B_SIM_CTL)
|
||||
#define JACK_PPM_IN() PORTB &= ~(1<<OUT_B_SIM_CTL)
|
||||
#define __BACKLIGHT_ON PORTC |= (1<<OUT_C_LIGHT)
|
||||
#define __BACKLIGHT_OFF PORTC &= ~(1<<OUT_C_LIGHT)
|
||||
#define IS_BACKLIGHT_ON() PORTC & (1<<OUT_C_LIGHT)
|
||||
|
||||
// Backlight driver
|
||||
#define backlightEnable() PORTC |= (1<<OUT_C_LIGHT)
|
||||
#define backlightDisable() PORTC &= ~(1<<OUT_C_LIGHT)
|
||||
#define isBacklightEnable() PORTC & (1<<OUT_C_LIGHT)
|
||||
|
||||
// SD driver
|
||||
#define sdDone()
|
||||
|
||||
@@ -321,13 +321,6 @@ extern void rxPdcUsart( void (*pChProcess)(uint8_t x) );
|
||||
#define INP_C_AileDR 7
|
||||
#define INP_E_ID2 6
|
||||
|
||||
#define INP_B_KEY_LFT 6
|
||||
#define INP_B_KEY_RGT 5
|
||||
#define INP_B_KEY_UP 4
|
||||
#define INP_B_KEY_DWN 3
|
||||
#define INP_B_KEY_EXT 2
|
||||
#define INP_B_KEY_MEN 1
|
||||
|
||||
#define INP_L_SPARE6 7
|
||||
#define INP_L_SPARE5 6
|
||||
#define INP_L_KEY_EXT 5
|
||||
|
||||
@@ -227,10 +227,10 @@ void disable_dsm2(uint32_t port);
|
||||
#endif
|
||||
|
||||
// Backlight driver
|
||||
#define setBacklight(xx) (PWM->PWM_CH_NUM[0].PWM_CDTYUPD = xx)
|
||||
#define __BACKLIGHT_ON (PWM->PWM_CH_NUM[0].PWM_CDTY = g_eeGeneral.backlightBright)
|
||||
#define __BACKLIGHT_OFF (PWM->PWM_CH_NUM[0].PWM_CDTY = 100)
|
||||
#define IS_BACKLIGHT_ON() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
|
||||
#define setBacklight(xx) (PWM->PWM_CH_NUM[0].PWM_CDTYUPD = xx)
|
||||
#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)
|
||||
|
||||
// ADC driver
|
||||
void adcInit();
|
||||
|
||||
@@ -302,7 +302,6 @@ FORCEINLINE void readKeysAndTrims()
|
||||
// User buttons ...
|
||||
uint8_t in = ~PINB;
|
||||
for (int i=1; i<7; i++) {
|
||||
// INP_B_KEY_MEN 1 .. INP_B_KEY_LFT 6
|
||||
keys[enuk].input(in & (1<<i));
|
||||
++enuk;
|
||||
}
|
||||
@@ -354,17 +353,17 @@ static const uint8_t pwmtable[16] PROGMEM =
|
||||
static uint8_t bl_target;
|
||||
static uint8_t bl_current;
|
||||
|
||||
void backlightFadeOn()
|
||||
void backlightEnable()
|
||||
{
|
||||
bl_target = 15 - g_eeGeneral.blOnBright;
|
||||
}
|
||||
|
||||
void backlightFadeOff()
|
||||
void backlightDisable()
|
||||
{
|
||||
bl_target = g_eeGeneral.blOffBright;
|
||||
}
|
||||
|
||||
bool getBackLightState()
|
||||
bool isBacklightEnable()
|
||||
{
|
||||
return (bl_target==g_eeGeneral.blOnBright);
|
||||
}
|
||||
|
||||
@@ -39,98 +39,6 @@
|
||||
|
||||
#include "../common_avr/board_avr.h"
|
||||
|
||||
#define KEYS_GPIO_REG_MENU pinb
|
||||
#define KEYS_GPIO_REG_EXIT pinb
|
||||
#define KEYS_GPIO_REG_RIGHT pinb
|
||||
#define KEYS_GPIO_REG_LEFT pinb
|
||||
#define KEYS_GPIO_REG_UP pinb
|
||||
#define KEYS_GPIO_REG_DOWN pinb
|
||||
#define KEYS_GPIO_PIN_MENU (1<<INP_B_KEY_MEN)
|
||||
#define KEYS_GPIO_PIN_EXIT (1<<INP_B_KEY_EXT)
|
||||
#define KEYS_GPIO_PIN_UP (1<<INP_B_KEY_UP)
|
||||
#define KEYS_GPIO_PIN_DOWN (1<<INP_B_KEY_DWN)
|
||||
#define KEYS_GPIO_PIN_RIGHT (1<<INP_B_KEY_RGT)
|
||||
#define KEYS_GPIO_PIN_LEFT (1<<INP_B_KEY_LFT)
|
||||
|
||||
#define TRIMS_GPIO_REG_LHL pind
|
||||
#define TRIMS_GPIO_REG_LVD pind
|
||||
#define TRIMS_GPIO_REG_RVU pind
|
||||
#define TRIMS_GPIO_REG_RHL pind
|
||||
#define TRIMS_GPIO_REG_LHR pind
|
||||
#define TRIMS_GPIO_REG_LVU pind
|
||||
#define TRIMS_GPIO_REG_RVD pind
|
||||
#define TRIMS_GPIO_REG_RHR pind
|
||||
#define TRIMS_GPIO_PIN_LHL (1<<INP_D_TRM_LH_DWN)
|
||||
#define TRIMS_GPIO_PIN_LVD (1<<INP_D_TRM_LV_DWN)
|
||||
#define TRIMS_GPIO_PIN_RVU (1<<INP_D_TRM_RV_UP)
|
||||
#define TRIMS_GPIO_PIN_RHL (1<<INP_D_TRM_RH_DWN)
|
||||
#define TRIMS_GPIO_PIN_LHR (1<<INP_D_TRM_LH_UP)
|
||||
#define TRIMS_GPIO_PIN_LVU (1<<INP_D_TRM_LV_UP)
|
||||
#define TRIMS_GPIO_PIN_RVD (1<<INP_D_TRM_RV_DWN)
|
||||
#define TRIMS_GPIO_PIN_RHR (1<<INP_D_TRM_RH_UP)
|
||||
|
||||
#if defined(CPUM2561)
|
||||
#define TIMER_16KHZ_VECT TIMER2_OVF_vect
|
||||
#define COUNTER_16KHZ TCNT2
|
||||
#define TIMER_10MS_VECT TIMER2_COMPA_vect
|
||||
#define TIMER_10MS_COMPVAL OCR2A
|
||||
#define PAUSE_10MS_INTERRUPT() TIMSK2 &= ~(1<<OCIE2A)
|
||||
#define RESUME_10MS_INTERRUPT() TIMSK2 |= (1<<OCIE2A)
|
||||
#define PAUSE_PPMIN_INTERRUPT() TIMSK3 &= ~(1<<ICIE3)
|
||||
#define RESUME_PPMIN_INTERRUPT() TIMSK3 |= (1<<ICIE3)
|
||||
#define TIMER_AUDIO_VECT TIMER4_COMPA_vect
|
||||
#define SET_TIMER_AUDIO_CTRL() TCCR4B = (1 << WGM42) | (0b010 << CS40)
|
||||
#define PAUSE_AUDIO_INTERRUPT() TIMSK4 &= ~(1<<OCIE4A)
|
||||
#define RESUME_AUDIO_INTERRUPT() TIMSK4 |= (1<<OCIE4A)
|
||||
#else
|
||||
#define TIMER_16KHZ_VECT TIMER0_OVF_vect
|
||||
#define COUNTER_16KHZ TCNT0
|
||||
#define TIMER_10MS_VECT TIMER0_COMP_vect
|
||||
#define TIMER_10MS_COMPVAL OCR0
|
||||
#define PAUSE_10MS_INTERRUPT() TIMSK &= ~(1<<OCIE0)
|
||||
#define RESUME_10MS_INTERRUPT() TIMSK |= (1<<OCIE0)
|
||||
#define PAUSE_PPMIN_INTERRUPT() ETIMSK &= ~(1<<TICIE3)
|
||||
#define RESUME_PPMIN_INTERRUPT() ETIMSK |= (1<<TICIE3)
|
||||
#define TIMER_AUDIO_VECT TIMER2_OVF_vect
|
||||
#define SET_TIMER_AUDIO_CTRL() TCCR2 = (0b010 << CS00) // Norm mode, clk/8
|
||||
#define PAUSE_AUDIO_INTERRUPT() TIMSK &= ~(1<<TOIE2)
|
||||
#define RESUME_AUDIO_INTERRUPT() TIMSK |= (1<<TOIE2)
|
||||
#endif
|
||||
|
||||
// Power driver (none)
|
||||
#define pwrCheck() (e_power_on)
|
||||
#define pwrOff()
|
||||
#define UNEXPECTED_SHUTDOWN() (mcusr & (1 << WDRF))
|
||||
|
||||
// Trainer driver
|
||||
bool checkSlaveMode();
|
||||
#define SLAVE_MODE() checkSlaveMode()
|
||||
#define JACK_PPM_OUT() PORTG &= ~(1<<OUT_G_SIM_CTL)
|
||||
#define JACK_PPM_IN() PORTG |= (1<<OUT_G_SIM_CTL)
|
||||
|
||||
// PWM Backlight driver
|
||||
#if defined(PWM_BACKLIGHT)
|
||||
void backlightFadeOn();
|
||||
#define __BACKLIGHT_ON backlightFadeOn()
|
||||
void backlightFadeOff();
|
||||
#define __BACKLIGHT_OFF backlightFadeOff()
|
||||
bool getBackLightState();
|
||||
#define IS_BACKLIGHT_ON() getBackLightState()
|
||||
void backlightFade();
|
||||
#else
|
||||
|
||||
#if defined(SP22)
|
||||
#define __BACKLIGHT_ON PORTB &= ~(1 << OUT_B_LIGHT)
|
||||
#define __BACKLIGHT_OFF PORTB |= (1 << OUT_B_LIGHT)
|
||||
#define IS_BACKLIGHT_ON() (~PORTB & (1<<OUT_B_LIGHT))
|
||||
#else
|
||||
#define __BACKLIGHT_ON PORTB |= (1 << OUT_B_LIGHT)
|
||||
#define __BACKLIGHT_OFF PORTB &= ~(1 << OUT_B_LIGHT)
|
||||
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// G: The following comments relate to the original stock PCB only
|
||||
//
|
||||
// elev thr
|
||||
// LV RV
|
||||
@@ -170,24 +78,96 @@ void backlightFade();
|
||||
// - - - O i i i
|
||||
// SIM_CTL ID1 Haptic RF_POW RuddDR
|
||||
|
||||
// Keys
|
||||
#define KEYS_GPIO_REG_MENU pinb
|
||||
#define KEYS_GPIO_PIN_MENU (1<<1)
|
||||
#define KEYS_GPIO_REG_EXIT pinb
|
||||
#define KEYS_GPIO_PIN_EXIT (1<<2)
|
||||
#define KEYS_GPIO_REG_RIGHT pinb
|
||||
#define KEYS_GPIO_PIN_RIGHT (1<<5)
|
||||
#define KEYS_GPIO_REG_LEFT pinb
|
||||
#define KEYS_GPIO_PIN_LEFT (1<<6)
|
||||
#define KEYS_GPIO_REG_UP pinb
|
||||
#define KEYS_GPIO_PIN_UP (1<<4)
|
||||
#define KEYS_GPIO_REG_DOWN pinb
|
||||
#define KEYS_GPIO_PIN_DOWN (1<<3)
|
||||
|
||||
// Trims
|
||||
#define TRIMS_GPIO_REG_LHL pind
|
||||
#define TRIMS_GPIO_PIN_LHL (1<<6)
|
||||
#define TRIMS_GPIO_REG_LVD pind
|
||||
#define TRIMS_GPIO_PIN_LVD (1<<3)
|
||||
#define TRIMS_GPIO_REG_RVU pind
|
||||
#define TRIMS_GPIO_PIN_RVU (1<<4)
|
||||
#define TRIMS_GPIO_REG_RHL pind
|
||||
#define TRIMS_GPIO_PIN_RHL (1<<1)
|
||||
#define TRIMS_GPIO_REG_LHR pind
|
||||
#define TRIMS_GPIO_PIN_LHR (1<<7)
|
||||
#define TRIMS_GPIO_REG_LVU pind
|
||||
#define TRIMS_GPIO_PIN_LVU (1<<2)
|
||||
#define TRIMS_GPIO_REG_RVD pind
|
||||
#define TRIMS_GPIO_PIN_RVD (1<<5)
|
||||
#define TRIMS_GPIO_REG_RHR pind
|
||||
#define TRIMS_GPIO_PIN_RHR (1<<0)
|
||||
|
||||
#if defined(CPUM2561)
|
||||
#define TIMER_16KHZ_VECT TIMER2_OVF_vect
|
||||
#define COUNTER_16KHZ TCNT2
|
||||
#define TIMER_10MS_VECT TIMER2_COMPA_vect
|
||||
#define TIMER_10MS_COMPVAL OCR2A
|
||||
#define PAUSE_10MS_INTERRUPT() TIMSK2 &= ~(1<<OCIE2A)
|
||||
#define RESUME_10MS_INTERRUPT() TIMSK2 |= (1<<OCIE2A)
|
||||
#define PAUSE_PPMIN_INTERRUPT() TIMSK3 &= ~(1<<ICIE3)
|
||||
#define RESUME_PPMIN_INTERRUPT() TIMSK3 |= (1<<ICIE3)
|
||||
#define TIMER_AUDIO_VECT TIMER4_COMPA_vect
|
||||
#define SET_TIMER_AUDIO_CTRL() TCCR4B = (1 << WGM42) | (0b010 << CS40)
|
||||
#define PAUSE_AUDIO_INTERRUPT() TIMSK4 &= ~(1<<OCIE4A)
|
||||
#define RESUME_AUDIO_INTERRUPT() TIMSK4 |= (1<<OCIE4A)
|
||||
#else
|
||||
#define TIMER_16KHZ_VECT TIMER0_OVF_vect
|
||||
#define COUNTER_16KHZ TCNT0
|
||||
#define TIMER_10MS_VECT TIMER0_COMP_vect
|
||||
#define TIMER_10MS_COMPVAL OCR0
|
||||
#define PAUSE_10MS_INTERRUPT() TIMSK &= ~(1<<OCIE0)
|
||||
#define RESUME_10MS_INTERRUPT() TIMSK |= (1<<OCIE0)
|
||||
#define PAUSE_PPMIN_INTERRUPT() ETIMSK &= ~(1<<TICIE3)
|
||||
#define RESUME_PPMIN_INTERRUPT() ETIMSK |= (1<<TICIE3)
|
||||
#define TIMER_AUDIO_VECT TIMER2_OVF_vect
|
||||
#define SET_TIMER_AUDIO_CTRL() TCCR2 = (0b010 << CS00) // Norm mode, clk/8
|
||||
#define PAUSE_AUDIO_INTERRUPT() TIMSK &= ~(1<<TOIE2)
|
||||
#define RESUME_AUDIO_INTERRUPT() TIMSK |= (1<<TOIE2)
|
||||
#endif
|
||||
|
||||
// Power driver (none)
|
||||
#define pwrCheck() (e_power_on)
|
||||
#define pwrOff()
|
||||
#define UNEXPECTED_SHUTDOWN() (mcusr & (1 << WDRF))
|
||||
|
||||
// Trainer driver
|
||||
bool checkSlaveMode();
|
||||
#define OUT_G_SIM_CTL 4 // 1 : phone-jack=ppm_in
|
||||
#define SLAVE_MODE() checkSlaveMode()
|
||||
#define JACK_PPM_OUT() PORTG &= ~(1<<OUT_G_SIM_CTL)
|
||||
#define JACK_PPM_IN() PORTG |= (1<<OUT_G_SIM_CTL)
|
||||
|
||||
// PWM Backlight driver
|
||||
#define OUT_B_LIGHT 7
|
||||
#define INP_B_KEY_LFT 6
|
||||
#define INP_B_KEY_RGT 5
|
||||
#define INP_B_KEY_UP 4
|
||||
#define INP_B_KEY_DWN 3
|
||||
#define INP_B_KEY_EXT 2
|
||||
#define INP_B_KEY_MEN 1
|
||||
#if defined(PWM_BACKLIGHT)
|
||||
void backlightEnable();
|
||||
void backlightDisable();
|
||||
bool isBacklightEnable();
|
||||
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))
|
||||
#else
|
||||
#define backlightEnable() PORTB |= (1<<OUT_B_LIGHT)
|
||||
#define backlightDisable() PORTB &= ~(1<<OUT_B_LIGHT)
|
||||
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
|
||||
#endif
|
||||
|
||||
#define OUT_B_PPM 0
|
||||
|
||||
#define INP_D_TRM_LH_UP 7
|
||||
#define INP_D_TRM_LH_DWN 6
|
||||
#define INP_D_TRM_RV_DWN 5
|
||||
#define INP_D_TRM_RV_UP 4
|
||||
#define INP_D_TRM_LV_DWN 3
|
||||
#define INP_D_TRM_LV_UP 2
|
||||
#define INP_D_TRM_RH_DWN 1
|
||||
#define INP_D_TRM_RH_UP 0
|
||||
|
||||
#define INP_E_PPM_IN 7
|
||||
#define INP_E_ID2 6
|
||||
#define INP_E_Trainer 5
|
||||
@@ -203,7 +183,6 @@ void backlightFade();
|
||||
#define INP_E_AileDR 1
|
||||
#endif
|
||||
|
||||
#define OUT_G_SIM_CTL 4 //1 : phone-jack=ppm_in
|
||||
#define INP_G_ID1 3
|
||||
#define OUT_G_HAPTIC 2
|
||||
#define INP_G_RF_POW 1
|
||||
|
||||
@@ -267,17 +267,17 @@ uint32_t pwrPressedDuration(void);
|
||||
|
||||
// Backlight driver
|
||||
#if defined(REVPLUS)
|
||||
void turnBacklightOn(uint8_t level, uint8_t color);
|
||||
void turnBacklightOff(void);
|
||||
#define setBacklight(xx) turnBacklightOn(xx, g_eeGeneral.backlightColor)
|
||||
#define __BACKLIGHT_ON turnBacklightOn(g_eeGeneral.backlightBright, g_eeGeneral.backlightColor)
|
||||
#define __BACKLIGHT_OFF turnBacklightOff()
|
||||
#define IS_BACKLIGHT_ON() (BACKLIGHT_TIMER->CCR4 != 0) || (BACKLIGHT_TIMER->CCR2 != 0)
|
||||
void turnBacklightOn(uint8_t level, uint8_t color);
|
||||
void turnBacklightOff(void);
|
||||
#define setBacklight(xx) turnBacklightOn(xx, g_eeGeneral.backlightColor)
|
||||
#define backlightEnable() turnBacklightOn(g_eeGeneral.backlightBright, g_eeGeneral.backlightColor)
|
||||
#define backlightDisable() turnBacklightOff()
|
||||
#define isBacklightEnable() ((BACKLIGHT_TIMER->CCR4 != 0) || (BACKLIGHT_TIMER->CCR2 != 0))
|
||||
#else
|
||||
#define setBacklight(xx) TIM10->CCR1 = 100-xx
|
||||
#define __BACKLIGHT_ON TIM10->CCR1 = 100-g_eeGeneral.backlightBright
|
||||
#define __BACKLIGHT_OFF TIM10->CCR1 = 0
|
||||
#define IS_BACKLIGHT_ON() (TIM10->CCR1 != 0)
|
||||
#define setBacklight(xx) TIM10->CCR1 = 100-xx
|
||||
#define backlightEnable() TIM10->CCR1 = 100-g_eeGeneral.backlightBright
|
||||
#define backlightDisable() TIM10->CCR1 = 0
|
||||
#define isBacklightEnable() (TIM10->CCR1 != 0)
|
||||
#endif
|
||||
|
||||
// USB driver
|
||||
|
||||
Reference in New Issue
Block a user