1
Discussion - EVE / Re: How often and when read REG_TOUCH_TAG
« on: February 19, 2024, 08:12:11 PM »
Hi there.
I've been recently testing the method with interrupt handling from the touch panel. Thanks to this, it's possible to practically not send anything to FT/BT81x for most of the time. When an interrupt occurs, only then do I read the TAG. Here's the interrupt configuration:
Then, in loop functions:
I've been recently testing the method with interrupt handling from the touch panel. Thanks to this, it's possible to practically not send anything to FT/BT81x for most of the time. When an interrupt occurs, only then do I read the TAG. Here's the interrupt configuration:
Code: [Select]
void EVE_INT_config(void)
{
EVE_memWrite8(REG_INT_EN,1); // IRQ on
EVE_memWrite8(REG_INT_MASK,EVE_INT_TAG); // EVE_INT_TOUCH|
EVE_memRead8(REG_INT_FLAGS); // clear by read flag
}
Then, in loop functions:
Code: [Select]
if(is_set(FLAGS,_f_tp_irq))
{
CurrTag = EVE_memRead8(REG_TOUCH_TAG);
RESET(FLAGS,_f_tp_irq);
... // the rest of the code
// refresh the screen by set timDisp to 0
timDisp = 0;
EVE_memRead8(REG_INT_FLAGS); // skasuj flagi
timer_screensaver = time_screensaver; // przeładuj timer wygaszacza ekranu
}
// prepare a new display list:
if(!timDisp)
{
timDisp = 50;
// start new 'display list'
start_new_screen();
...// etc
finish_new_screen();
}
Also IRQ from pin change:Code: [Select]
ISR(INT7_vect)
{
SET(FLAGS,_f_tp_irq);
}