This variable can be modified at the event BondingButton (at TR-7xD) or at the event MenuActivated (at TR-7xG) to adjust the time without a pressed standard bonding button before [N] goes into deep sleep mode during bonding. The variable is internally zeroed when the bonding phase is initiated. The variable counts down and when it reaches zero (after it is pre-decremented) then the deep sleep mode is activated. A countdown unit is approximately 290 ms. When the variable is continuously set to 0 then the device will never activate deep sleep mode. Also setting bit.6 at DPA configuration bits avoids sleeping.
Example #1
The following example sets the time before going to sleep to 4 seconds:
// Was the BondingSleepCountdown just initiated?
#ifdef DpaEvent_BondingButton
case DpaEvent_BondingButton:
if ( BondingSleepCountdown == 0 )
#endif
#ifdef DpaEvent_MenuActivated
case DpaEvent_MenuActivated:
if ( BondingSleepCountdown == 0 )
#endif
// Yes, set the requested timeout to 4 seconds
BondingSleepCountdown = 4000 / BONDING_SLEEP_COUNTDOWN_UNIT;
break;
Example #2
The example disables the bonding button timeout at all:
#ifdef DpaEvent_BondingButton
case DpaEvent_BondingButton:
#endif
#ifdef DpaEvent_MenuActivated
case DpaEvent_MenuActivated:
#endif
BondingSleepCountdown = 0;
break;