Added touch type display
This commit is contained in:
committed by
Malte Langermann
parent
c5270e1e61
commit
fcd30f0c77
@@ -340,6 +340,7 @@ RadioVersionPage::RadioVersionPage() :
|
||||
|
||||
#if defined(PCBNV14) || defined(PCBPL18)
|
||||
extern const char* boardLcdType;
|
||||
extern const char* boardTouchType;
|
||||
#endif
|
||||
|
||||
void RadioVersionPage::build(Window* window)
|
||||
@@ -370,6 +371,9 @@ void RadioVersionPage::build(Window* window)
|
||||
version += nl;
|
||||
version += "LCD: ";
|
||||
version += boardLcdType;
|
||||
version += nl;
|
||||
version += "Touch: ";
|
||||
version += boardTouchType;
|
||||
#endif
|
||||
|
||||
auto txt = new StaticText(window, rect_t{}, version);
|
||||
|
||||
@@ -107,6 +107,7 @@ union rpt_point_t
|
||||
|
||||
extern uint8_t TouchControllerType;
|
||||
|
||||
const char* boardTouchType = "";
|
||||
static const TouchControllerDescriptor *tcd = nullptr;
|
||||
static TouchState internalTouchState = {};
|
||||
volatile static bool touchEventOccured;
|
||||
@@ -323,14 +324,17 @@ void _detect_touch_controller()
|
||||
if (stm32_i2c_is_dev_ready(TOUCH_I2C_BUS, TOUCH_CST340_I2C_ADDRESS, 3, I2C_TIMEOUT_MAX) == 0) {
|
||||
touchController = TC_CST340;
|
||||
tcd = &CST340;
|
||||
boardTouchType = "CST340";
|
||||
TouchControllerType = 0;
|
||||
} else if (stm32_i2c_is_dev_ready(TOUCH_I2C_BUS, TOUCH_CHSC5448_I2C_ADDRESS, 3, I2C_TIMEOUT_MAX) == 0) {
|
||||
touchController = TC_CHSC5448;
|
||||
tcd = &CHSC5448;
|
||||
TouchControllerType = 0;
|
||||
boardTouchType = "CHSC5448";
|
||||
} else {
|
||||
touchController = TC_FT6236;
|
||||
tcd = &FT6236;
|
||||
boardTouchType = "FT6236";
|
||||
#if defined(RADIO_NB4P)
|
||||
TouchControllerType = 0;
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user