Skip to content

Commit

Permalink
Cleaned up touch driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardclli committed Nov 15, 2023
1 parent 88cc2c4 commit 824eff3
Show file tree
Hide file tree
Showing 5 changed files with 504 additions and 5 deletions.
2 changes: 1 addition & 1 deletion radio/src/targets/pl18/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ endif()
set(BITMAPS_TARGET pl18_bitmaps)
set(FONTS_TARGET x12_fonts)
set(LCD_DRIVER lcd_driver.cpp)
set(TOUCH_DRIVER tp_cst340.cpp)
set(TOUCH_DRIVER touch_driver.cpp)
set(HARDWARE_TOUCH YES)
set(RADIO_DEPENDENCIES ${RADIO_DEPENDENCIES} ${BITMAPS_TARGET})
set(FIRMWARE_DEPENDENCIES datacopy)
Expand Down
2 changes: 0 additions & 2 deletions radio/src/targets/pl18/battery_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ void drawChargingInfo(uint16_t chargeState) {
lcd->drawFilledRect((LCD_W - BATTERY_CONNECTOR_W) / 2, BATTERY_TOP - BATTERY_CONNECTOR_H, BATTERY_CONNECTOR_W, BATTERY_CONNECTOR_H, SOLID, COLOR_THEME_PRIMARY2);
}
#define CHARGE_INFO_DURATION 500
void TouchInit();

//this method should be called by timer interrupt or by GPIO interrupt
void handle_battery_charge(uint32_t last_press_time)
Expand Down Expand Up @@ -401,7 +400,6 @@ void handle_battery_charge(uint32_t last_press_time)
lcdInit();
lcdInitDisplayDriver();
lcdInited = true;
TouchInit();
}
else {
lcdOn();
Expand Down
4 changes: 2 additions & 2 deletions radio/src/targets/pl18/board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "timers_driver.h"

#include "battery_driver.h"
#include "tp_cst340.h"
#include "touch_driver.h"
#include "watchdog_driver.h"

#include "bitmapbuffer.h"
Expand Down Expand Up @@ -160,7 +160,7 @@ void boardInit()
battery_charge_init();
flysky_gimbal_init();
timersInit();
TouchInit();
touchPanelInit();
usbInit();

uint32_t press_start = 0;
Expand Down
Loading

0 comments on commit 824eff3

Please sign in to comment.