示例#1
0
void displayTwitch(char name[], char title[], char game[]) {

    if (timerStruct(lastDisplayTime) % 10 < 5) {
        ClearLcd();
        if(strlen(name) < 16) {
            LcdArrayLineOne(name, strlen(name));
        }else {
            LcdArrayLineOne(name, 16);
        }
        LcdArrayLineTwo("is streaming    ", 16);
    }
    else {
        ClearLcd();
        if(strlen(title) > 16) {
            LcdArrayLineOne(title, 16);
        }else {
            LcdArrayLineOne(title, strlen(title));
        }if(strlen(game) > 16) {
            LcdArrayLineTwo(game, 16);
        }else{
            LcdArrayLineTwo(game, strlen(game));
        }
    }
    LcdBackLight(LCD_BACKLIGHT_ON);
}
示例#2
0
void displayTwitter(char* text)
{
    ClearLcd();
    LcdBackLight(LCD_BACKLIGHT_ON);
    LcdArrayLineOne("     Twitter    ", 16);
    int j = 0;
    int i;
    char text1[16];
    for(i = 0; i<140;i++){
        if (text[i] != 0){
            j++;
        }
    }

        for(i = 0; i < 16; i++){
            if (text[Scroller+i]!= 0) {
                text1[i] = text[Scroller + i];
            } else {
                text1[i] = ' ';
            }
        }
        LcdArrayLineTwo(text1,16);
        Scroller++;
        if (Scroller > j){
            Scroller = 0;
        }
}
示例#3
0
void showMenu()
{
    ClearLcd();
    LcdArrayLineOne("Main menu", 9);
    switch (isSettings)
    {
        case 0:
        {
            tm time;
            X12RtcGetClock(&time);
            char str1[16];
            sprintf(str1, "<   %02d:%02d:%02d   >", time.tm_hour, time.tm_min, time.tm_sec);
            LcdArrayLineTwo(str1, 16);
            break;
        }
        case 1:
        {
            showSettings();
            break;
        }
        case 2:
        {
            showPlay();
            break;
        }
    }
}
示例#4
0
static void EnterShippingMode(void)
{
  /* Turn off the watchdog timer */
  WDTCTL = WDTPW + WDTHOLD;
#ifdef DIGITAL
  ClearLcd();
#endif
  ConfigResetPin(RST_PIN_ENABLED);
  
  __delay_cycles(100000);
  
  __disable_interrupt();
  __no_operation();
  
  DisableRtosTick();
  
  /* 
   * the radio draws more current in reset than it does after 
   * the patch is loaded
   */
  
  DISABLE_DISPLAY_POWER();
  DISABLE_LCD_ENABLE();
  BATTERY_CHARGE_DISABLE();
  LIGHT_SENSOR_SHUTDOWN();
  BATTERY_SENSE_DISABLE();
  HARDWARE_CFG_SENSE_DISABLE();
  APPLE_POWER_DISABLE();
  ACCELEROMETER_INT_DISABLE();
  DISABLE_BUTTONS();
  
#ifdef DIGITAL
  /* SHIPPING */
  ENABLE_SHIPPING_WAKEUP();
#endif
  
  SELECT_ACLK(SELA__REFOCLK);                
  SELECT_FLLREF(SELREF__REFOCLK); 
  UCSCTL8 &= ~SMCLKREQEN;
  UCSCTL6 |= SMCLKOFF;
  /* disable aclk */
  P11SEL &= ~BIT0;
  XT1_Stop();
  
  /* turn off the regulator */
  PMMCTL0_H = PMMPW_H;
  PMMCTL0_L = PMMREGOFF;
  __low_power_mode_4();
  __no_operation();
  __no_operation();
  
  /* should not get here without a power event */
  SoftwareReset();
}