eGUI D4D on FRDM-KE02Z

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

eGUI D4D on FRDM-KE02Z

跳至解决方案
3,102 次查看
michaelsthomas
Contributor I

I'm using D4D with an adafruit capacitive touchscreen, but cannot get the menu button to change screens.  Through debugging, I've determined that I am receiving correct touchscreen coordinates and those are being passed to D4D with D4D_PutTouchScreen.  The menu button is recognized as the object that is touched, but it never executes the OnClick function.

 

Why does touching the menu button not result in a screen change?

Original Attachment has been moved to: screen_main.c.zip

标记 (2)
0 项奖励
回复
1 解答
1,662 次查看
EarlOrlando
Senior Contributor II

Hello Michael,

Unfortunately, I don't have an Adafruit Capacitive Touchscreen to debug your project but I can do as much as I can to help you to solve that problem.

I was watching the function dependencies to assume a flow in the program. I found that the onClick function is called in the functions D4D_BtnOnKeyUp and D4D_BtnUnTouched which are called in the function D4D_BtnOnMessage, please be sure that the function D4D_BtnOnMessage is called when you touch the screen and that it enters to the D4D_MSG_UNTOUCHED case.

Another thing that I think you must check is that in the function D4D_ManageTouchScreenEvents the variable d4d_TouchScreen_Status be modified and then in the function D4D_HandleTouchScreen the program call the function:

// Send prepared message

D4D_SendMessageBack(&d4d_msg);

I hope this helps.

Regards,

Earl.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,663 次查看
EarlOrlando
Senior Contributor II

Hello Michael,

Unfortunately, I don't have an Adafruit Capacitive Touchscreen to debug your project but I can do as much as I can to help you to solve that problem.

I was watching the function dependencies to assume a flow in the program. I found that the onClick function is called in the functions D4D_BtnOnKeyUp and D4D_BtnUnTouched which are called in the function D4D_BtnOnMessage, please be sure that the function D4D_BtnOnMessage is called when you touch the screen and that it enters to the D4D_MSG_UNTOUCHED case.

Another thing that I think you must check is that in the function D4D_ManageTouchScreenEvents the variable d4d_TouchScreen_Status be modified and then in the function D4D_HandleTouchScreen the program call the function:

// Send prepared message

D4D_SendMessageBack(&d4d_msg);

I hope this helps.

Regards,

Earl.

0 项奖励
回复
1,662 次查看
michaelsthomas
Contributor I

Thank you, Earl.  This helps.  The problem seems to be that I am never entering the D4D_MSG_UNTOUCHED case. 

I set a breakpoint in the D4D_HandleTouchScreen after I had pressed the menu button, and I changed the d4d_TouchScreen_Status so that it would prepare the message D4D_MSG_UNTOUCHED.  This caused the OnClick function to execute and finally change screens.

The root of the problem was that  D4D_TouchScreen_Status was always set to 0x1.  With a little bit of searching, I figured out that I was never executing D4D_CheckTouchScreen.  Since I was using a custom driver, I was only polling the touchscreen and adding events as they happened.  I needed to execute D4D_CheckTouchScreen to also check for when objects are untouched.

Thanks, again.

0 项奖励
回复
1,662 次查看
EarlOrlando
Senior Contributor II

I am glad that your problem is solved. If you have any other issue please let me know.

Best regards,

Earl.

0 项奖励
回复