From 069a6d3d91cc839a3aa27066755f651871804f6d Mon Sep 17 00:00:00 2001 From: 3djc Date: Sun, 22 Mar 2020 16:08:38 +0100 Subject: [PATCH] Placeholder for touch hardware --- radio/src/gui/480x272/topbar.cpp | 14 ++++++++------ radio/src/targets/horus/CMakeLists.txt | 8 +++++++- radio/src/targets/horus/ft5x06.cpp | 21 +++++++++++++++++++++ radio/src/targets/horus/ft5x06.h | 24 ++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 radio/src/targets/horus/ft5x06.cpp create mode 100644 radio/src/targets/horus/ft5x06.h diff --git a/radio/src/gui/480x272/topbar.cpp b/radio/src/gui/480x272/topbar.cpp index 487e70a9b..f631f7984 100644 --- a/radio/src/gui/480x272/topbar.cpp +++ b/radio/src/gui/480x272/topbar.cpp @@ -91,15 +91,17 @@ void drawTopBar() /* Tx battery */ uint8_t bars = GET_TXBATT_BARS(5); #if defined(USB_CHARGER) - if(usbChargerLed()) + if(usbChargerLed() && BLINK_ON_PHASE) lcdDrawBitmapPattern(LCD_W-130, 24, LBM_TOPMENU_TXBATT_CHARGING, MENU_TITLE_COLOR); - else + else { #endif - lcdDrawBitmapPattern(LCD_W-130, 24, LBM_TOPMENU_TXBATT, MENU_TITLE_COLOR); - for (unsigned int i = 0; i < 5; i++) { - lcdDrawSolidFilledRect(LCD_W-122+4*i, 30, 2, 8, i >= bars ? MENU_TITLE_DISABLE_COLOR : MENU_TITLE_COLOR); + lcdDrawBitmapPattern(LCD_W - 130, 24, LBM_TOPMENU_TXBATT, MENU_TITLE_COLOR); + for (unsigned int i = 0; i < 5; i++) { + lcdDrawSolidFilledRect(LCD_W - 122 + 4 * i, 30, 2, 8, i >= bars ? MENU_TITLE_DISABLE_COLOR : MENU_TITLE_COLOR); + } +#if defined(USB_CHARGER) } - +#endif topbar->refresh(); #if 0 diff --git a/radio/src/targets/horus/CMakeLists.txt b/radio/src/targets/horus/CMakeLists.txt index 601d82dfb..95f6e8c61 100644 --- a/radio/src/targets/horus/CMakeLists.txt +++ b/radio/src/targets/horus/CMakeLists.txt @@ -61,10 +61,11 @@ if (PCB STREQUAL X10) add_definitions(-DRADIO_FAMILY_T16) option(INTERNAL_MODULE_MULTI "Support for MULTI internal module" ON) option(BLUETOOTH "Support for bluetooth module" OFF) + set(HARDWARE_TOUCH YES) + set(USB_CHARGER YES) if (NOT BLUETOOTH) set(AUX_SERIAL ON) endif() - set(USB_CHARGER YES) else() set(FLAVOUR x10) option(INTERNAL_MODULE_PXX1 "Support for PXX1 internal module" ON) @@ -207,6 +208,11 @@ set(TARGET_SRC ../common/arm/stm32/rotary_encoder_driver.cpp ) +if(HARDWARE_TOUCH) + set(TARGET_SRC ${TARGET_SRC} ft5x06.cpp) + add_definitions(-DHARDWARE_TOUCH) +endif() + if(USB_CHARGER) set(TARGET_SRC ${TARGET_SRC} usb_charger_driver.cpp) add_definitions(-DUSB_CHARGER) diff --git a/radio/src/targets/horus/ft5x06.cpp b/radio/src/targets/horus/ft5x06.cpp new file mode 100644 index 000000000..47765bbc7 --- /dev/null +++ b/radio/src/targets/horus/ft5x06.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (C) OpenTX + * + * Based on code named + * 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 "ft5x06.h" \ No newline at end of file diff --git a/radio/src/targets/horus/ft5x06.h b/radio/src/targets/horus/ft5x06.h new file mode 100644 index 000000000..a4d6b1f54 --- /dev/null +++ b/radio/src/targets/horus/ft5x06.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) OpenTX + * + * Based on code named + * 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. + */ + +#ifndef _FT5X06_H_ +#define _FT5X06_H_ + +#endif // _FT5X06_H_