You use (replacing objectName and ObjectName appropriately) this code one time during initialization. Look at the first few functions in the source file e.g. receiver.c and you will see the objects inited and callbacks setup there:
static void objectNameCb(UAVObjEvent *ev);
...
ObjectNameInitialize();
...
ObjectNameConnectCallback(objectNameCb);
With the above code, objectNameCb() gets called every time ObjectName gets modified.
librepilot/1609 $ find . -iname '*.c' -exec grep -Hi ManualControlCommandConnectCallback \{\} \;
./flight/modules/ManualControl/manualcontrol.c: ManualControlCommandConnectCallback(commandUpdatedCb);
./flight/modules/Stabilization/stabilization.c: ManualControlCommandConnectCallback(FlightModeSwitchUpdatedCb);
Consider callbacks to be asynchronous interrupt functions and you will be OK. Your callback should probably set flags rather than for instance actually doing a failsafe timeout from there. To be pedantic, you should make sure your counter is atomic and marked volatile.
============================
or (hacks that would not be allowed in release code) you find where the ManualControlCommand object gets received and reset the counter there or reset the counter in one of the already-coded ManualControlCommand callbacks.
============================
In receiver.c, SettingsUpdatedCb() gets called if either VtolPathFollowerSettings or SystemSettings get modified because of these lines:
VtolPathFollowerSettingsConnectCallback(&SettingsUpdatedCb);
...
SystemSettingsConnectCallback(&SettingsUpdatedCb);
============================
Make sure you never code it to poll continuously (without sleeping). It's best to wake up every time there is data ready in a queue (but woe is you if your multi byte data packet ever gets out of sync). It's second best to sleep the correct length of time, and poll each time you wake up, but that can have a sliding delay with hiccup if you sleep say 20ms and the data arrives every 21ms (or worse yet 19ms and you loose some data). Your particular code and timeout is not critical that way though.