Part Number: CAPTIVATE-FR2633
Hi All,
Just a quick question to see if I am doing this right. I've hooked up a button and generated the source code and flashed the project. Works fine. Tuning sensors is great. Next I'm switching over to the register_i2c method of communication and I'm essentially doing this:
#if CAPT_INTERFACE == __CAPT_REGISTERI2C_INTERFACE__
void callback(tSensor *s)
{
// if touch I care about detected, raise IRQ
}
#endif
void main(void)
{
WDTCTL = WDTPW | WDTHOLD;
BSP_configureMCU();
__bis_SR_register(GIE);
//
// Register callback
//
#if CAPT_INTERFACE == __CAPT_REGISTERI2C_INTERFACE__
MAP_CAPT_registerCallback(&BTN00, &callback);
#endif
//
// Start the CapTIvate application
//
CAPT_appStart();
//
// Background Loop
//
while(1)
{
CAPT_appHandler();
CAPT_appSleep();
} // End background loop
} // End main()
Is this the right idea? Do I need to keep the CAPT_appHandler there? Do I need to modify it? Is registering a callback when in the i2c register mode a reasonable approach? I am doing this to enable sensor tuning. When you switch to UART mode this code breaks the integration with the design interface.
Thanks!