Touscreen click fix
This commit is contained in:
parent
8d23a3b1a1
commit
6dd655d9e5
@ -13,7 +13,7 @@
|
||||
|
||||
void ADS7843_Init(ADS7843_Def* def){
|
||||
uint8_t control = (0x80) | (ADS7843_X_CHANNEL << ADS7843_CHANNEL) | (ADS7843_12BIT << ADS7843_BIT_MODE) | (ADS7843_DFR << ADS7843_DIFF_MODE) | (ADS7843_POWER_PENIRQ << ADS7843_POW_MODE);
|
||||
uint16_t data = ADS7843_GetData(def, control);
|
||||
ADS7843_GetData(def, control);
|
||||
}
|
||||
|
||||
uint16_t ADS7843_GetData(ADS7843_Def* def, uint8_t control){
|
||||
@ -41,7 +41,7 @@ uint16_t ADS7843_GetData(ADS7843_Def* def, uint8_t control){
|
||||
}
|
||||
|
||||
GPIO_PinState ADS7843_Touched(ADS7843_Def* def){
|
||||
return HAL_GPIO_ReadPin(def->Int_GPIO_Port, def->Int_GPIO_Pin);
|
||||
return !HAL_GPIO_ReadPin(def->Int_GPIO_Port, def->Int_GPIO_Pin);
|
||||
}
|
||||
|
||||
uint16_t ADS7843_GetX_Raw(ADS7843_Def* def){
|
||||
|
@ -107,12 +107,14 @@ void my_flush_cb(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * buf)
|
||||
}
|
||||
|
||||
void touchscreen_read_callback(lv_indev_drv_t * drv, lv_indev_data_t*data){
|
||||
data->point.x = ADS7843_GetX(&Touch_Def);
|
||||
data->point.y = ADS7843_GetY(&Touch_Def);
|
||||
if(ADS7843_Touched(&Touch_Def)) {
|
||||
data->state = LV_INDEV_STATE_PRESSED;
|
||||
data->point.x = ADS7843_GetX(&Touch_Def);
|
||||
data->point.y = ADS7843_GetY(&Touch_Def);
|
||||
} else {
|
||||
data->state = LV_INDEV_STATE_RELEASED;
|
||||
data->point.x = -1;
|
||||
data->point.y = -1;
|
||||
}
|
||||
}
|
||||
/* USER CODE END PFP */
|
||||
|
Binary file not shown.
@ -3,9 +3,9 @@
|
||||
../Core/Src/main.c:86:1:__io_putchar 1
|
||||
../Core/Src/main.c:93:6:my_flush_cb 3
|
||||
../Core/Src/main.c:109:6:touchscreen_read_callback 2
|
||||
../Core/Src/main.c:129:5:main 1
|
||||
../Core/Src/main.c:222:6:SystemClock_Config 3
|
||||
../Core/Src/main.c:261:13:MX_USART1_UART_Init 2
|
||||
../Core/Src/main.c:294:13:MX_GPIO_Init 1
|
||||
../Core/Src/main.c:357:13:MX_FSMC_Init 2
|
||||
../Core/Src/main.c:421:6:Error_Handler 1
|
||||
../Core/Src/main.c:131:5:main 2
|
||||
../Core/Src/main.c:227:6:SystemClock_Config 3
|
||||
../Core/Src/main.c:266:13:MX_USART1_UART_Init 2
|
||||
../Core/Src/main.c:299:13:MX_GPIO_Init 1
|
||||
../Core/Src/main.c:369:13:MX_FSMC_Init 2
|
||||
../Core/Src/main.c:433:6:Error_Handler 1
|
||||
|
Binary file not shown.
@ -3,9 +3,9 @@
|
||||
../Core/Src/main.c:86:1:__io_putchar 16 static
|
||||
../Core/Src/main.c:93:6:my_flush_cb 32 static
|
||||
../Core/Src/main.c:109:6:touchscreen_read_callback 16 static
|
||||
../Core/Src/main.c:129:5:main 160 static
|
||||
../Core/Src/main.c:222:6:SystemClock_Config 72 static
|
||||
../Core/Src/main.c:261:13:MX_USART1_UART_Init 8 static
|
||||
../Core/Src/main.c:294:13:MX_GPIO_Init 48 static
|
||||
../Core/Src/main.c:357:13:MX_FSMC_Init 40 static
|
||||
../Core/Src/main.c:421:6:Error_Handler 4 static,ignoring_inline_asm
|
||||
../Core/Src/main.c:131:5:main 168 static
|
||||
../Core/Src/main.c:227:6:SystemClock_Config 72 static
|
||||
../Core/Src/main.c:266:13:MX_USART1_UART_Init 8 static
|
||||
../Core/Src/main.c:299:13:MX_GPIO_Init 48 static
|
||||
../Core/Src/main.c:369:13:MX_FSMC_Init 40 static
|
||||
../Core/Src/main.c:433:6:Error_Handler 4 static,ignoring_inline_asm
|
||||
|
Binary file not shown.
Binary file not shown.
BIN
Debug/PSE.elf
BIN
Debug/PSE.elf
Binary file not shown.
246806
Debug/PSE.list
246806
Debug/PSE.list
File diff suppressed because it is too large
Load Diff
5789
Debug/PSE.map
5789
Debug/PSE.map
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user