TouchGFX hardware buttons. ButtonController vs Interrupts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-13 3:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-13 7:12 AM
If you send data directly to the presenter, i.e. past the model and view, you no longer follow the MVP model. This would make it much more difficult to migrate to other hardware (display, etc.) at a later date.
It should be better if you set a flag in the callback with the button interrupt, which you then evaluate in the model, but which then amounts to polling again.
Does it answer your question?
Regards
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-13 7:21 AM
Hi Peter,
Thanks for the respose.
I should have been more clear. I meant I would pass it to the Presenter via the Model. The Model would simply wait for a FreeRTOS Message containing the ButtonPressed signal and then call e.g.
if (osMessageQueueGet(INPUT_QueueHandle, &inputData, 0, 0) == osOK) {
modelListener->ButtonPressed(inputData);
}
I guess this comes down to whether the FreeRTOS osMessageQueueGet is more efficient than the TouchGFX ButtonController polling.
Are you saying that interrupts with RTOS Message Queue is more efficient than the ButtonController class?
Cheers,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-13 7:25 AM
I see. However, I cannot confirm that sending data with the RTOS Message Queue is more efficient than the ButtonController class, because I have not yet done any timing or other research on this.
Regards
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-13 1:40 PM
If you say about human press buttons, class is OK.
For hw sourced inputs is more eff interrupts...
