Ejemplo n.º 1
0
/*! Switch from other-mode/menu page back to idle type page
 */
static void IdleUpdateHandler(void)
{
  PageType = PAGE_TYPE_IDLE;

  UpdateClock();

  if (OnceConnected())
    SendMessage(UpdateDisplayMsg, IDLE_MODE | MSG_OPT_NEWUI | MSG_OPT_UPD_INTERNAL);
  else DrawConnectionScreen();
}
Ejemplo n.º 2
0
static int IdleUpdateHandler(struct IdleInfo *Info)
{
	/* select between 1 second and 1 minute */
	int IdleUpdateTime;

	StopAllDisplayTimers();

	if (GetDisplaySeconds())
	{
		IdleUpdateTime = ONE_SECOND;
	}
	else
	{
		IdleUpdateTime = ONE_SECOND * 60;
	}

	/* setup a timer to determine when to draw the screen again */
	SetupOneSecondTimer(Info->IdleModeTimerId, IdleUpdateTime, REPEAT_FOREVER,
			IdleUpdate, NO_MSG_OPTIONS);

	StartOneSecondTimer(Info->IdleModeTimerId);

	/* determine if the bottom of the screen should be drawn by the watch */
	if (QueryFirstContact())
	{
        tHostMsg* pOutgoingMsg;
		/*
		 * immediately update the screen
		 */
		if (GetIdleBufferConfiguration() == WATCH_CONTROLS_TOP)
		{
			/* only draw watch part */
			FillMyBuffer(STARTING_ROW, WATCH_DRAWN_IDLE_BUFFER_ROWS, 0x00);
			DrawIdleScreen();
//			PrepareMyBufferForLcd(STARTING_ROW, WATCH_DRAWN_IDLE_BUFFER_ROWS);
			SendMyBufferToLcd(WATCH_DRAWN_IDLE_BUFFER_ROWS);
		}

		/* now update the remainder of the display */
		/*! make a dirty flag for the idle page drawn by the phone
		 * set it whenever watch uses whole screen
		 */
		BPL_AllocMessageBuffer(&pOutgoingMsg);
		pOutgoingMsg->Type = UpdateDisplay;
		pOutgoingMsg->Options = IDLE_MODE | DONT_ACTIVATE_DRAW_BUFFER;
		RouteMsg(&pOutgoingMsg);

		return IDLE_UPDATE_TOP_ONLY;
	}
	FillMyBuffer(STARTING_ROW, NUM_LCD_ROWS, 0x00);
	DrawSimpleIdleScreen();
	DrawConnectionScreen();

	return IDLE_UPDATE_FULL_SCREEN;
}
Ejemplo n.º 3
0
static void BluetoothStateChangeHandler(tMessage *pMsg)
{
  if (Splashing)
  {
    if (pMsg->Options == On)
    {
      Splashing = pdFALSE;
      RtcUpdateEnabled = pdTRUE;
      DetermineIdlePage();
      IdleUpdateHandler();
      
      pMsg->Options = MUSIC_MODE | (TMPL_MUSIC_MODE << 4);
      LoadTemplateHandler(pMsg);

      pMsg->Options = NOTIF_MODE | (TMPL_NOTIF_MODE << 4);
      LoadTemplateHandler(pMsg);

      InitButton();
    }
  }
  else
  {
    //decide which idle page to be
    DetermineIdlePage();
    
    if (CurrentMode == IDLE_MODE)
    {
      if (PageType == PAGE_TYPE_IDLE)
      {
        if (OnceConnected())
        {
//#if COUNTDOWN_TIMER
//          if (Connected(CONN_TYPE_MAIN)) CreateAndSendMessage(CountDownMsg, MSG_OPT_NONE);
//#endif
          UpdateClock();
        }
        else DrawConnectionScreen();
      }
      else if (PageType == PAGE_TYPE_MENU) MenuModeHandler(0);
      else if (CurrentPage[PAGE_TYPE_INFO] == StatusPage) DrawWatchStatusScreen();
    }
  }
}
Ejemplo n.º 4
0
static void BluetoothStateChangeHandler(tMessage *pMsg)
{
  if (Splashing)
  {
    if (pMsg->Options == On)
    {
      Splashing = pdFALSE;
      RtcUpdateEnabled = pdTRUE;
      DetermineIdlePage();
      IdleUpdateHandler();
      
      pMsg->Options = MUSIC_MODE | (TMPL_MUSIC_MODE << 4);
      LoadTemplateHandler(pMsg);

      pMsg->Options = NOTIF_MODE | (TMPL_NOTIF_MODE << 4);
      LoadTemplateHandler(pMsg);

      InitButton();
    }
  }
  else
  {
    //decide which idle page to be
    DetermineIdlePage();
    
    if (CurrentMode == IDLE_MODE)
    {
      if (PageType == PAGE_TYPE_IDLE)
      {
        if (!OnceConnected()) DrawConnectionScreen();
        else UpdateClock();
      }
      else if (PageType == PAGE_TYPE_MENU) MenuModeHandler(0);
      else if (CurrentPage[PAGE_TYPE_INFO] == StatusPage) DrawWatchStatusScreen();
    }
  }
}