Add T16 support
Added support for: - T16 radio - internal multi-protocol module. - flashing internal and external multi-protocol modules. Many thx to: - goebish, for the hardware support. - qba667, for the original patches for the internal multi-protocol support (UI and serial com).
This commit is contained in:
committed by
Raphael Coeffic
parent
4a618f1317
commit
6b12010473
@@ -71,6 +71,27 @@ void rotaryEncoderInit()
|
||||
|
||||
void rotaryEncoderCheck()
|
||||
{
|
||||
#if defined(RADIO_T16)
|
||||
static uint8_t state = 0;
|
||||
uint8_t pins = ROTARY_ENCODER_POSITION();
|
||||
|
||||
if (pins != (state & 0x03) && !(readKeys() & (1 << KEY_ENTER))) {
|
||||
if ((pins & 0x01) ^ ((pins & 0x02) >> 1)) {
|
||||
if ((state & 0x03) == 3)
|
||||
++rotencValue;
|
||||
else
|
||||
--rotencValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((state & 0x03) == 3)
|
||||
--rotencValue;
|
||||
else if ((state & 0x03) == 0)
|
||||
++rotencValue;
|
||||
}
|
||||
state &= ~0x03 ;
|
||||
state |= pins ;
|
||||
#else
|
||||
uint8_t newPosition = ROTARY_ENCODER_POSITION();
|
||||
if (newPosition != rotencPosition && !(readKeys() & (1 << KEY_ENTER))) {
|
||||
if ((rotencPosition & 0x01) ^ ((newPosition & 0x02) >> 1)) {
|
||||
@@ -80,6 +101,7 @@ void rotaryEncoderCheck()
|
||||
++rotencValue;
|
||||
}
|
||||
rotencPosition = newPosition;
|
||||
#endif
|
||||
#if !defined(BOOT)
|
||||
if (g_eeGeneral.backlightMode & e_backlight_mode_keys) {
|
||||
backlightOn();
|
||||
@@ -127,4 +149,4 @@ extern "C" void ROTARY_ENCODER_TIMER_IRQHandler(void)
|
||||
ROTARY_ENCODER_TIMER->SR &= ~TIM_SR_UIF;
|
||||
ROTARY_ENCODER_TIMER->CR1 = 0;
|
||||
rotaryEncoderCheck();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user