feat: Fatfish F16 support (main) (#4485)
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
co-authored by
Peter Feerick
parent
d8d6f671c2
commit
961c75784e
+1
-1
@@ -448,7 +448,7 @@ void audioTask(void * pdata)
|
||||
|
||||
setSampleRate(AUDIO_SAMPLE_RATE);
|
||||
|
||||
#if defined(PCBX12S) || defined(RADIO_TX16S)
|
||||
#if defined(PCBX12S) || defined(RADIO_TX16S) || defined(RADIO_F16)
|
||||
// The audio amp needs ~2s to start
|
||||
RTOS_WAIT_MS(1000); // 1s
|
||||
#endif
|
||||
|
||||
@@ -590,6 +590,7 @@ enum Functions {
|
||||
#endif
|
||||
FUNC_DISABLE_AUDIO_AMP,
|
||||
FUNC_RGB_LED,
|
||||
FUNC_LCD_TO_VIDEO,
|
||||
FUNC_TEST, // MUST remain last
|
||||
#if defined(DEBUG)
|
||||
FUNC_MAX SKIP
|
||||
|
||||
@@ -27,6 +27,13 @@
|
||||
void setRequestedMainView(uint8_t view);
|
||||
#endif
|
||||
|
||||
#if defined(VIDEO_SWITCH)
|
||||
#include "videoswitch_driver.h"
|
||||
#if defined(SIMU)
|
||||
void switchToRadio() {};
|
||||
void switchToVideo() {};
|
||||
#endif
|
||||
#endif
|
||||
CustomFunctionsContext modelFunctionsContext = { 0 };
|
||||
|
||||
CustomFunctionsContext globalFunctionsContext = { 0 };
|
||||
@@ -150,6 +157,7 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
}
|
||||
#endif
|
||||
|
||||
bool videoEnabled = false;
|
||||
for (uint8_t i=0; i<MAX_SPECIAL_FUNCTIONS; i++) {
|
||||
const CustomFunctionData * cfn = &functions[i];
|
||||
swsrc_t swtch = CFN_SWITCH(cfn);
|
||||
@@ -436,6 +444,12 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#if defined(VIDEO_SWITCH)
|
||||
case FUNC_LCD_TO_VIDEO:
|
||||
switchToVideo();
|
||||
videoEnabled = true;
|
||||
break;
|
||||
#endif
|
||||
#if defined(DEBUG)
|
||||
case FUNC_TEST:
|
||||
testFunc();
|
||||
@@ -465,6 +479,11 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(VIDEO_SWITCH)
|
||||
if (!videoEnabled)
|
||||
switchToRadio();
|
||||
#endif
|
||||
|
||||
functionsContext.activeSwitches = newActiveSwitches;
|
||||
functionsContext.activeFunctions = newActiveFunctions;
|
||||
}
|
||||
@@ -544,6 +563,8 @@ const char* funcGetLabel(uint8_t func)
|
||||
#endif
|
||||
case FUNC_RGB_LED:
|
||||
return STR_SF_RGBLEDS;
|
||||
case FUNC_LCD_TO_VIDEO:
|
||||
return STR_SF_LCD_TO_VIDEO;
|
||||
#if defined(DEBUG)
|
||||
case FUNC_TEST:
|
||||
return STR_SF_TEST;
|
||||
|
||||
@@ -69,11 +69,16 @@ static lv_disp_drv_t* refr_disp = nullptr;
|
||||
static void flushLcd(lv_disp_drv_t* disp_drv, const lv_area_t* area,
|
||||
lv_color_t* color_p)
|
||||
{
|
||||
#if !defined(LCD_VERTICAL_INVERT) && !defined(BOOT)
|
||||
// we're only interested in the last flush in direct mode
|
||||
if (!lv_disp_flush_is_last(disp_drv)) {
|
||||
lv_disp_flush_ready(disp_drv);
|
||||
return;
|
||||
#if (!defined(LCD_VERTICAL_INVERT) || defined(RADIO_F16)) && !defined(BOOT)
|
||||
#if defined(RADIO_F16)
|
||||
if (hardwareOptions.pcbrev > 0)
|
||||
#endif
|
||||
{
|
||||
// we're only interested in the last flush in direct mode
|
||||
if (!lv_disp_flush_is_last(disp_drv)) {
|
||||
lv_disp_flush_ready(disp_drv);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -95,7 +100,11 @@ static void flushLcd(lv_disp_drv_t* disp_drv, const lv_area_t* area,
|
||||
|
||||
lcd_flush_cb(disp_drv, (uint16_t*)color_p, copy_area);
|
||||
|
||||
#if !defined(LCD_VERTICAL_INVERT) && !defined(BOOT)
|
||||
#if (!defined(LCD_VERTICAL_INVERT) || defined(RADIO_F16)) && !defined(BOOT)
|
||||
#if defined(RADIO_F16)
|
||||
if (hardwareOptions.pcbrev > 0)
|
||||
#endif
|
||||
{
|
||||
uint16_t* src = (uint16_t*)color_p;
|
||||
uint16_t* dst = nullptr;
|
||||
if ((uint16_t*)color_p == LCD_FIRST_FRAME_BUFFER)
|
||||
@@ -117,6 +126,7 @@ static void flushLcd(lv_disp_drv_t* disp_drv, const lv_area_t* area,
|
||||
}
|
||||
DMAWait(); // wait for the last DMACopyBitmap to be completed before
|
||||
// sending completion message
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -145,6 +155,8 @@ static void init_lvgl_disp_drv()
|
||||
|
||||
#if !defined(LCD_VERTICAL_INVERT)
|
||||
disp_drv.direct_mode = 1;
|
||||
#elif defined(RADIO_F16)
|
||||
disp_drv.direct_mode = (hardwareOptions.pcbrev > 0) ? 1 : 0;
|
||||
#else
|
||||
disp_drv.direct_mode = 0;
|
||||
#endif
|
||||
|
||||
@@ -582,6 +582,10 @@ bool isAssignableFunctionAvailable(int function, bool modelFunctions)
|
||||
#if !defined(LED_STRIP_GPIO)
|
||||
case FUNC_RGB_LED:
|
||||
return false;
|
||||
#endif
|
||||
#if !defined(VIDEO_SWITCH)
|
||||
case FUNC_LCD_TO_VIDEO:
|
||||
return false;
|
||||
#endif
|
||||
default:
|
||||
return true;
|
||||
|
||||
@@ -84,6 +84,7 @@ const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
|
||||
{ FUNC_RGB_LED, "RGB_LED" },
|
||||
{ FUNC_LCD_TO_VIDEO, "LCD_TO_VIDEO" },
|
||||
{ FUNC_TEST, "TEST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@@ -93,6 +93,7 @@ const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_SET_SCREEN, "SET_SCREEN" },
|
||||
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
|
||||
{ FUNC_RGB_LED, "RGB_LED" },
|
||||
{ FUNC_LCD_TO_VIDEO, "LCD_TO_VIDEO" },
|
||||
{ FUNC_TEST, "TEST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@@ -93,6 +93,7 @@ const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_SET_SCREEN, "SET_SCREEN" },
|
||||
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
|
||||
{ FUNC_RGB_LED, "RGB_LED" },
|
||||
{ FUNC_LCD_TO_VIDEO, "LCD_TO_VIDEO" },
|
||||
{ FUNC_TEST, "TEST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@@ -84,6 +84,7 @@ const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
|
||||
{ FUNC_RGB_LED, "RGB_LED" },
|
||||
{ FUNC_LCD_TO_VIDEO, "LCD_TO_VIDEO" },
|
||||
{ FUNC_TEST, "TEST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@@ -84,6 +84,7 @@ const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
|
||||
{ FUNC_RGB_LED, "RGB_LED" },
|
||||
{ FUNC_LCD_TO_VIDEO, "LCD_TO_VIDEO" },
|
||||
{ FUNC_TEST, "TEST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@@ -86,6 +86,7 @@ const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_SET_SCREEN, "SET_SCREEN" },
|
||||
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
|
||||
{ FUNC_RGB_LED, "RGB_LED" },
|
||||
{ FUNC_LCD_TO_VIDEO, "LCD_TO_VIDEO" },
|
||||
{ FUNC_TEST, "TEST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@@ -86,6 +86,7 @@ const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_SET_SCREEN, "SET_SCREEN" },
|
||||
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
|
||||
{ FUNC_RGB_LED, "RGB_LED" },
|
||||
{ FUNC_LCD_TO_VIDEO, "LCD_TO_VIDEO" },
|
||||
{ FUNC_TEST, "TEST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@@ -84,6 +84,7 @@ const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
|
||||
{ FUNC_RGB_LED, "RGB_LED" },
|
||||
{ FUNC_LCD_TO_VIDEO, "LCD_TO_VIDEO" },
|
||||
{ FUNC_TEST, "TEST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@@ -84,6 +84,7 @@ const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
|
||||
{ FUNC_RGB_LED, "RGB_LED" },
|
||||
{ FUNC_LCD_TO_VIDEO, "LCD_TO_VIDEO" },
|
||||
{ FUNC_TEST, "TEST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@@ -84,6 +84,7 @@ const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
|
||||
{ FUNC_RGB_LED, "RGB_LED" },
|
||||
{ FUNC_LCD_TO_VIDEO, "LCD_TO_VIDEO" },
|
||||
{ FUNC_TEST, "TEST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@@ -71,6 +71,12 @@ if(PCB STREQUAL X10 OR PCB STREQUAL X12S OR PCB STREQUAL NV14 OR PCB STREQUAL PL
|
||||
../../../../../targets/pl18/key_driver.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(PCBREV STREQUAL F16)
|
||||
set(BOOTLOADER_SRC ${BOOTLOADER_SRC}
|
||||
../../../../../targets/horus/videoswitch_driver.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
# Add LVGL sources
|
||||
foreach(LVGL_FILE ${LVGL_SRC_FILES_MINIMAL})
|
||||
|
||||
@@ -112,6 +112,18 @@ if (PCB STREQUAL X10)
|
||||
set(INTERNAL_GPS_BAUDRATE "9600" CACHE STRING "Baud rate for internal GPS")
|
||||
set(FLYSKY_GIMBAL ON)
|
||||
set(FLEXSW "2" CACHE STRING "Max flex inputs usable as switches")
|
||||
elseif (PCBREV STREQUAL F16)
|
||||
set(FLAVOUR f16)
|
||||
add_definitions(-DRADIO_F16)
|
||||
add_definitions(-DRADIO_FAMILY_T16)
|
||||
set(DEFAULT_INTERNAL_MODULE MULTIMODULE CACHE STRING "Default internal module")
|
||||
option(BLUETOOTH "Support for bluetooth module" OFF)
|
||||
option(INTERNAL_GPS "Support for internal NMEA GPS" OFF)
|
||||
set(DEFAULT_THEME "DARKBLUE")
|
||||
add_definitions(-DMANUFACTURER_FATFISH)
|
||||
set(INTERNAL_GPS_BAUDRATE "9600" CACHE STRING "Baud rate for internal GPS")
|
||||
set(FLEXSW "2" CACHE STRING "Max flex inputs usable as switches")
|
||||
set(VIDEO_SWITCH ON)
|
||||
elseif (PCBREV STREQUAL T18)
|
||||
set(FLAVOUR t18)
|
||||
add_definitions(-DRADIO_T18)
|
||||
@@ -272,6 +284,14 @@ set(FIRMWARE_SRC
|
||||
drivers/frftl.cpp
|
||||
)
|
||||
|
||||
if (VIDEO_SWITCH)
|
||||
add_definitions(-DVIDEO_SWITCH)
|
||||
set(FIRMWARE_SRC
|
||||
${FIRMWARE_SRC}
|
||||
targets/horus/videoswitch_driver.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(BOOTLOADER)
|
||||
set(FIRMWARE_SRC
|
||||
${FIRMWARE_SRC}
|
||||
|
||||
@@ -51,6 +51,15 @@
|
||||
HardwareOptions hardwareOptions;
|
||||
bool boardBacklightOn = false;
|
||||
|
||||
#if defined(VIDEO_SWITCH)
|
||||
#include "videoswitch_driver.h"
|
||||
|
||||
void boardBootloaderInit()
|
||||
{
|
||||
videoSwitchInit();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(BOOT)
|
||||
#include "opentx.h"
|
||||
|
||||
@@ -160,6 +169,9 @@ void boardInit()
|
||||
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE, true);
|
||||
#endif
|
||||
|
||||
#if defined(VIDEO_SWITCH)
|
||||
videoSwitchInit();
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG)
|
||||
// DBGMCU_APB1PeriphConfig(DBGMCU_IWDG_STOP|DBGMCU_TIM1_STOP|DBGMCU_TIM2_STOP|DBGMCU_TIM3_STOP|DBGMCU_TIM4_STOP|DBGMCU_TIM5_STOP|DBGMCU_TIM6_STOP|DBGMCU_TIM7_STOP|DBGMCU_TIM8_STOP|DBGMCU_TIM9_STOP|DBGMCU_TIM10_STOP|DBGMCU_TIM11_STOP|DBGMCU_TIM12_STOP|DBGMCU_TIM13_STOP|DBGMCU_TIM14_STOP, ENABLE);
|
||||
@@ -179,6 +191,10 @@ void boardInit()
|
||||
ledBlue();
|
||||
#if !defined(LCD_VERTICAL_INVERT)
|
||||
lcdSetInitalFrameBuffer(lcdFront->getData());
|
||||
#elif defined(RADIO_F16)
|
||||
if(hardwareOptions.pcbrev > 0) {
|
||||
lcdSetInitalFrameBuffer(lcdFront->getData());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -61,6 +61,12 @@ extern uint16_t sessionTimer;
|
||||
|
||||
#define SLAVE_MODE() (g_model.trainerData.mode == TRAINER_MODE_SLAVE)
|
||||
|
||||
#if defined(RADIO_F16)
|
||||
// initilizes the board for the bootloader
|
||||
#define HAVE_BOARD_BOOTLOADER_INIT 1
|
||||
void boardBootloaderInit();
|
||||
#endif
|
||||
|
||||
// Board driver
|
||||
void boardInit();
|
||||
void boardOff();
|
||||
@@ -85,7 +91,7 @@ enum {
|
||||
#elif defined(PCBX10)
|
||||
#if defined(PCBREV_EXPRESS)
|
||||
#define IS_FIRMWARE_COMPATIBLE_WITH_BOARD() (hardwareOptions.pcbrev == PCBREV_X10_EXPRESS)
|
||||
#elif defined(RADIO_FAMILY_T16)
|
||||
#elif defined(RADIO_FAMILY_T16) || defined(RADIO_F16)
|
||||
#define IS_FIRMWARE_COMPATIBLE_WITH_BOARD() (true)
|
||||
#else
|
||||
#define IS_FIRMWARE_COMPATIBLE_WITH_BOARD() (hardwareOptions.pcbrev == PCBREV_X10_STD)
|
||||
@@ -150,7 +156,7 @@ uint32_t isBootloaderStart(const uint8_t * buffer);
|
||||
#endif
|
||||
|
||||
// POTS and SLIDERS default configuration
|
||||
#if defined(RADIO_TX16S)
|
||||
#if defined(RADIO_TX16S) || defined(RADIO_F16)
|
||||
#define XPOS_CALIB_DEFAULT {0x3, 0xc, 0x15, 0x1e, 0x26}
|
||||
#endif
|
||||
|
||||
@@ -293,7 +299,7 @@ void telemetryPortInvertedInit(uint32_t baudrate);
|
||||
|
||||
|
||||
// Aux serial port driver
|
||||
#if defined(RADIO_TX16S)
|
||||
#if defined(RADIO_TX16S) || defined(RADIO_F16)
|
||||
#define DEBUG_BAUDRATE 400000
|
||||
#define LUA_DEFAULT_BAUDRATE 115200
|
||||
#else
|
||||
@@ -320,7 +326,7 @@ void bluetoothWriteWakeup();
|
||||
uint8_t bluetoothIsWriting();
|
||||
void bluetoothDisable();
|
||||
|
||||
#if defined (RADIO_TX16S)
|
||||
#if defined(RADIO_TX16S) || defined(RADIO_F16)
|
||||
#define BATTERY_DIVIDER 1495
|
||||
#else
|
||||
#define BATTERY_DIVIDER 1629
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#define KEYS_GPIO_PIN_EXIT LL_GPIO_PIN_6 // PI.06
|
||||
#define KEYS_GPIO_REG_TELE GPIOC
|
||||
#define KEYS_GPIO_PIN_TELE LL_GPIO_PIN_4 // PC.04
|
||||
#elif defined(RADIO_TX16S)
|
||||
#elif defined(RADIO_TX16S) || defined(RADIO_F16)
|
||||
#define KEYS_GPIO_REG_ENTER GPIOI
|
||||
#define KEYS_GPIO_PIN_ENTER LL_GPIO_PIN_8 // PI.08
|
||||
#define KEYS_GPIO_REG_PAGEUP GPIOC
|
||||
@@ -241,8 +241,8 @@
|
||||
#define SWITCHES_E_INVERTED
|
||||
#endif
|
||||
|
||||
#if defined(PCBX10)
|
||||
// Gimbal switch left
|
||||
#if defined(PCBX10) && !defined(RADIO_F16)
|
||||
// Gimbal switch left
|
||||
#define STORAGE_SWITCH_I
|
||||
#define HARDWARE_SWITCH_I
|
||||
#define SWITCHES_GPIO_REG_I GPIOH
|
||||
@@ -253,7 +253,7 @@
|
||||
#define SWITCHES_GPIO_REG_J GPIOH
|
||||
#define SWITCHES_GPIO_PIN_J LL_GPIO_PIN_15 // PH.15
|
||||
#elif defined(PCBX12S)
|
||||
// Gimbal switch left
|
||||
// Gimbal switch left
|
||||
#define STORAGE_SWITCH_I
|
||||
#define HARDWARE_SWITCH_I
|
||||
#define SWITCHES_GPIO_REG_I GPIOB
|
||||
@@ -310,7 +310,7 @@
|
||||
#define TRIMS_GPIO_REG_LSU GPIOB
|
||||
#define TRIMS_GPIO_PIN_LSU LL_GPIO_PIN_13 // PB.13
|
||||
#elif defined(PCBX10)
|
||||
#if defined(RADIO_TX16S)
|
||||
#if defined(RADIO_TX16S) || defined(RADIO_F16)
|
||||
#define TRIMS_GPIO_REG_LHL GPIOA
|
||||
#define TRIMS_GPIO_PIN_LHL LL_GPIO_PIN_6 // PA.06
|
||||
#define TRIMS_GPIO_REG_LHR GPIOC
|
||||
@@ -423,7 +423,7 @@
|
||||
#define ADC_GPIO_PIN_EXT3 ADC_GPIO_PIN_STICK_RH
|
||||
#define ADC_GPIO_PIN_EXT4 ADC_GPIO_PIN_STICK_RV
|
||||
#endif
|
||||
#if !defined(RADIO_TX16S) && !defined(RADIO_T15)
|
||||
#if !(defined(RADIO_TX16S) || defined(RADIO_F16)) && !defined(RADIO_T15)
|
||||
#define PWM_STICKS
|
||||
#define PWM_TIMER TIM5
|
||||
#define PWM_GPIO GPIOA
|
||||
@@ -481,7 +481,7 @@
|
||||
#define ADC_DMA_STREAM_IRQHandler DMA2_Stream0_IRQHandler
|
||||
|
||||
// VBat divider is /4 on F42x and F43x devices
|
||||
#if defined(RADIO_TX16S) || defined(RADIO_T15)
|
||||
#if defined(RADIO_TX16S) || defined(RADIO_T15) || defined(RADIO_F16)
|
||||
#define ADC_VREF_PREC2 660
|
||||
#elif defined(RADIO_T16) || defined(RADIO_T18)
|
||||
#define ADC_VREF_PREC2 600
|
||||
@@ -496,7 +496,7 @@
|
||||
#define ADC_DIRECTION {1,-1,1,-1, 1,1,1, -1,1,1,1, -1,1 }
|
||||
#elif defined(RADIO_T18)
|
||||
#define ADC_DIRECTION {1,-1,1,-1, -1,1,-1, -1,1,1,1, -1,1 }
|
||||
#elif defined(RADIO_TX16S)
|
||||
#elif defined(RADIO_TX16S) || defined(RADIO_F16)
|
||||
#define ADC_DIRECTION {1,-1,1,-1, 1,1,1, -1,1,1,1, -1,1 }
|
||||
#elif defined(PCBX10)
|
||||
#define ADC_DIRECTION {1,-1,1,-1, -1,1,-1, 1,-1,1,1, 1,-1 }
|
||||
@@ -586,7 +586,7 @@
|
||||
#define AUX_SERIAL_DMA_RX DMA1
|
||||
#define AUX_SERIAL_DMA_RX_STREAM LL_DMA_STREAM_1
|
||||
#define AUX_SERIAL_DMA_RX_CHANNEL LL_DMA_CHANNEL_4
|
||||
#if defined(RADIO_TX16S)
|
||||
#if defined(RADIO_TX16S) || defined(RADIO_F16)
|
||||
#define AUX_SERIAL_PWR_GPIO GPIO_PIN(GPIOA, 15) // PA.15
|
||||
#endif
|
||||
#endif
|
||||
@@ -813,7 +813,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_FAMILY_T16)
|
||||
#if defined(RADIO_TX16S)
|
||||
#if defined(RADIO_TX16S) || defined(RADIO_F16)
|
||||
#define AUDIO_UNMUTE_DELAY 150 // ms
|
||||
#else
|
||||
#define AUDIO_UNMUTE_DELAY 120 // ms
|
||||
@@ -847,7 +847,7 @@
|
||||
#endif // HARDWARE_TOUCH
|
||||
|
||||
// First I2C Bus
|
||||
#if defined(RADIO_TX16S) || defined(PCBX12S) || defined(RADIO_T15)
|
||||
#if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(PCBX12S) || defined(RADIO_T15)
|
||||
#define I2C_B1 I2C1
|
||||
#define I2C_B1_GPIO GPIOB
|
||||
#define I2C_B1_SCL_GPIO_PIN LL_GPIO_PIN_8 // PB.08
|
||||
@@ -868,7 +868,7 @@
|
||||
#define I2C_B2_SCL_GPIO_PIN LL_GPIO_PIN_10 // PB.10
|
||||
#define I2C_B2_SDA_GPIO_PIN LL_GPIO_PIN_11 // PB.11
|
||||
#define I2C_B2_GPIO_AF LL_GPIO_AF_4 // I2C2
|
||||
#if defined(RADIO_TX16S)
|
||||
#if defined(RADIO_TX16S) || defined(RADIO_F16)
|
||||
#define I2C_B2_PWR_GPIO GPIOA
|
||||
#define I2C_B2_PWR_GPIO_PIN LL_GPIO_PIN_15 // PA.15
|
||||
#endif
|
||||
@@ -1078,6 +1078,11 @@
|
||||
#define BT_EN_GPIO GPIO_PIN(GPIOG, 10) // PG.10
|
||||
#endif
|
||||
|
||||
// Video switch
|
||||
#if defined(RADIO_F16)
|
||||
#define VIDEO_SWITCH_GPIO GPIO_PIN(GPIOH, 15) // PH.15
|
||||
#endif
|
||||
|
||||
// SDRAM
|
||||
#define SDRAM_BANK2
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "opentx_types.h"
|
||||
#include "dma2d.h"
|
||||
#include "board.h"
|
||||
#include "hal.h"
|
||||
#include "delays_driver.h"
|
||||
|
||||
@@ -137,6 +138,13 @@ static void startLcdRefresh(lv_disp_drv_t *disp_drv, uint16_t *buffer,
|
||||
const rect_t ©_area)
|
||||
{
|
||||
#if defined(LCD_VERTICAL_INVERT)
|
||||
#if defined(RADIO_F16)
|
||||
if(hardwareOptions.pcbrev > 0) {
|
||||
// Direct mode
|
||||
_update_frame_buffer_addr(buffer);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
_copy_rotate_180(_back_buffer, buffer, copy_area);
|
||||
|
||||
if (lv_disp_flush_is_last(disp_drv)) {
|
||||
@@ -177,6 +185,7 @@ static void startLcdRefresh(lv_disp_drv_t *disp_drv, uint16_t *buffer,
|
||||
area_w, area_h);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
// Direct mode
|
||||
_update_frame_buffer_addr(buffer);
|
||||
@@ -279,7 +288,7 @@ void LCD_Init_LTDC()
|
||||
clkConfig.PLLSAI.PLLSAIN = 192;
|
||||
clkConfig.PLLSAI.PLLSAIR = 3;
|
||||
clkConfig.PLLSAIDivQ = 6;
|
||||
#if defined(RADIO_TX16S)
|
||||
#if defined(RADIO_TX16S) || defined(RADIO_F16)
|
||||
clkConfig.PLLSAIDivR = RCC_PLLSAIDIVR_8;
|
||||
#else
|
||||
clkConfig.PLLSAIDivR = RCC_PLLSAIDIVR_4;
|
||||
@@ -373,7 +382,13 @@ void LCD_LayerInit()
|
||||
|
||||
/* Start Address configuration : the LCD Frame buffer is defined on SDRAM w/ Offset */
|
||||
#if defined(LCD_VERTICAL_INVERT)
|
||||
intptr_t layer_address = (intptr_t)_LCD_BUF_1;
|
||||
intptr_t layer_address;
|
||||
#if defined(RADIO_F16)
|
||||
if (hardwareOptions.pcbrev > 0)
|
||||
layer_address = (intptr_t)initialFrameBuffer;
|
||||
else
|
||||
#endif
|
||||
layer_address = (intptr_t)_LCD_BUF_1;
|
||||
#else
|
||||
intptr_t layer_address = (intptr_t)initialFrameBuffer;
|
||||
#endif
|
||||
|
||||
@@ -42,6 +42,10 @@
|
||||
#define USB_NAME "Radiomaster TX16S"
|
||||
#define USB_MANUFACTURER 'R', 'M', '_', 'T', 'X', ' ', ' ', ' ' /* 8 bytes */
|
||||
#define USB_PRODUCT 'R', 'M', ' ', 'T', 'X', '1', '6', 'S' /* 8 Bytes */
|
||||
#elif defined(RADIO_F16)
|
||||
#define USB_NAME "Fatfish F16"
|
||||
#define USB_MANUFACTURER 'F', 'A', 'T', 'F', 'I', 'S', 'H', ' ' /* 8 bytes */
|
||||
#define USB_PRODUCT 'F', 'F', ' ', 'F', '1', '6', ' ', ' ' /* 8 Bytes */
|
||||
#elif defined(PCBX10)
|
||||
#define USB_NAME "FrSky X10"
|
||||
#define USB_MANUFACTURER 'F', 'r', 'S', 'k', 'y', ' ', ' ', ' ' /* 8 bytes */
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "hal/gpio.h"
|
||||
#include "stm32_gpio.h"
|
||||
#include "videoswitch_driver.h"
|
||||
#include "hal.h"
|
||||
|
||||
void videoSwitchInit()
|
||||
{
|
||||
gpio_init(VIDEO_SWITCH_GPIO, GPIO_OUT, GPIO_PIN_SPEED_LOW);
|
||||
switchToRadio();
|
||||
}
|
||||
|
||||
void switchToVideo()
|
||||
{
|
||||
gpio_clear(VIDEO_SWITCH_GPIO);
|
||||
}
|
||||
|
||||
void switchToRadio()
|
||||
{
|
||||
gpio_set(VIDEO_SWITCH_GPIO);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
void videoSwitchInit();
|
||||
void switchToVideo();
|
||||
void switchToRadio();
|
||||
@@ -36,7 +36,7 @@ enum FrSkyDataState {
|
||||
};
|
||||
|
||||
#define FRSKY_SPORT_BAUDRATE 57600
|
||||
#if defined(RADIO_TX16S)
|
||||
#if defined(RADIO_TX16S) || defined(RADIO_F16)
|
||||
#define FRSKY_TELEM_MIRROR_BAUDRATE 115200
|
||||
#else
|
||||
#define FRSKY_TELEM_MIRROR_BAUDRATE FRSKY_SPORT_BAUDRATE
|
||||
|
||||
@@ -202,6 +202,7 @@ const char STR_SF_RACING_MODE[] = TR_SF_RACING_MODE;
|
||||
const char STR_SF_SAFETY[] = TR_SF_SAFETY;
|
||||
const char STR_SF_SET_SCREEN[] = TR_SF_SET_SCREEN;
|
||||
const char STR_SF_SCREENSHOT[] = TR_SF_SCREENSHOT;
|
||||
const char STR_SF_LCD_TO_VIDEO[] = TR_SF_LCD_TO_VIDEO;
|
||||
const char STR_SF_TEST[] = TR_SF_TEST;
|
||||
const char STR_TRIMS[] = TR_TRIMS;
|
||||
const char STR_MIRROR[] = TR_MIRROR;
|
||||
|
||||
@@ -324,6 +324,7 @@ extern const char STR_SF_RGBLEDS[];
|
||||
extern const char STR_SF_VOLUME[];
|
||||
extern const char STR_SF_RACING_MODE[];
|
||||
extern const char STR_SF_SCREENSHOT[];
|
||||
extern const char STR_SF_LCD_TO_VIDEO[];
|
||||
extern const char STR_SF_TEST[];
|
||||
extern const char STR_TRIMS[];
|
||||
extern const char STR_MIRROR[];
|
||||
|
||||
@@ -110,6 +110,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "禁用触摸"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "关闭音频功放"
|
||||
#define TR_SF_SET_SCREEN "选择主屏"
|
||||
#define TR_SF_LCD_TO_VIDEO "屏幕显示图传"
|
||||
|
||||
#define TR_FSW_RESET_TELEM "回传参数"
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "Deaktivace dotyku"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "Vypnutí zesilovače zvuku"
|
||||
#define TR_SF_SET_SCREEN "Vybrat hlavní obrazovku"
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Telm","Telemetrie")
|
||||
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "Kein Touch"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "Audio Verst. Aus"
|
||||
#define TR_SF_SET_SCREEN "Set Main Screen"
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Telm","Telemetrie")
|
||||
#define TR_FSW_RESET_TIMERS "Tmr1","Tmr2","Tmr3"
|
||||
|
||||
@@ -119,6 +119,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "No Touch"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "Audio Amp Off"
|
||||
#define TR_SF_SET_SCREEN "Set Main Screen"
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetry")
|
||||
#define TR_FSW_RESET_TIMERS "Tmr1","Tmr2","Tmr3"
|
||||
|
||||
@@ -116,6 +116,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "No Touch"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "Audio Amp Off"
|
||||
#define TR_SF_SET_SCREEN "Set Main Screen"
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetría")
|
||||
#define TR_FSW_RESET_TIMERS "Tmr1","Tmr2","Tmr3"
|
||||
|
||||
@@ -121,6 +121,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "No Touch"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "Audio Amp Off"
|
||||
#define TR_SF_SET_SCREEN "Set Main Screen"
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Telm","Telemetry")
|
||||
#define TR_FSW_RESET_TIMERS "Tmr1","Tmr2","Tmr3"
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "Non Tactile"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "Désact. Ampli Audio"
|
||||
#define TR_SF_SET_SCREEN "Définir Écran Princ."
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Télem.", "Télémétrie")
|
||||
#define TR_FSW_RESET_TIMERS "Chr1","Chr2","Chr3"
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "ללא מסך מגע"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "Audio Amp Off"
|
||||
#define TR_SF_SET_SCREEN "הגדרת מסך ראשי"
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Telm", "טלמטריה")
|
||||
#define TR_FSW_RESET_TIMERS "שעון 1","שעון 2","שעון 3"
|
||||
|
||||
@@ -119,6 +119,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "No Touch"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "Amp Audio Off"
|
||||
#define TR_SF_SET_SCREEN "Setta Schermo Princ."
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetria")
|
||||
#define TR_FSW_RESET_TIMERS "Tmr1","Tmr2","Tmr3"
|
||||
|
||||
@@ -119,6 +119,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "非タッチ"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "オーディオアンプ OFF"
|
||||
#define TR_SF_SET_SCREEN "メイン画面設定"
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Telm", "テレメトリー")
|
||||
#define TR_FSW_RESET_TIMERS "Tmr1","Tmr2","Tmr3"
|
||||
|
||||
@@ -116,6 +116,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "No Touch"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "Audio Amp Off"
|
||||
#define TR_SF_SET_SCREEN "Set Main Screen"
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetrie")
|
||||
#define TR_FSW_RESET_TIMERS "Tmr1","Tmr2","Tmr3"
|
||||
|
||||
@@ -115,6 +115,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "No Touch"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP TR("Wycisz wzm.", "Wycisz wzmacniacz audio")
|
||||
#define TR_SF_SET_SCREEN "Set Main Screen"
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetra")
|
||||
#define TR_FSW_RESET_TIMERS "Tmr1","Tmr2","Tmr3"
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "No Touch"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "Amp Audio Desl"
|
||||
#define TR_SF_SET_SCREEN "Def Tela Princ"
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetria")
|
||||
#define TR_FSW_RESET_TIMERS "Tmr1","Tmr2","Tmr3"
|
||||
|
||||
@@ -121,6 +121,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "Сенсор вык"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "Вык аудио усил."
|
||||
#define TR_SF_SET_SCREEN "Выбр глав экран"
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Телем", "Телеметрия")
|
||||
#define TR_FSW_RESET_TIMERS "Тмр1","Трм2","Трм3"
|
||||
|
||||
@@ -125,6 +125,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "Ej pekskärm"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP TR("Audioförst. av","Audioförstärkare av")
|
||||
#define TR_SF_SET_SCREEN "Sätt huvudskärm"
|
||||
#define TR_SF_LCD_TO_VIDEO "LCD to Video"
|
||||
|
||||
#define TR_FSW_RESET_TELEM TR("Telm","Telemetri")
|
||||
#define TR_FSW_RESET_TIMERS "Tmr1","Tmr2","Tmr3"
|
||||
|
||||
@@ -115,6 +115,7 @@
|
||||
#define TR_SF_DISABLE_TOUCH "禁用觸摸"
|
||||
#define TR_SF_DISABLE_AUDIO_AMP "關閉音頻功放"
|
||||
#define TR_SF_SET_SCREEN "選擇主屏"
|
||||
#define TR_SF_LCD_TO_VIDEO "屏幕顯示圖傳"
|
||||
|
||||
#define TR_FSW_RESET_TELEM "回傳參數"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user