static void DrawMenu3(void) { CopyColumnsIntoMyBuffer(pBootloaderIcon, BUTTON_ICON_A_F_ROW, BUTTON_ICON_SIZE_IN_ROWS, RIGHT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); CopyColumnsIntoMyBuffer(ChargeEnabled() ? pIconChargingEnabled : pIconChargingDisabled, BUTTON_ICON_B_E_ROW, BUTTON_ICON_SIZE_IN_ROWS, LEFT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); CopyColumnsIntoMyBuffer(pNextIcon, BUTTON_ICON_B_E_ROW, BUTTON_ICON_SIZE_IN_ROWS, RIGHT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); CopyColumnsIntoMyBuffer(pTestIcon, BUTTON_ICON_C_D_ROW, BUTTON_ICON_SIZE_IN_ROWS, LEFT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); }
static void DrawMenu2(void) { CopyColumnsIntoMyBuffer(RESET_PIN ? pNmiPinIcon : pRstPinIcon, BUTTON_ICON_A_F_ROW, BUTTON_ICON_SIZE_IN_ROWS, RIGHT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); const unsigned char *pIcon; unsigned char MuxMode = GetMuxMode(); if (MuxMode == MUX_MODE_SERIAL) pIcon = pSerialIcon; else if (MuxMode == MUX_MODE_GND) pIcon = pGroundIcon; else pIcon = pSbwIcon; CopyColumnsIntoMyBuffer(pIcon, BUTTON_ICON_B_E_ROW, BUTTON_ICON_SIZE_IN_ROWS, LEFT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); CopyColumnsIntoMyBuffer(pNextIcon, BUTTON_ICON_B_E_ROW, BUTTON_ICON_SIZE_IN_ROWS, RIGHT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); CopyColumnsIntoMyBuffer(pResetButtonIcon, BUTTON_ICON_C_D_ROW, BUTTON_ICON_SIZE_IN_ROWS, LEFT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); }
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); }
static void DrawCommonMenuIcons(void) { CopyColumnsIntoMyBuffer(pLedIcon, BUTTON_ICON_A_F_ROW, BUTTON_ICON_SIZE_IN_ROWS, LEFT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); CopyColumnsIntoMyBuffer(pExitIcon, BUTTON_ICON_C_D_ROW, BUTTON_ICON_SIZE_IN_ROWS, RIGHT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); }
/*! 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); }
void DrawScreen() { FillMyBuffer(STARTING_ROW, NUM_LCD_ROWS, 0x00); CopyColumnsIntoMyBuffer(pInvader, ypos, 8, 0, 1); int i; int col = 0; for(col = 0; col < 4; ++col) { for(i = 0; i < 8; ++i) { CopyColumnsIntoMyBuffer(pAlien, 16+(i*8), 8, 4+col, 1); } } }
static void DrawMenu1(void) { const unsigned char *pIcon; if (BluetoothState() == Initializing) { pIcon = pBluetoothInitIcon; } else { pIcon = RadioOn() ? pBluetoothOnIcon : pBluetoothOffIcon; } CopyColumnsIntoMyBuffer(pIcon, BUTTON_ICON_A_F_ROW, BUTTON_ICON_SIZE_IN_ROWS, RIGHT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); CopyColumnsIntoMyBuffer(pInvertDisplayIcon, BUTTON_ICON_B_E_ROW, BUTTON_ICON_SIZE_IN_ROWS, LEFT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); CopyColumnsIntoMyBuffer(GetProperty(PROP_TIME_SECOND) ? pSecondsOnMenuIcon : pSecondsOffMenuIcon, BUTTON_ICON_B_E_ROW, BUTTON_ICON_SIZE_IN_ROWS, RIGHT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); CopyColumnsIntoMyBuffer(LinkAlarmEnabled() ? pLinkAlarmOnIcon : pLinkAlarmOffIcon, BUTTON_ICON_C_D_ROW, BUTTON_ICON_SIZE_IN_ROWS, LEFT_BUTTON_COLUMN, BUTTON_ICON_SIZE_IN_COLUMNS); }
static void DrawItem(struct menu_item const *item, unsigned char row, unsigned char col) { if(item->type == menu_text_action) { if(item->u.itext.text) WriteString((unsigned char*)item->u.itext.text, row, col, 0); } else { CopyColumnsIntoMyBuffer(menu_get_icon(item), row, BUTTON_ICON_SIZE_IN_ROWS, col, BUTTON_ICON_SIZE_IN_COLUMNS); } }
static void DrawBatteryOnIdleScreen(unsigned char Row, unsigned char Col, etFontType Font) { // Battery CopyColumnsIntoMyBuffer(GetBatteryIcon(ICON_SET_BATTERY_V), Row, IconInfo[ICON_SET_BATTERY_V].Height, Col, IconInfo[ICON_SET_BATTERY_V].Width); SetFont(Font); gRow = Row + (Font == MetaWatch7 ? 23 : 21); //29 gColumn = Col - 1; //8 gBitColumnMask = (Font == MetaWatch7) ? BIT4 : BIT7; unsigned char BattVal = BatteryPercentage(); if (BattVal < 100) { BattVal = ToBCD(BattVal); DrawChar(BattVal > 9 ? BCD_H(BattVal) +ZERO : SPACE, DRAW_OPT_BITWISE_OR); DrawChar(BCD_L(BattVal) +ZERO, DRAW_OPT_BITWISE_OR); } else DrawString("100", DRAW_OPT_BITWISE_OR); DrawChar('%', DRAW_OPT_BITWISE_OR); }
void DrawIdleScreen(void) { unsigned char msd; unsigned char lsd; unsigned char Row = 6; unsigned char Col = 0; int Minutes; /* display hour */ int Hour = GetRTCHOUR(); /* if required convert to twelve hour format */ if ( GetTimeFormat() == TWELVE_HOUR ) { if ( Hour == 0 ) { Hour = 12; } else if ( Hour > 12 ) { Hour -= 12; } } msd = Hour / 10; lsd = Hour % 10; /* if first digit is zero then leave location blank */ if ( msd != 0 ) { WriteTimeDigit(msd,Row,Col,LEFT_JUSTIFIED); } Col += 1; WriteTimeDigit(lsd,Row,Col,RIGHT_JUSTIFIED); Col += 2; /* the colon takes the first 5 bits on the byte*/ WriteTimeColon(Row,Col,RIGHT_JUSTIFIED); Col+=1; /* display minutes */ Minutes = GetRTCMIN(); msd = Minutes / 10; lsd = Minutes % 10; WriteTimeDigit(msd,Row,Col,RIGHT_JUSTIFIED); Col += 2; WriteTimeDigit(lsd,Row,Col,LEFT_JUSTIFIED); if ( nvDisplaySeconds ) { /* the final colon's spacing isn't quite the same */ int Seconds = GetRTCSEC(); msd = Seconds / 10; lsd = Seconds % 10; Col +=2; WriteTimeColon(Row,Col,LEFT_JUSTIFIED); Col += 1; WriteTimeDigit(msd,Row,Col,LEFT_JUSTIFIED); Col += 1; WriteTimeDigit(lsd,Row,Col,RIGHT_JUSTIFIED); } else /* now things starting getting fun....*/ { DisplayAmPm(); if ( QueryBluetoothOn() == 0 ) { CopyColumnsIntoMyBuffer(pBluetoothOffIdlePageIcon, IDLE_PAGE_ICON_STARTING_ROW, IDLE_PAGE_ICON_SIZE_IN_ROWS, IDLE_PAGE_ICON_STARTING_COL, IDLE_PAGE_ICON_SIZE_IN_COLS); } else if ( QueryPhoneConnected() == 0 ) { CopyColumnsIntoMyBuffer(pPhoneDisconnectedIdlePageIcon, IDLE_PAGE_ICON_STARTING_ROW, IDLE_PAGE_ICON_SIZE_IN_ROWS, IDLE_PAGE_ICON_STARTING_COL, IDLE_PAGE_ICON_SIZE_IN_COLS); } else { if ( QueryBatteryCharging() ) { CopyColumnsIntoMyBuffer(pBatteryChargingIdlePageIconType2, IDLE_PAGE_ICON2_STARTING_ROW, IDLE_PAGE_ICON2_SIZE_IN_ROWS, IDLE_PAGE_ICON2_STARTING_COL, IDLE_PAGE_ICON2_SIZE_IN_COLS); } else { unsigned int bV = 3500; if ( bV < 3500 ) { CopyColumnsIntoMyBuffer(pLowBatteryIdlePageIconType2, IDLE_PAGE_ICON2_STARTING_ROW, IDLE_PAGE_ICON2_SIZE_IN_ROWS, IDLE_PAGE_ICON2_STARTING_COL, IDLE_PAGE_ICON2_SIZE_IN_COLS); } else { DisplayDayOfWeek(); DisplayDate(); } } } } }