TouchGFX ButtonController Location
I'm creating a TouchGFX project on custom hardware and I'm a little confused about where to set the button controller for physical buttons. As far as I can tell from the documentation, the custom button controller needs to be initialized in TouchGFXConfiguration.cpp and attached to the HAL in touchgfx_init():
static UserButtonController ubc;
void touchgfx_init()
{
Bitmap::registerBitmapDatabase(BitmapDatabase::getInstance(), BitmapDatabase::getInstanceSize());
TypedText::registerTexts(&texts);
Texts::setLanguage(0);
FontManager::setFontProvider(&fontProvider);
FrontendHeap& heap = FrontendHeap::getInstance();
/*
* we need to obtain the reference above to initialize the frontend heap.
*/
(void)heap;
/*
* Initialize TouchGFX
*/
hal.initialize();
hal.setButtonController(&ubc);
}However, the top of `TouchGFXConfiguration.cpp` explicitly says "This file is generated by TouchGFX Generator 4.23.0. Please, do not edit!". Additionally, the Version Control Wiki specifically says not to check in the generated folder into version control, which includes TouchGFXConfiguration.cpp.
Where should we actually be setting up the ButtonController?
