diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 76fb8130a..a4dff18f0 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -29,6 +29,7 @@ jobs: - X10 - X12S - X7 + - X9D - X9DP - X9DP2019 - X9LITE diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e3c663190..b4a213c74 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -28,6 +28,7 @@ jobs: - X10 - X12S - X7 + - X9D - X9DP - X9DP2019 - X9LITE diff --git a/fw.json b/fw.json index c6290644b..22102d1f2 100644 --- a/fw.json +++ b/fw.json @@ -2,12 +2,14 @@ "targets": [ ["TX16s", "tx16s-"], ["QX7", "x7-"], + ["X9D", "x9d-"], ["X9D Plus", "x9dp-"], ["X9D Plus 2019", "x9dp2019-"], ["T-Lite", "tlite-"], ["X-Lite", "xlite-"], ["X9 Lite", "x9lite-"], ["T16", "t16-"], + ["T18", "t18-"], ["TX12", "tx12-"], ["Horus X12s", "x12s-"], ["Horus X10", "x10-"], @@ -15,4 +17,4 @@ ["T8", "t8-"] ], "changelog": "- Major initial bug fixes" -} \ No newline at end of file +} diff --git a/radio/src/gui/128x64/model_setup.cpp b/radio/src/gui/128x64/model_setup.cpp index 12ddf963d..08f1072c1 100644 --- a/radio/src/gui/128x64/model_setup.cpp +++ b/radio/src/gui/128x64/model_setup.cpp @@ -1576,6 +1576,7 @@ void menuModelSetup(event_t event) if (MULTIMODULE_PROTOCOL_KNOWN(moduleIdx)) { const char * title = getMultiOptionTitle(moduleIdx); + if (!title) break; lcdDrawText(INDENT_WIDTH, y, title); if (title == STR_MULTI_RFTUNE) { lcdDrawText(MODEL_SETUP_2ND_COLUMN + 23, y, "RSSI(", LEFT); diff --git a/radio/src/gui/colorlcd/model_select.cpp b/radio/src/gui/colorlcd/model_select.cpp index da6209d0e..9a4a0115b 100644 --- a/radio/src/gui/colorlcd/model_select.cpp +++ b/radio/src/gui/colorlcd/model_select.cpp @@ -277,7 +277,9 @@ class ModelCategoryPageBody : public FormWindow #endif } - y += MODEL_SELECT_CELL_HEIGHT + MODEL_CELL_PADDING; + if (index % MODEL_CELLS_PER_LINE != 0) { + y += MODEL_SELECT_CELL_HEIGHT + MODEL_CELL_PADDING; + } setInnerHeight(y); if (category->empty()) { diff --git a/radio/src/gui/colorlcd/radio_sdmanager.cpp b/radio/src/gui/colorlcd/radio_sdmanager.cpp index de720ed17..cd442c3c1 100644 --- a/radio/src/gui/colorlcd/radio_sdmanager.cpp +++ b/radio/src/gui/colorlcd/radio_sdmanager.cpp @@ -92,6 +92,10 @@ class FileNameEditWindow : public Page RadioSdManagerPage::RadioSdManagerPage() : PageTab(SD_IS_HC() ? STR_SDHC_CARD : STR_SD_CARD, ICON_RADIO_SD_MANAGER) { + setOnSetVisibleHandler([]() { + TRACE("f_chdir(ROOT_PATH)"); + f_chdir(ROOT_PATH); + }); } void RadioSdManagerPage::rebuild(FormWindow * window) @@ -115,6 +119,13 @@ char * getFullPath(const std::string &filename) return full_path; } +char * getCurrentPath() +{ + static char path[FF_MAX_LFN + 1]; // TODO optimize that! + f_getcwd((TCHAR*)path, FF_MAX_LFN); + return path; +} + class FilePreview : public Window { public: @@ -209,6 +220,7 @@ void RadioSdManagerPage::build(FormWindow * window) std::list files; std::list directories; + std::string currentPath(getCurrentPath()); auto preview = new FilePreview(window, {LCD_W / 2 + 6, 0, LCD_W / 2 - 16, window->height()}); FRESULT res = f_opendir(&dir, "."); // Open the directory @@ -238,7 +250,8 @@ void RadioSdManagerPage::build(FormWindow * window) for (auto name: directories) { auto b = new TextButton(window, grid.getLabelSlot(), name, [=]() -> uint8_t { - f_chdir(name.data()); + std::string fullpath = currentPath + "/" + name; + f_chdir(fullpath.c_str()); window->clear(); build(window); return 0; @@ -250,6 +263,7 @@ void RadioSdManagerPage::build(FormWindow * window) for (auto name: files) { auto button = new TextButton(window, grid.getLabelSlot(), name, [=]() -> uint8_t { auto menu = new Menu(window); + f_chdir(currentPath.c_str()); const char *ext = getFileExtension(name.data()); if (ext) { if (!strcasecmp(ext, SOUNDS_EXT)) { @@ -286,14 +300,14 @@ void RadioSdManagerPage::build(FormWindow * window) dialog->flash(getFullPath(name)); }); } - else if (isExtensionMatching(ext, BITMAPS_EXT)) { - // TODO - } - else if (!strcasecmp(ext, TEXT_EXT)) { - menu->addLine(STR_VIEW_TEXT, [=]() { - // TODO - }); - } + // else if (isExtensionMatching(ext, BITMAPS_EXT)) { + // // TODO + // } + // else if (!strcasecmp(ext, TEXT_EXT)) { + // menu->addLine(STR_VIEW_TEXT, [=]() { + // // TODO + // }); + // } if (!READ_ONLY() && !strcasecmp(ext, FIRMWARE_EXT)) { if (isBootloader(name.data())) { menu->addLine(STR_FLASH_BOOTLOADER, [=]() { @@ -328,8 +342,9 @@ void RadioSdManagerPage::build(FormWindow * window) } #if defined(LUA) else if (isExtensionMatching(ext, SCRIPTS_EXT)) { + std::string fullpath = currentPath + "/" + name; menu->addLine(STR_EXECUTE_FILE, [=]() { - luaExec(getFullPath(name)); + luaExec(fullpath.c_str()); //TODO: check 'luaState' StandaloneLuaWindow::instance()->attach(window); }); @@ -374,7 +389,8 @@ void RadioSdManagerPage::build(FormWindow * window) }); } return 0; - }, 0); + }, OPAQUE); + button->setBgColorHandler([=]() -> LcdFlags { return FIELD_BGCOLOR; }); button->setFocusHandler([=](bool active) { if (active) { preview->setFile(getFullPath(name)); diff --git a/radio/src/gui/colorlcd/radio_tools.cpp b/radio/src/gui/colorlcd/radio_tools.cpp index 3484f2495..9f83dda45 100644 --- a/radio/src/gui/colorlcd/radio_tools.cpp +++ b/radio/src/gui/colorlcd/radio_tools.cpp @@ -119,10 +119,14 @@ void RadioToolsPage::rebuild(FormWindow * window) auto b = new TextButton( window, grid.getFieldSlot(1), label, [window, path_str]() -> uint8_t { - f_chdir("/SCRIPTS/TOOLS/"); - luaExec(path_str.c_str()); - // TODO: check 'luaState' + + char toolPath[FF_MAX_LFN + 1]; + strncpy(toolPath, path_str.c_str(), sizeof(toolPath)-1); + *((char *)getBasename(toolPath)-1) = '\0'; + f_chdir(toolPath); + StandaloneLuaWindow::instance()->attach(window); + luaExec(path_str.c_str()); return 0; }, OPAQUE); @@ -255,6 +259,7 @@ void RadioToolsPage::rebuild(FormWindow * window) } #endif #if defined(PXX2) +#if 0 // disabled Power Meter: not yet implemented if (isPXX2ModuleOptionAvailable( reusableBuffer.hardwareAndSettings.modules[EXTERNAL_MODULE] .information.modelID, @@ -282,8 +287,10 @@ void RadioToolsPage::rebuild(FormWindow * window) grid.nextLine(); } #endif +#endif #if defined(GHOST) +#if 0 if (isModuleGhost(EXTERNAL_MODULE)) { auto txt = new StaticText(window, grid.getLabelSlot(), "ghost", BUTTON_BACKGROUND, CENTERED); @@ -307,6 +314,7 @@ void RadioToolsPage::rebuild(FormWindow * window) }); grid.nextLine(); } +#endif #endif window->setInnerHeight(grid.getWindowHeight()); diff --git a/radio/src/gui/colorlcd/special_functions.cpp b/radio/src/gui/colorlcd/special_functions.cpp index 72814bcd7..92de8cc49 100644 --- a/radio/src/gui/colorlcd/special_functions.cpp +++ b/radio/src/gui/colorlcd/special_functions.cpp @@ -76,7 +76,7 @@ class SpecialFunctionEditPage : public Page window, {PAGE_TITLE_LEFT, PAGE_TITLE_TOP + PAGE_LINE_HEIGHT, LCD_W - PAGE_TITLE_LEFT, 20}, - (functions == g_model.customFn ? "SF" : "GF") + std::to_string(index), + (functions == g_model.customFn ? "SF" : "GF") + std::to_string(index+1), 0, FOCUS_COLOR); } @@ -526,7 +526,7 @@ void SpecialFunctionsPage::build(FormWindow *window, int8_t focusIndex) for (uint8_t i = 0; i < MAX_SPECIAL_FUNCTIONS; i++) { CustomFunctionData *cfn = &functions[i]; - strAppendUnsigned(&s[2], i); + strAppendUnsigned(&s[2], i+1); if (cfn->swtch == 0) { auto button = new TextButton(window, grid.getLabelSlot(), s); diff --git a/radio/src/gui/colorlcd/tabsgroup.cpp b/radio/src/gui/colorlcd/tabsgroup.cpp index a0b7c32a8..f3ea3163b 100644 --- a/radio/src/gui/colorlcd/tabsgroup.cpp +++ b/radio/src/gui/colorlcd/tabsgroup.cpp @@ -146,9 +146,10 @@ void TabsGroup::setVisibleTab(PageTab * tab) Keyboard::hide(); #endif currentTab = tab; + if (tab->onSetVisible) tab->onSetVisible(); tab->build(&body); - if (!focusWindow) - setFocus(SET_FOCUS_DEFAULT); + if (!focusWindow) setFocus(SET_FOCUS_DEFAULT); + header.setTitle(tab->title.c_str()); invalidate(); } diff --git a/radio/src/gui/colorlcd/tabsgroup.h b/radio/src/gui/colorlcd/tabsgroup.h index d3af8c15d..1618bf7a0 100644 --- a/radio/src/gui/colorlcd/tabsgroup.h +++ b/radio/src/gui/colorlcd/tabsgroup.h @@ -50,17 +50,9 @@ class PageTab { { } - void destroy() + void setOnSetVisibleHandler(std::function handler) { - if (onPageDestroyed) { - onPageDestroyed(); - } - delete this; - } - - void setOnPageDestroyedHandler(std::function handler) - { - onPageDestroyed = std::move(handler); + onSetVisible = std::move(handler); } void setTitle(std::string value) @@ -81,7 +73,7 @@ class PageTab { protected: std::string title; unsigned icon = 0; - std::function onPageDestroyed; + std::function onSetVisible; }; class TabsCarousel: public Window { diff --git a/radio/src/gui/colorlcd/widgets/modelbmp.cpp b/radio/src/gui/colorlcd/widgets/modelbmp.cpp index 0d5a8d3cd..4c2d96c12 100644 --- a/radio/src/gui/colorlcd/widgets/modelbmp.cpp +++ b/radio/src/gui/colorlcd/widgets/modelbmp.cpp @@ -29,48 +29,44 @@ class ModelBitmapWidget: public Widget ModelBitmapWidget(const WidgetFactory * factory, FormGroup * parent, const rect_t & rect, Widget::PersistentData * persistentData): Widget(factory, parent, rect, persistentData) { + loadBitmap(); } void refresh(BitmapBuffer * dc) override { - if (buffer && ((buffer->width() != width()) || (buffer->height() != height()))) { + if (buffer && + ((buffer->width() != width()) || (buffer->height() != height()) || + (deps_hash != getHash()))) { loadBitmap(); } // big space to draw if (rect.h >= 96 && rect.w >= 120) { - dc->drawFilledRect(0, 0, rect.w, rect.h, SOLID, MAINVIEW_PANES_COLOR, OPACITY(5)); - + if (buffer) { + dc->drawBitmap(0, 0, buffer.get()); + } + auto iconMask = theme->getIconMask(ICON_MODEL); if (iconMask) { - dc->drawMask(6, 4, iconMask, MAINVIEW_GRAPHICS_COLOR); + dc->drawMask(6, 4, iconMask, HEADER_COLOR); } - dc->drawSizedText(45, 10, g_model.header.name, LEN_MODEL_NAME, FONT(XS)); - dc->drawSolidFilledRect(39, 27, rect.w - 48, 2, MAINVIEW_GRAPHICS_COLOR); - - if (buffer) { - dc->drawBitmap(0, 38, buffer.get()); - } + dc->drawSizedText(45, 10, g_model.header.name, LEN_MODEL_NAME, + FONT(XS) | DEFAULT_COLOR); + dc->drawSolidFilledRect(39, 27, rect.w - 48, 2, HEADER_COLOR); } // smaller space to draw else if (buffer) { - dc->drawBitmap(0, 38, buffer.get()); - } + dc->drawBitmap(0, 0, buffer.get()); + } } void checkEvents() override { Widget::checkEvents(); - - uint32_t new_hash = hash(g_model.header.bitmap, sizeof(g_model.header.bitmap)); - new_hash ^= hash(g_model.header.name, sizeof(g_model.header.name)); - new_hash ^= hash(g_eeGeneral.themeName, sizeof(g_eeGeneral.themeName)); - - if (new_hash != deps_hash) { - deps_hash = new_hash; - loadBitmap(); + if (getHash() != deps_hash) { + invalidate(); } } @@ -78,6 +74,11 @@ class ModelBitmapWidget: public Widget std::unique_ptr buffer; uint32_t deps_hash = 0; + uint32_t getHash() + { + return hash(g_model.header.bitmap, sizeof(g_model.header.bitmap)); + } + void loadBitmap() { std::string filename = std::string(g_model.header.bitmap); @@ -94,7 +95,7 @@ class ModelBitmapWidget: public Widget } buffer->clear(DEFAULT_BGCOLOR); - buffer->drawScaledBitmap(bitmap.get(), 0, 0, width(), height() - 38); + buffer->drawScaledBitmap(bitmap.get(), 0, 38, width(), height() - 38); } }; diff --git a/radio/src/lua/api_colorlcd.cpp b/radio/src/lua/api_colorlcd.cpp index c83229c16..cff137481 100644 --- a/radio/src/lua/api_colorlcd.cpp +++ b/radio/src/lua/api_colorlcd.cpp @@ -783,9 +783,6 @@ Set a color for specific area */ static int luaLcdSetColor(lua_State *L) { - if (!luaLcdAllowed) - return 0; - unsigned int index = luaL_checkunsigned(L, 1) >> 16; unsigned int color = luaL_checkunsigned(L, 2); @@ -806,9 +803,6 @@ Get the color for specific area : see lcd.setColor for area list static int luaLcdGetColor(lua_State *L) { - if (!luaLcdAllowed) - return 0; - unsigned int index = luaL_checkunsigned(L, 1) >> 16; lua_pushunsigned(L, lcdColorTable[index]); @@ -834,9 +828,6 @@ Returns a 5/6/5 rgb color code, that can be used with lcd.setColor */ static int luaRGB(lua_State *L) { - if (!luaLcdAllowed) - return 0; - int r = luaL_checkinteger(L, 1); int g = luaL_checkinteger(L, 2); int b = luaL_checkinteger(L, 3); diff --git a/radio/src/pulses/modules_helpers.h b/radio/src/pulses/modules_helpers.h index 227aa974d..c33a433c4 100644 --- a/radio/src/pulses/modules_helpers.h +++ b/radio/src/pulses/modules_helpers.h @@ -678,7 +678,6 @@ inline void resetMultiProtocolsOptions(uint8_t moduleIdx) else { g_model.moduleData[moduleIdx].multi.autoBindMode = 0; } - g_model.moduleData[moduleIdx].subType = 0; g_model.moduleData[moduleIdx].multi.optionValue = 0; g_model.moduleData[moduleIdx].multi.disableTelemetry = 0; g_model.moduleData[moduleIdx].multi.disableMapping = 0; diff --git a/radio/src/storage/conversions/conversions.cpp b/radio/src/storage/conversions/conversions.cpp index 18e52d6a0..7071b7540 100644 --- a/radio/src/storage/conversions/conversions.cpp +++ b/radio/src/storage/conversions/conversions.cpp @@ -75,7 +75,10 @@ void convertRadioData(int version) #if defined(SIMU) RTOS_WAIT_MS(200); #endif - + + // Load models list before converting + modelslist.load(); + const char* error = nullptr; for (auto category_ptr : modelslist.getCategories()) { for (auto model_ptr : *category_ptr) { diff --git a/radio/src/storage/sdcard_common.cpp b/radio/src/storage/sdcard_common.cpp index cdf755ee8..4f3a7b910 100644 --- a/radio/src/storage/sdcard_common.cpp +++ b/radio/src/storage/sdcard_common.cpp @@ -149,9 +149,6 @@ void storageReadAll() // it's being reloaded after USB connection modelslist.clear(); - // and reload the list - modelslist.load(); - if (loadRadioSettings() != nullptr) { storageEraseAll(true); } @@ -163,6 +160,9 @@ void storageReadAll() } } + // and reload the list + modelslist.load(); + // Current model filename is empty... // Let's fix it! if (strlen(g_eeGeneral.currModelFilename) == 0) { diff --git a/radio/src/targets/horus/CMakeLists.txt b/radio/src/targets/horus/CMakeLists.txt index 1ff27544a..bfbb3153e 100644 --- a/radio/src/targets/horus/CMakeLists.txt +++ b/radio/src/targets/horus/CMakeLists.txt @@ -106,6 +106,7 @@ 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) add_definitions(-DMANUFACTURER_JUMPER) else() set(FLAVOUR x10) diff --git a/radio/src/targets/horus/hal.h b/radio/src/targets/horus/hal.h index 82d6d8b2a..752ed29d4 100644 --- a/radio/src/targets/horus/hal.h +++ b/radio/src/targets/horus/hal.h @@ -707,15 +707,27 @@ #endif // I2C Bus -#define I2C_RCC_AHB1Periph RCC_AHB1Periph_GPIOB -#define I2C_RCC_APB1Periph RCC_APB1Periph_I2C1 -#define I2C I2C1 -#define I2C_GPIO GPIOB -#define I2C_SCL_GPIO_PIN GPIO_Pin_8 // PB.08 -#define I2C_SDA_GPIO_PIN GPIO_Pin_9 // PB.09 -#define I2C_GPIO_AF GPIO_AF_I2C1 -#define I2C_SCL_GPIO_PinSource GPIO_PinSource8 -#define I2C_SDA_GPIO_PinSource GPIO_PinSource9 +#if defined(RADIO_T18) + #define I2C_RCC_AHB1Periph RCC_AHB1Periph_GPIOH + #define I2C_RCC_APB1Periph RCC_APB1Periph_I2C3 + #define I2C I2C3 + #define I2C_GPIO GPIOH + #define I2C_SCL_GPIO_PIN GPIO_Pin_7 // PH.07 + #define I2C_SDA_GPIO_PIN GPIO_Pin_8 // PH.08 + #define I2C_GPIO_AF GPIO_AF_I2C3 + #define I2C_SCL_GPIO_PinSource GPIO_PinSource7 + #define I2C_SDA_GPIO_PinSource GPIO_PinSource8 +#else + #define I2C_RCC_AHB1Periph RCC_AHB1Periph_GPIOB + #define I2C_RCC_APB1Periph RCC_APB1Periph_I2C1 + #define I2C I2C1 + #define I2C_GPIO GPIOB + #define I2C_SCL_GPIO_PIN GPIO_Pin_8 // PB.08 + #define I2C_SDA_GPIO_PIN GPIO_Pin_9 // PB.09 + #define I2C_GPIO_AF GPIO_AF_I2C1 + #define I2C_SCL_GPIO_PinSource GPIO_PinSource8 + #define I2C_SDA_GPIO_PinSource GPIO_PinSource9 +#endif #define I2C_SPEED 400000 // Haptic diff --git a/radio/src/targets/horus/tp_gt911.cpp b/radio/src/targets/horus/tp_gt911.cpp index eb8753e6f..6915a4a90 100644 --- a/radio/src/targets/horus/tp_gt911.cpp +++ b/radio/src/targets/horus/tp_gt911.cpp @@ -22,6 +22,196 @@ #include "tp_gt911.h" #include "touch.h" +#if defined (RADIO_T18) +const uint8_t TOUCH_GT911_Cfg[] = { + GT911_CFG_NUMER, // 0x8047 Config version + 0xE0, // 0x8048 X output map : x 480 + 0x01, + 0x10, // 0x804A Y ouptut max : y 272 + 0x01, + GT911_MAX_TP, // 0x804C Touch number + 0x0C, // 0x804D Module switch 1 : bit4= xy change Int mode + 0x00, // 0x804E Module switch 2 + 0x01, // 0x804F Shake_Count + 0x18, // 0x8050 Filter + 0x28, // 0x8051 Larger touch + 0x0F, // 0x8052 Noise reduction + 0x50, // 0x8053 Screen touch level + 0x3C, // 0x8054 Screen touch leave + 0x03, // 0x8055 Low power control + 0x05, // 0x8056 Refresh rate + 0x00, // 0x8057 X threshold + 0x00, // 0x8058 Y threshold + 0x00, // 0x8059 Reserved + 0x00, // 0x805A Reserved + 0x00, // 0x805B Space (top, bottom) + 0x00, // 0x805C Space (left, right) + 0x04, // 0x805D Mini filter + 0x18, // 0x805E Strech R0 + 0x1A, // 0x805F Strech R1 + 0x1E, // 0x8060 Strech R2 + 0x14, // 0x8061 Strech RM + 0x87, // 0x8062 Drv groupA num + 0x29, // 0x8063 Drv groupB num + 0x0A, // 0x8064 Sensor num + 0x4B, // 0x8065 FreqA factor + 0x4D, // 0x8066 FreqB factor + 0xD3, // 0x8067 Panel bit freq + 0x07, + 0x00, // 0x8069 Reserved + 0x00, + 0x00, // 0x806B Panel tx gain + 0x19, // 0x806C Panel rx gain + 0x02, // 0x806D Panel dump shift + 0x10, // 0x806E Drv frame control + 0x32, // 0x806F Charging level up + 0x00, // 0x8070 Module switch 3 + 0x00, // 0x8071 Gesture distance + 0x00, // 0x8072 Gesture long press time + 0x00, // 0x8073 X/Y slope adjust + 0x03, // 0x8074 Gesture control + 0x00, // 0x8075 Gesture switch 1 + 0x00, // 0x8076 Gesture switch 2 + 0x00, // 0x8077 Gesture refresh rate + 0x00, // 0x8078 Gesture touch level + 0x00, // 0x8079 New green wake up level + 0x32, // 0x807A Freq hopping start + 0x73, // 0x807B Freq hopping end + 0x94, // 0x807C Noise detect time + 0xD5, // 0x807D Hopping flag + 0x02, // 0x807E Hopping flag + 0x07, // 0x807F Noise threshold + 0x00, // 0x8080 Nois min threshold old + 0x00, // 0x8081 Reserved + 0x04, // 0x8082 Hopping sensor group + 0xAE, // 0x8083 Hopping Seg1 normalize + 0x36, // 0x8084 Hopping Seg1 factor + 0x00, // 0x8085 Main clock adjust + 0x94, // 0x8086 Hopping Seg2 normalize + 0x40, // 0x8087 Hopping Seg2 factor + 0x00, // 0x8088 Reserved + 0x7E, // 0x8089 Hopping Seg3 normalize + 0x4C, // 0x808A Hopping Seg3 factor + 0x00, // 0x808B Reserved + 0x6D, // 0x808C Hopping Seg4 normalize + 0x59, // 0x808D Hopping Seg4 factor + 0x00, // 0x808E Reserved + 0x5D, // 0x808F Hopping Seg5 normalize + 0x6A, // 0x8090 Hopping Seg5 factor + 0x00, // 0x8091 Reserved + 0x5D, // 0x8092 Hopping Seg6 normalize + 0x00, // 0x8093 Key1 + 0x00, // 0x8094 Key2 + 0x00, // 0x8095 Key3 + 0x00, // 0x8096 Key4 + 0x00, // 0x8097 Key area + 0x00, // 0x8098 Key touch level + 0x00, // 0x8099 Key leave level + 0x00, // 0x809A Key sens + 0x00, // 0x809B Key sens + 0x00, // 0x809C Key restrain + 0x00, // 0x809D Key restrain time + 0x00, // 0x809E Large gesture touch + 0x00, // 0x809F Reserved + 0x00, // 0x80A0 Reserved + 0x00, // 0x80A1 Hotknot noise map + 0x00, // 0x80A2 Link threshold + 0x00, // 0x80A3 Pxy threshold + 0x00, // 0x80A4 GHot dump shift + 0x00, // 0x80A5 GHot rx gain + 0x00, // 0x80A6 Freg gain + 0x00, // 0x80A7 Freg gain 1 + 0x00, // 0x80A8 Freg gain 2 + 0x00, // 0x80A9 Freg gain 3 + 0x00, // 0x80AA Reserved + 0x00, // 0x80AB Reserved + 0x00, // 0x80AC Reserved + 0x00, // 0x80AD Reserved + 0x00, // 0x80AE Reserved + 0x00, // 0x80AF Reserved + 0x00, // 0x80B0 Reserved + 0x00, // 0x80B1 Reserved + 0x00, // 0x80B2 Reserved + 0x00, // 0x80B3 Combine dis + 0x00, // 0x80B4 Split set + 0x00, // 0x80B5 Reserved + 0x00, // 0x80B6 Reserved + 0x0A, // 0x80B7 Sensor CH0 + 0x0C, // 0x80B8 Sensor CH1 + 0x0E, // 0x80B9 Sensor CH2 + 0x10, // 0x80BA Sensor CH3 + 0x12, // 0x80BB Sensor CH4 + 0x14, // 0x80BC Sensor CH5 + 0x16, // 0x80BD Sensor CH6 + 0x18, // 0x80BE Sensor CH7 + 0x1A, // 0x80BF Sensor CH8 + 0x1C, // 0x80C0 Sensor CH9 + 0xFF, // 0x80C1 Sensor CH10 + 0xFF, // 0x80C2 Sensor CH11 + 0xFF, // 0x80C3 Sensor CH12 + 0xFF, // 0x80C4 Sensor CH13 + 0xFF, // 0x80C5 Reserved + 0xFF, // 0x80C6 Reserved + 0xFF, // 0x80C7 Reserved + 0xFF, // 0x80C8 Reserved + 0xFF, // 0x80C9 Reserved + 0xFF, // 0x80CA Reserved + 0xFF, // 0x80CB Reserved + 0xFF, // 0x80CC Reserved + 0xFF, // 0x80CD Reserved + 0xFF, // 0x80CE Reserved + 0xFF, // 0x80CF Reserved + 0xFF, // 0x80D0 Reserved + 0xFF, // 0x80D1 Reserved + 0xFF, // 0x80D2 Reserved + 0xFF, // 0x80D3 Reserved + 0xFF, // 0x80D4 Reserved + 0x00, // 0x80D5 Driver CH0 + 0x02, // 0x80D6 Driver CH1 + 0x04, // 0x80D7 Driver CH2 + 0x06, // 0x80D8 Driver CH3 + 0x08, // 0x80D9 Driver CH4 + 0x0A, // 0x80DA Driver CH5 + 0x0C, // 0x80DB Driver CH6 + 0x1D, // 0x80DC Driver CH7 + 0x1E, // 0x80DD Driver CH8 + 0x1F, // 0x80DE Driver CH9 + 0x20, // 0x80DF Driver CH10 + 0x21, // 0x80E0 Driver CH11 + 0x22, // 0x80E1 Driver CH12 + 0x24, // 0x80E2 Driver CH13 + 0x26, // 0x80E3 Driver CH14 + 0x28, // 0x80E4 Driver CH15 + 0xFF, // 0x80E5 Driver CH16 + 0xFF, // 0x80E6 Driver CH17 + 0xFF, // 0x80E7 Driver CH18 + 0xFF, // 0x80E8 Driver CH19 + 0xFF, // 0x80E9 Driver CH20 + 0xFF, // 0x80EA Driver CH21 + 0xFF, // 0x80EB Driver CH22 + 0xFF, // 0x80EC Driver CH23 + 0xFF, // 0x80ED Driver CH24 + 0xFF, // 0x80EE Driver CH25 + 0xFF, // 0x80EF Reserved + 0xFF, // 0x80F0 Reserved + 0xFF, // 0x80F1 Reserved + 0xFF, // 0x80F2 Reserved + 0xFF, // 0x80F3 Reserved + 0xFF, // 0x80F4 Reserved + 0xFF, // 0x80F5 Reserved + 0xFF, // 0x80F6 Reserved + 0xFF, // 0x80F7 Reserved + 0xFF, // 0x80F8 Reserved + 0xFF, // 0x80F9 Reserved + 0xFF, // 0x80FA Reserved + 0xFF, // 0x80FB Reserved + 0xFF, // 0x80FC Reserved + 0xFF, // 0x80FD Reserved + 0xFF // 0x80FE Reserved +}; + +#else + //GT911 param table const uint8_t TOUCH_GT911_Cfg[] = { @@ -211,6 +401,8 @@ const uint8_t TOUCH_GT911_Cfg[] = 0x00 // 0x80FE Reserved }; +#endif + uint8_t touchGT911Flag = 0; uint8_t touchEventOccured = 0; struct TouchData touchData; diff --git a/radio/src/targets/horus/tp_gt911.h b/radio/src/targets/horus/tp_gt911.h index 624db2c92..ce48a680f 100644 --- a/radio/src/targets/horus/tp_gt911.h +++ b/radio/src/targets/horus/tp_gt911.h @@ -30,7 +30,7 @@ void touchPanelRead(); bool touchPanelEventOccured(); #define GT911_MAX_TP 5 -#define GT911_CFG_NUMER 0x6A +#define GT911_CFG_NUMER 0x6C //I2C #define GT_CMD_WR 0X28 diff --git a/tools/build-gh.sh b/tools/build-gh.sh index 2ccc0f914..528024fa8 100755 --- a/tools/build-gh.sh +++ b/tools/build-gh.sh @@ -100,6 +100,9 @@ case $FLAVOR in XLITES) BUILD_OPTIONS+="-DPCB=XLITES" ;; + X9D) + BUILD_OPTIONS+="-DPCB=X9D" + ;; X9DP) BUILD_OPTIONS+="-DPCB=X9D+" ;;