예제 #1
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;
}
static int IdlePageGameOfLifeHandler(struct IdleInfo *Info)
{
  
    StopAllDisplayTimers(); // Think we'll do this when we change pages???
    SetupOneSecondTimer(Info->IdleModeTimerId,
	                     ONE_SECOND,
	                      NO_REPEAT,
	                      BarCode,
	                      NO_MSG_OPTIONS);
    live(Info->buffer);
    StartOneSecondTimer(Info->IdleModeTimerId);
    return IDLE_UPDATE_FULL_SCREEN;
}
예제 #3
0
int IdlePageQrCodeInit()
{
	StopAllDisplayTimers();
	if(timerid == -1)
	{
		timerid = AllocateOneSecondTimer();
		if (timerid < 0)
		{
			// How do we report errors
		}
		SetupOneSecondTimer(timerid, 1, REPEAT_FOREVER, BarCode, QRTIMER_TIMER);
		StartOneSecondTimer(timerid);
	}
	FillMyBuffer(STARTING_ROW, NUM_LCD_ROWS, 0x00);


	return 0;
}