コード例 #1
0
ファイル: LcdBuffer.c プロジェクト: lwalkera/MetaWatch-Gen2
void DrawWatchStatusScreen(void)
{
  FillMyBuffer(0, LCD_ROW_NUM, 0);
  CopyColumnsIntoMyBuffer(RadioOn() ? pRadioOnIcon : pRadioOffIcon,
                          3,
                          STATUS_ICON_SIZE_IN_ROWS,
                          LEFT_STATUS_ICON_COLUMN,
                          STATUS_ICON_SIZE_IN_COLUMNS);
  // Connection status
  CopyColumnsIntoMyBuffer(Connected(CONN_TYPE_MAIN) ? pConnectedIcon : pDisconnectedIcon,
                          3,
                          STATUS_ICON_SIZE_IN_ROWS,
                          CENTER_STATUS_ICON_COLUMN,
                          STATUS_ICON_SIZE_IN_COLUMNS);

  gRow = 31;
  gColumn = 5;
  gBitColumnMask = BIT4;
  SetFont(MetaWatch5);

  if (PairedDeviceType() == DEVICE_TYPE_BLE)
  {
    if (Connected(CONN_TYPE_HFP) && Connected(CONN_TYPE_MAP)) DrawString("DUO", DRAW_OPT_BITWISE_OR);
    else DrawString("BLE", DRAW_OPT_BITWISE_OR);
  }
  else if (PairedDeviceType() == DEVICE_TYPE_SPP) DrawString("BR", DRAW_OPT_BITWISE_OR);

  DrawBatteryOnIdleScreen(6, 9, MetaWatch7);

  // Add Wavy line
  gRow += 12;
  CopyRowsIntoMyBuffer(pWavyLine, gRow, NUMBER_OF_ROWS_IN_WAVY_LINE);
  CopyColumnsIntoMyBuffer(pIconWatch, 54, 21, 0, 2); //54, 21, 2, 2);

  /* add the firmware version */
  gColumn = 2;
  gRow = 56;
  gBitColumnMask = BIT2;
  DrawString("SW: ", DRAW_OPT_BITWISE_OR);
  DrawString((char *)VERSION, DRAW_OPT_BITWISE_OR);
  DrawString(" (", DRAW_OPT_BITWISE_OR);
  DrawChar(BUILD[0], DRAW_OPT_BITWISE_OR);
  DrawChar(BUILD[1], DRAW_OPT_BITWISE_OR);
  DrawChar(BUILD[2], DRAW_OPT_BITWISE_OR);
  DrawChar(')', DRAW_OPT_BITWISE_OR);
  
  gColumn = 2;
  gRow = 65;
  gBitColumnMask = BIT2;
  DrawString("HW: REV ", DRAW_OPT_BITWISE_OR);
  DrawChar(GetMsp430HardwareRevision(), DRAW_OPT_BITWISE_OR);

  DrawLocalAddress(1, 80);
  
  SendMyBufferToLcd(STARTING_ROW, LCD_ROW_NUM);
}
コード例 #2
0
ファイル: LcdBuffer.c プロジェクト: lwalkera/MetaWatch-Gen2
void DrawCallScreen(char *pCallerId, char *pCallerName)
{
  FillMyBuffer(STARTING_ROW, LCD_ROW_NUM, 0x00);
  CopyRowsIntoMyBuffer(pCallNotif, CALL_NOTIF_START_ROW, CALL_NOTIF_ROWS);

  SetFont(MetaWatch16);
  gRow = 5;
  gColumn = 0;
  gBitColumnMask = BIT6;
  DrawString("Call from:", DRAW_OPT_BITWISE_OR);

  SetFont(MetaWatch7);
  gRow = 58;
  gColumn = 0;
  gBitColumnMask = BIT6;
  DrawString(pCallerId, DRAW_OPT_BITWISE_OR);

  SetFont(MetaWatch16);
  gRow = 24;
  gColumn = 0;
  gBitColumnMask = BIT6;

  unsigned char i = 0;
  while (pCallerName[i] != NUL && pCallerName[i] != SPACE) i ++;
  if (pCallerName[i] == SPACE) pCallerName[i] = NUL;
  else i = 0;

  DrawString(pCallerName, DRAW_OPT_BITWISE_OR);

  if (i)
  {
    gRow = 40;
    gColumn = 0;
    gBitColumnMask = BIT6;
    DrawString(&pCallerName[i + 1], DRAW_OPT_BITWISE_OR);
  }

  // write timestamp
  SetFont(MetaWatch5);
  gRow = 86;
  gColumn = 7;
  gBitColumnMask = BIT6;
  DrawHours(DRAW_OPT_BITWISE_NOT);
  DrawMins(DRAW_OPT_BITWISE_NOT);
  if (!GetProperty(PROP_24H_TIME_FORMAT)) DrawString((RTCHOUR > 11) ? "PM" : "AM", DRAW_OPT_BITWISE_NOT);

  SendMyBufferToLcd(STARTING_ROW, LCD_ROW_NUM);    
}
コード例 #3
0
ファイル: LcdBuffer.c プロジェクト: lwalkera/MetaWatch-Gen2
/*! Display the startup image or Splash Screen */
void DrawSplashScreen(void)
{
//  ClearLcd();
  // clear LCD buffer
  FillMyBuffer(0, LCD_ROW_NUM, 0x00);

#if COUNTDOWN_TIMER
  DrawWwzSplashScreen();
#else
  /* draw metawatch logo */
  CopyColumnsIntoMyBuffer(pIconSplashLogo, 21, 13, 3, 6);
  CopyRowsIntoMyBuffer(pIconSplashMetaWatch, SPLASH_START_ROW, 12);
  CopyColumnsIntoMyBuffer(pIconSplashHandsFree, 58, 5, 2, 8);
//  SendMyBufferToLcd(21, 42); // 58 + 5 - 21
#endif

  SendMyBufferToLcd(0, LCD_ROW_NUM);
}
コード例 #4
0
ファイル: LcdBuffer.c プロジェクト: lwalkera/MetaWatch-Gen2
void DrawBootloaderScreen(void)
{
#if BOOTLOADER
  FillMyBuffer(STARTING_ROW, LCD_ROW_NUM, 0x00);
  CopyRowsIntoMyBuffer(pBootloader, BOOTLOADER_START_ROW, BOOTLOADER_ROWS);
  
  // Draw version
  SetFont(MetaWatch5);
  gRow = 61;
  gColumn = 4;
  gBitColumnMask = BIT3;
  DrawString("V ", DRAW_OPT_BITWISE_OR);
  DrawString((char const *)VERSION, DRAW_OPT_BITWISE_OR);

  unsigned char i = 0;
  char const *pBootVer = BootVersion;

  PrintF("BL_VER addr:%04X", pBootVer);
  for (; i < 8; ++i) {PrintH(pBootVer[i]); PrintC(SPACE);}
  i = 0;

  while (*pBootVer && i++ < 8)
  {
    if ((*pBootVer < ZERO || *pBootVer > '9') && *pBootVer != '.') break;
    pBootVer ++;
  }
  
  if (i > 4) // at least x.x.x
  {
    gRow += 7;
    gColumn = 4;
    gBitColumnMask = BIT3;
    DrawString("B ", DRAW_OPT_BITWISE_OR);
    DrawString(BootVersion, DRAW_OPT_BITWISE_OR);
  }

  DrawLocalAddress(1, 80);
  
  SendMyBufferToLcd(STARTING_ROW, LCD_ROW_NUM);
#endif
}
コード例 #5
0
ファイル: LcdBuffer.c プロジェクト: lwalkera/MetaWatch-Gen2
void DrawConnectionScreen(void)
{
  const unsigned char *pSwash;

  if (!RadioOn()) pSwash = pBootPageBluetoothOffSwash;
  else if (ValidAuthInfo()) pSwash = pBootPagePairedSwash;
  else pSwash = pBootPageNoPairSwash;
  
  FillMyBuffer(WATCH_DRAW_SCREEN_ROW_NUM, PHONE_DRAW_SCREEN_ROW_NUM, 0x00);
  CopyRowsIntoMyBuffer(pSwash, WATCH_DRAW_SCREEN_ROW_NUM + 1, 32);

  /* add the firmware version */
  gRow = 68;
  gColumn = 4;
  gBitColumnMask = BIT0;
  SetFont(MetaWatch5);
  DrawString("V ", DRAW_OPT_BITWISE_OR);
  DrawString((char *)VERSION, DRAW_OPT_BITWISE_OR);

  DrawLocalAddress(1, 80);
  
  SendMyBufferToLcd(WATCH_DRAW_SCREEN_ROW_NUM, PHONE_DRAW_SCREEN_ROW_NUM);
}
コード例 #6
0
ファイル: IdlePageMain.c プロジェクト: kiapper/Watch
static void DrawConnectionScreen()
{
	unsigned char const* pSwash;

    unsigned char row;
    unsigned char col;

	/* this is part of the idle update
	 * timing is controlled by the idle update timer
	 * buffer was already cleared when drawing the time
	 */
	etConnectionState cs = QueryConnectionState();
	switch (cs)
	{
	case RadioOn:
		if (QueryValidPairingInfo())
		{
			pSwash = pBootPageConnectionSwash;
		}
		else
		{
			pSwash = pBootPagePairingSwash;
		}
		break;
	case Paired:
		pSwash = pBootPageConnectionSwash;
		break;
	case Connected:
		//pSwash = pBootPageConnectionSwash;
		//break;
		// Think we should do something here?
		pSwash = pBootPageUnknownSwash;
		break;
	case Initializing:
	case ServerFailure:
	case RadioOff:
	case RadioOffLowBattery:
	case ShippingMode:
	default:
		pSwash = pBootPageBluetoothOffSwash;
		break;
	}

  CopyRowsIntoMyBuffer(pSwash ,WATCH_DRAWN_IDLE_BUFFER_ROWS+1, 32);

  /* characters are 10h then add space of 2 lines */
  row = 65;
  col = 0;
  col = WriteString(GetLocalBluetoothAddressString(),row,col,DONT_ADD_SPACE_AT_END);

  /* add the firmware version */
  row = 75;
  col = 0;
  col = WriteString("App", row, col, ADD_SPACE_AT_END);
  col = WriteString("0.0.1", row, col, ADD_SPACE_AT_END);

  /* and the stack version */
  row = 85;
  col = 0;
  col = WriteString("Stack", row, col, ADD_SPACE_AT_END);
  col = WriteString("n/a", row, col, ADD_SPACE_AT_END);

}
コード例 #7
0
static void DrawConnectionScreen()
{
	unsigned char const* pSwash;
	/* this is part of the idle update
	 * timing is controlled by the idle update timer
	 * buffer was already cleared when drawing the time
	 */
	etConnectionState cs = QueryConnectionState();
	switch (cs)
	{
	case RadioOn:
		if (QueryValidPairingInfo())
		{
			pSwash = pBootPageConnectionSwash;
		}
		else
		{
			pSwash = pBootPagePairingSwash;
		}
		break;
	case Paired:
		pSwash = pBootPageConnectionSwash;
		break;
	case Connected:
		//pSwash = pBootPageConnectionSwash;
		//break;
		// Think we should do something here?
		pSwash = pBootPageUnknownSwash;
		break;
	case Initializing:
	case ServerFailure:
	case RadioOff:
	case RadioOffLowBattery:
	case ShippingMode:
	default:
		pSwash = pBootPageBluetoothOffSwash;
		break;
	}

  CopyRowsIntoMyBuffer(pSwash,WATCH_DRAWN_IDLE_BUFFER_ROWS+1,32);

#ifdef XXFONT_TESTING

  gRow = 65;
  gColumn = 0;
  gBitColumnMask = BIT0;

  SetFont(MetaWatch5);
  WriteFontString("Peanut Butter");

  gRow = 72;
  gColumn = 0;
  gBitColumnMask = BIT0;

  SetFont(MetaWatch7);
  //WriteFontString("ABCDEFGHIJKLMNOP");
  WriteFontString("Peanut Butter W");

  gRow = 80;
  gColumn = 0;
  gBitColumnMask = BIT0;
  SetFont(MetaWatch16);
  WriteFontString("ABC pqr StuVw");

#else

  unsigned char row;
  unsigned char col;

  /* characters are 10h then add space of 2 lines */
  row = 65;
  col = 0;
  col = WriteString(GetLocalBluetoothAddressString(),row,col,DONT_ADD_SPACE_AT_END);

  /* add the firmware version */
  row = 75;
  col = 0;
  col = WriteString("App",row,col,ADD_SPACE_AT_END);
  col = WriteString(VERSION_STRING,row,col,ADD_SPACE_AT_END);

  /* and the stack version */
  row = 85;
  col = 0;
  col = WriteString("Stack",row,col,ADD_SPACE_AT_END);
  col = WriteString(GetStackVersion(),row,col,ADD_SPACE_AT_END);

#endif

}