iNate

Untitled

Apr 22nd, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.07 KB | None | 0 0
  1. void handle_minute_tick(AppContextRef ctx, PebbleTickEvent *t)
  2. {
  3.     /* Need to be static because pointers to them are stored in the text
  4.     * layers.
  5.     */
  6.     static char day_text[] = "XXX";
  7.     static char month_text[] = "XXX";
  8.     static char daynum_text[] = "00";
  9.     static char hour_text[] = "00";
  10.     static char minute_text[] = "00";
  11.  
  12.     (void)ctx;  /* prevent "unused parameter" warning */
  13.  
  14.     if (t->units_changed & DAY_UNIT)
  15.     {
  16.         string_format_time(day_text,
  17.                            sizeof(day_text),
  18.                            "%a",
  19.                            t->tick_time);
  20.         string_format_time(month_text,
  21.                            sizeof(month_text),
  22.                            "%b",
  23.                            t->tick_time);
  24.         string_format_time(daynum_text,
  25.                            sizeof(daynum_text),
  26.                            "%d",
  27.                            t->tick_time);
  28.         upcase(day_text);
  29.         upcase(month_text);
  30.         date_layer_set_text(&date_layer, day_text, month_text, daynum_text);
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment