Timex M851 Watch User Manual


 
M851 WristApp Design Guide Rev 1.2
Timex Corporation 28
4.4.8 Default State Handler
The default state handler controls the main function specified for an application.
4.4.9 Set Banner State Handler
The core will always make the Set banner the state to proceed when the crown is pulled to the SET
position.
It is advised that the set banner state define a popdown state usually the set state. This prevents a popup
from occurring in the middle of the banner timeout from returning to the set banner state. To set the
popdown state, the following code is used:
// set popdown state should a popup occur during mode banner timeout
CORE_SET_POPDOWN_STATE OPTSETSTATE;
Sample Set Banner State Handler:
optSetBannerStateManager()
{
switch( CORECurrentEvent )
{
case COREEVENT_STATEENTRY:
// ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
// ; SET BANNER ENTRY
// ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
// set popdown state if a popup occurs during
// set banner timeout
CORE_SET_POPDOWN_STATE OPTSETSTATE;
// clear display
LCD_CLEAR_DISPLAY;
//display 'ON/OFF TIME' for both night-mode and chime banner
LCD_DISP_SMALL_DM_MSG_ONOFF_TIME;
// request for a 1.5 second timeout banner
CORE_REQ_TIMEOUT_HIRES TIMEOUTHIRES_1P5SEC;
break;
case OPTEVENT_MODEDEPRESS:
case OPTEVENT_STOPRESETDEPRESS:
case OPTEVENT_STARTSPLITDEPRESS:
case COREEVENT_CW_EDGE_TRAILING:
case COREEVENT_CCW_EDGE_TRAILING:
case COREEVENT_TIMEOUTDONE_HIGHRES:
// ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
// ; CANCEL SET BANNER TIMEOUT EVENTS
// ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
// Request for a state change to set state
BReg = OPTSETSTATE;
CORE_REQ_STATE_CHANGE;
break;
case COREEVENT_CROWN_HOME:
// ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
// ; CROWN HOME EVENT PROCESSING
// ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
// Request for a state change to default state
BReg = OPTDEFAULTSTATE;
CORE_REQ_STATE_CHANGE;
break;