|
|
|
|
@@ -14,10 +14,10 @@ typedef struct {
|
|
|
|
|
bool eu_date;
|
|
|
|
|
bool quick_start;
|
|
|
|
|
bool leading_zero;
|
|
|
|
|
int background_color;
|
|
|
|
|
int number_base_color;
|
|
|
|
|
uint8_t background_color;
|
|
|
|
|
uint8_t number_base_color;
|
|
|
|
|
bool number_variation;
|
|
|
|
|
int ornament_base_color;
|
|
|
|
|
uint8_t ornament_base_color;
|
|
|
|
|
bool ornament_variation;
|
|
|
|
|
bool invert;
|
|
|
|
|
bool monochrome;
|
|
|
|
|
@@ -25,9 +25,10 @@ typedef struct {
|
|
|
|
|
bool btvibe;
|
|
|
|
|
bool contrast;
|
|
|
|
|
bool nightsaver;
|
|
|
|
|
int ns_start;
|
|
|
|
|
int ns_stop;
|
|
|
|
|
uint8_t ns_start;
|
|
|
|
|
uint8_t ns_stop;
|
|
|
|
|
bool backlight;
|
|
|
|
|
bool weekday;
|
|
|
|
|
|
|
|
|
|
} Preferences;
|
|
|
|
|
|
|
|
|
|
@@ -52,11 +53,21 @@ enum {
|
|
|
|
|
KEY_NS_START,
|
|
|
|
|
KEY_NS_STOP,
|
|
|
|
|
KEY_BACKLIGHT,
|
|
|
|
|
KEY_WEEKDAY,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define KEY_DEBUGWATCH 50
|
|
|
|
|
|
|
|
|
|
#define PREFERENCES_KEY 0
|
|
|
|
|
|
|
|
|
|
#define US_DATE (!curPrefs.eu_date) // true == MM/DD, false == DD/MM
|
|
|
|
|
#define SCREENSHOTMODE false
|
|
|
|
|
|
|
|
|
|
#define DEBUG false
|
|
|
|
|
#define SUPERDEBUG false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define EU_DATE (curPrefs.eu_date) // true == MM/DD, false == DD/MM
|
|
|
|
|
#define WEEKDAY (curPrefs.weekday)
|
|
|
|
|
#define CENTER_DATE (curPrefs.center)
|
|
|
|
|
#define DISCONNECT_VIBRATION (curPrefs.btvibe)
|
|
|
|
|
#define CONTRAST_WHILE_CHARGING PBL_IF_BW_ELSE(false, (curPrefs.contrast))
|
|
|
|
|
@@ -71,35 +82,210 @@ enum {
|
|
|
|
|
#define NUMSLOTS PBL_IF_RECT_ELSE(8, 18)
|
|
|
|
|
#define SPACING_X TILE_SIZE
|
|
|
|
|
#define SPACING_Y (curPrefs.large_mode ? TILE_SIZE - 1 : TILE_SIZE)
|
|
|
|
|
#define DIGIT_CHANGE_ANIM_DURATION 1500
|
|
|
|
|
#define STARTDELAY (curPrefs.quick_start ? 1000 : 2000)
|
|
|
|
|
#define DIGIT_CHANGE_ANIM_DURATION (curPrefs.quick_start ? 1500 : 2000)
|
|
|
|
|
#define STARTDELAY (curPrefs.quick_start ? 700 : 2000)
|
|
|
|
|
|
|
|
|
|
#define NUMBER_BASE_COLOR_ARGB8 (curPrefs.number_base_color)
|
|
|
|
|
#define ORNAMENT_BASE_COLOR_ARGB8 (curPrefs.ornament_base_color)
|
|
|
|
|
#define NUMBER_ADD_VARIATION (curPrefs.number_variation)
|
|
|
|
|
#define ORNAMENT_ADD_VARIATION (curPrefs.ornament_variation)
|
|
|
|
|
|
|
|
|
|
#define BACKGROUND_COLOR PBL_IF_BW_ELSE((INVERT ? GColorWhite : GColorBlack), ((GColor8) { .argb = curPrefs.background_color }))
|
|
|
|
|
|
|
|
|
|
#define FONT blocks
|
|
|
|
|
#define ALPHAFONT alphablocks
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
Layer *layer;
|
|
|
|
|
int prevDigit;
|
|
|
|
|
int curDigit;
|
|
|
|
|
int divider;
|
|
|
|
|
uint8_t prevDigit;
|
|
|
|
|
uint8_t curDigit;
|
|
|
|
|
bool isalpha;
|
|
|
|
|
uint8_t divider;
|
|
|
|
|
AnimationProgress normTime;
|
|
|
|
|
int slotIndex;
|
|
|
|
|
uint8_t slotIndex;
|
|
|
|
|
} digitSlot;
|
|
|
|
|
|
|
|
|
|
digitSlot slot[NUMSLOTS];
|
|
|
|
|
|
|
|
|
|
static char weekday_buffer[2];
|
|
|
|
|
|
|
|
|
|
AnimationImplementation animImpl;
|
|
|
|
|
Animation *anim;
|
|
|
|
|
bool splashEnded = false;
|
|
|
|
|
static bool debug = false;
|
|
|
|
|
static bool splashEnded = false, debug = false;
|
|
|
|
|
|
|
|
|
|
unsigned char blocks[][5][5] = {{
|
|
|
|
|
static const char * locales[6] = {"en", "de", "es", "fr", "it", "pt"};
|
|
|
|
|
static const char * weekdays[6][7] = {
|
|
|
|
|
{ "SU","MO","TU","WE","TH","FR","SA" }, // EN
|
|
|
|
|
{ "SO","MO","DI","MI","DO","FR","SA" }, // DE
|
|
|
|
|
{ "DO","LU","MA","MI","JU","VI","SA" }, // ES - from https://forums.getpebble.com/discussion/comment/166975/#Comment_166975
|
|
|
|
|
{ "DI","LU","MA","ME","JE","VE","SA" }, // FR - from https://www.quora.com/How-are-days-of-the-week-abbreviated-in-various-languages
|
|
|
|
|
{ "DO","LU","MA","ME","GI","VE","SA" }, // IT - from https://www.quora.com/How-are-days-of-the-week-abbreviated-in-various-languages
|
|
|
|
|
{ "DO","SG","TE","QA","QI","SX","SA" } // PT - from http://www.brazil-help.com/week.htm (is this correct?)
|
|
|
|
|
}; // required Letters: ADEFGHIJLMOQRSTUVWX
|
|
|
|
|
|
|
|
|
|
static const uint8_t alphablocks[][5][5] = {
|
|
|
|
|
[65] = { // A
|
|
|
|
|
{1,1,1,1,1},
|
|
|
|
|
{1,0,0,0,1},
|
|
|
|
|
{1,1,1,1,1},
|
|
|
|
|
{1,0,0,0,1},
|
|
|
|
|
{1,0,2,0,1}
|
|
|
|
|
},
|
|
|
|
|
[68] = { // D
|
|
|
|
|
{1,1,1,1,1},
|
|
|
|
|
{1,0,0,0,1},
|
|
|
|
|
{1,0,2,0,1},
|
|
|
|
|
{1,0,0,0,1},
|
|
|
|
|
{1,1,1,1,0}
|
|
|
|
|
},
|
|
|
|
|
[69] = { // E
|
|
|
|
|
{1,1,1,1,1},
|
|
|
|
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,1,0,1},
|
|
|
|
|
{1,0,1,0,1}
|
|
|
|
|
},
|
|
|
|
|
[99] = {
|
|
|
|
|
{1,1,1,1,1},
|
|
|
|
|
{1,1,1,1,1},
|
|
|
|
|
{1,1,1,1,1},
|
|
|
|
|
{1,1,1,1,1},
|
|
|
|
|
{1,1,1,1,1}
|
|
|
|
|
}};
|
|
|
|
|
|
|
|
|
|
int startDigit[18] = {
|
|
|
|
|
static const uint8_t startDigit[18] = {
|
|
|
|
|
11,12,12,11,11,12,10,13,12,11,12,11,11,12,10,13,12,10 // 2x h, 2x m, 4x date, 2x filler top, 4x filler sides, 2x filler bottom, 2x filler bottom sides
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned char variation[] = {
|
|
|
|
|
static const uint8_t variation[100] = {
|
|
|
|
|
0b00000000, 0b00010000, 0b00000100, 0b00010000, 0b00000000,
|
|
|
|
|
0b00010001, 0b00010000, 0b00000000, 0b00000101, 0b00010000,
|
|
|
|
|
0b00000001, 0b00000000, 0b00000000, 0b00010100, 0b00010001,
|
|
|
|
|
@@ -213,7 +405,7 @@ unsigned char variation[] = {
|
|
|
|
|
0b00000000, 0b00000001, 0b00010001, 0b00000101, 0b00010100
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static uint8_t shadowtable[] = {
|
|
|
|
|
static const uint8_t shadowtable[256] = {
|
|
|
|
|
192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
|
|
|
|
|
192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
|
|
|
|
|
192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
|
|
|
|
|
@@ -232,7 +424,7 @@ static uint8_t shadowtable[] = {
|
|
|
|
|
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
|
|
|
|
|
};
|
|
|
|
|
// alpha should only be 0b??111111 where ?? = 00 (full shade), 01 (much shade), 10 (some shade), 11 (none shade)
|
|
|
|
|
static uint8_t alpha = 0b10111111;
|
|
|
|
|
static const uint8_t alpha = 0b10111111;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
uint8_t combine_colors(uint8_t fg_color, uint8_t bg_color) {
|
|
|
|
|
@@ -254,11 +446,11 @@ uint8_t combine_colors(uint8_t fg_color, uint8_t bg_color) {
|
|
|
|
|
#define ORIGIN_X PBL_IF_RECT_ELSE(((144 - TILES_X)/2), ((180 - TILES_X)/2))
|
|
|
|
|
#define ORIGIN_Y PBL_IF_RECT_ELSE((curPrefs.large_mode ? 1 : TILE_SIZE*1.5), (TILE_SIZE*2.2))
|
|
|
|
|
|
|
|
|
|
static bool contrastmode = false, previous_contrastmode = false, allow_animate = true;
|
|
|
|
|
static bool contrastmode = false, previous_contrastmode = false, allow_animate = true, initial_anim = false;
|
|
|
|
|
|
|
|
|
|
static void handle_bluetooth(bool connected) {
|
|
|
|
|
if (DISCONNECT_VIBRATION && !connected) {
|
|
|
|
|
static uint32_t const segments[] = { 200, 200, 50, 150, 200 };
|
|
|
|
|
static const uint32_t segments[] = { 200, 200, 50, 150, 200 };
|
|
|
|
|
VibePattern pat = {
|
|
|
|
|
.durations = segments,
|
|
|
|
|
.num_segments = ARRAY_LENGTH(segments),
|
|
|
|
|
@@ -267,8 +459,8 @@ static void handle_bluetooth(bool connected) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static GRect slotFrame(int i) {
|
|
|
|
|
int x, y, w, h;
|
|
|
|
|
static GRect slotFrame(int8_t i) {
|
|
|
|
|
int16_t x, y, w, h;
|
|
|
|
|
if (i<4) { // main digits
|
|
|
|
|
w = FONT_WIDTH;
|
|
|
|
|
h = FONT_HEIGHT;
|
|
|
|
|
@@ -296,14 +488,14 @@ static GRect slotFrame(int i) {
|
|
|
|
|
} else {
|
|
|
|
|
x = ORIGIN_X; // i = 0 or 2
|
|
|
|
|
}
|
|
|
|
|
y = ORIGIN_Y - FONT_HEIGHT - SPACING_Y;
|
|
|
|
|
y = (int8_t) (ORIGIN_Y - FONT_HEIGHT - SPACING_Y);
|
|
|
|
|
} else if (i<14) { // side filler for round
|
|
|
|
|
w = FONT_WIDTH;
|
|
|
|
|
h = FONT_HEIGHT;
|
|
|
|
|
if (i%2) {
|
|
|
|
|
x = ORIGIN_X + FONT_WIDTH + SPACING_X + FONT_WIDTH + SPACING_X;
|
|
|
|
|
} else {
|
|
|
|
|
x = (int) (ORIGIN_X - FONT_WIDTH - SPACING_X);
|
|
|
|
|
x = (int8_t) (ORIGIN_X - FONT_WIDTH - SPACING_X);
|
|
|
|
|
}
|
|
|
|
|
if (i<12) {
|
|
|
|
|
y = ORIGIN_Y;
|
|
|
|
|
@@ -328,15 +520,22 @@ static GRect slotFrame(int i) {
|
|
|
|
|
return GRect(x, y, w, h);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static GColor8 getSlotColor(int x, int y, int digit, int pos) {
|
|
|
|
|
int argb;
|
|
|
|
|
bool should_add_var = false;
|
|
|
|
|
if (FONT[digit][y][x] == 0) {
|
|
|
|
|
static GColor8 getSlotColor(uint8_t x, uint8_t y, uint8_t digit, uint8_t pos, bool isalpha) {
|
|
|
|
|
static uint8_t argb;
|
|
|
|
|
static bool should_add_var = false;
|
|
|
|
|
uint8_t thisrect = FONT[digit][y][x];
|
|
|
|
|
if (isalpha) {
|
|
|
|
|
thisrect = ALPHAFONT[digit][y][x];
|
|
|
|
|
}
|
|
|
|
|
if (SCREENSHOTMODE) {
|
|
|
|
|
thisrect = FONT[99][y][x];
|
|
|
|
|
}
|
|
|
|
|
if (thisrect == 0) {
|
|
|
|
|
if (contrastmode) {
|
|
|
|
|
return GColorBlack;
|
|
|
|
|
}
|
|
|
|
|
return BACKGROUND_COLOR;
|
|
|
|
|
} else if (FONT[digit][y][x] == 1) {
|
|
|
|
|
} else if (thisrect == 1) {
|
|
|
|
|
#if defined(PBL_COLOR)
|
|
|
|
|
if (contrastmode && pos >= 8) {
|
|
|
|
|
argb = 0b11000000;
|
|
|
|
|
@@ -368,10 +567,14 @@ static GColor8 getSlotColor(int x, int y, int digit, int pos) {
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
if (should_add_var) {
|
|
|
|
|
argb += variation[ ( y*5 + x + digit*17 + pos*19 )%sizeof(variation) ];
|
|
|
|
|
if (argb == 0b11111111) {
|
|
|
|
|
argb -= variation[ ( y*5 + x + digit*17 + pos*19 )%sizeof(variation) ];
|
|
|
|
|
} else {
|
|
|
|
|
argb += variation[ ( y*5 + x + digit*17 + pos*19 )%sizeof(variation) ];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (pos >= 8) {
|
|
|
|
|
int argb_temp = shadowtable[alpha & argb];
|
|
|
|
|
uint8_t argb_temp = shadowtable[alpha & argb];
|
|
|
|
|
if (argb_temp == BACKGROUND_COLOR.argb) {
|
|
|
|
|
argb_temp = argb;
|
|
|
|
|
}
|
|
|
|
|
@@ -403,8 +606,8 @@ static void updateSlot(Layer *layer, GContext *ctx) {
|
|
|
|
|
ty = t / FONT_HEIGHT_BLOCKS;
|
|
|
|
|
shift = 0-(t-ty);
|
|
|
|
|
|
|
|
|
|
GColor8 oldColor = getSlotColor(tx, ty, slot->prevDigit, slot->slotIndex);
|
|
|
|
|
GColor8 newColor = getSlotColor(tx, ty, slot->curDigit, slot->slotIndex);
|
|
|
|
|
GColor8 oldColor = getSlotColor(tx, ty, slot->prevDigit, slot->slotIndex, slot->isalpha);
|
|
|
|
|
GColor8 newColor = getSlotColor(tx, ty, slot->curDigit, slot->slotIndex, slot->isalpha);
|
|
|
|
|
|
|
|
|
|
graphics_context_set_fill_color(ctx, oldColor);
|
|
|
|
|
graphics_fill_rect(ctx, GRect((tx*tilesize)-(tx*widthadjust), ty*tilesize-(ty*widthadjust), tilesize-widthadjust, tilesize-widthadjust), 0, GCornerNone);
|
|
|
|
|
@@ -422,25 +625,22 @@ static void updateSlot(Layer *layer, GContext *ctx) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static unsigned short get_display_hour(unsigned short hour) {
|
|
|
|
|
static unsigned short get_display_hour(uint8_t hour) {
|
|
|
|
|
if (clock_is_24h_style()) {
|
|
|
|
|
return hour;
|
|
|
|
|
}
|
|
|
|
|
unsigned short display_hour = hour % 12;
|
|
|
|
|
uint8_t display_hour = hour % 12;
|
|
|
|
|
return display_hour ? display_hour : 12;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void setupAnimation() {
|
|
|
|
|
if (debug) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Setting up anim");
|
|
|
|
|
}
|
|
|
|
|
anim = animation_create();
|
|
|
|
|
animation_set_delay(anim, 0);
|
|
|
|
|
animation_set_duration(anim, contrastmode ? 500 : DIGIT_CHANGE_ANIM_DURATION);
|
|
|
|
|
animation_set_implementation(anim, &animImpl);
|
|
|
|
|
animation_set_curve(anim, AnimationCurveEaseInOut);
|
|
|
|
|
if (debug) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Done setting up anim %i", (int)anim);
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Set up anim %i", (int)anim);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -452,10 +652,10 @@ static void destroyAnimation() {
|
|
|
|
|
anim = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void handle_tick(struct tm *t, TimeUnits units_changed) {
|
|
|
|
|
int ho, mi, da, mo, i;
|
|
|
|
|
static void handle_tick(struct tm *t, TimeUnits units_changed) {
|
|
|
|
|
static uint8_t ho, mi, da, mo;
|
|
|
|
|
|
|
|
|
|
if (splashEnded) {
|
|
|
|
|
if (splashEnded && !initial_anim) {
|
|
|
|
|
if (animation_is_scheduled(anim)){
|
|
|
|
|
animation_unschedule(anim);
|
|
|
|
|
animation_destroy(anim);
|
|
|
|
|
@@ -464,34 +664,52 @@ void handle_tick(struct tm *t, TimeUnits units_changed) {
|
|
|
|
|
mi = t->tm_min;
|
|
|
|
|
da = t->tm_mday;
|
|
|
|
|
mo = t->tm_mon+1;
|
|
|
|
|
if (debug) {
|
|
|
|
|
ho = 9;
|
|
|
|
|
if (debug && SUPERDEBUG) {
|
|
|
|
|
ho = 8+(mi%4);
|
|
|
|
|
}
|
|
|
|
|
uint8_t localeid = 0;
|
|
|
|
|
static char weekdayname[3];
|
|
|
|
|
static char locale[3];
|
|
|
|
|
strncpy(locale, i18n_get_system_locale(), 2);
|
|
|
|
|
if (WEEKDAY) {
|
|
|
|
|
strftime(weekday_buffer, sizeof(weekday_buffer), "%w", t);
|
|
|
|
|
for (uint8_t lid = 0; lid < 6; lid++) {
|
|
|
|
|
if (strncmp(locales[lid], locale, 2) == 0) { localeid = lid; }
|
|
|
|
|
}
|
|
|
|
|
uint8_t weekdaynum = ((int)weekday_buffer[0])-0x30;
|
|
|
|
|
if (debug && SUPERDEBUG) {
|
|
|
|
|
weekdaynum = (int)mi%7;
|
|
|
|
|
}
|
|
|
|
|
strcpy(weekdayname, weekdays[localeid][weekdaynum]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "It is now %d:%d %d.%d.", (int)ho, (int)mi, (int)da, (int)mo);
|
|
|
|
|
|
|
|
|
|
allow_animate = true;
|
|
|
|
|
if (DISABLE_ANIM) {
|
|
|
|
|
if (DISABLE_ANIM_START_TIME > DISABLE_ANIM_END_TIME) {
|
|
|
|
|
if (DISABLE_ANIM_START_TIME == DISABLE_ANIM_END_TIME) {
|
|
|
|
|
allow_animate = false;
|
|
|
|
|
if (debug) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Animation always off");
|
|
|
|
|
}
|
|
|
|
|
} else if (DISABLE_ANIM_START_TIME > DISABLE_ANIM_END_TIME) {
|
|
|
|
|
// across midnight
|
|
|
|
|
if (ho >= DISABLE_ANIM_START_TIME || ho < DISABLE_ANIM_END_TIME) {
|
|
|
|
|
if (t->tm_hour >= DISABLE_ANIM_START_TIME || t->tm_hour < DISABLE_ANIM_END_TIME) {
|
|
|
|
|
allow_animate = false;
|
|
|
|
|
if (debug) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Hour %d was after %d and before %d", (int)ho, (int)DISABLE_ANIM_START_TIME , (int)DISABLE_ANIM_END_TIME );
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Animation off (%d:00 - %d:00)", (int)DISABLE_ANIM_START_TIME , (int)DISABLE_ANIM_END_TIME );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// prior to midnight
|
|
|
|
|
if (ho >= DISABLE_ANIM_START_TIME && ho < DISABLE_ANIM_END_TIME) {
|
|
|
|
|
if (t->tm_hour >= DISABLE_ANIM_START_TIME && t->tm_hour < DISABLE_ANIM_END_TIME) {
|
|
|
|
|
allow_animate = false;
|
|
|
|
|
if (debug) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Hour %d was after %d and before %d", (int)ho, (int)DISABLE_ANIM_START_TIME , (int)DISABLE_ANIM_END_TIME );
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Animation off (%d:00 - %d:00)", (int)DISABLE_ANIM_START_TIME , (int)DISABLE_ANIM_END_TIME );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i=0; i<NUMSLOTS; i++) {
|
|
|
|
|
for (uint8_t i=0; i<NUMSLOTS; i++) {
|
|
|
|
|
slot[i].prevDigit = slot[i].curDigit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -499,9 +717,22 @@ void handle_tick(struct tm *t, TimeUnits units_changed) {
|
|
|
|
|
slot[1].curDigit = ho%10;
|
|
|
|
|
slot[2].curDigit = mi/10;
|
|
|
|
|
slot[3].curDigit = mi%10;
|
|
|
|
|
if (US_DATE) {
|
|
|
|
|
slot[4].curDigit = mo/10;
|
|
|
|
|
slot[5].curDigit = mo%10;
|
|
|
|
|
|
|
|
|
|
slot[4].isalpha = false;
|
|
|
|
|
slot[5].isalpha = false;
|
|
|
|
|
slot[6].isalpha = false;
|
|
|
|
|
slot[7].isalpha = false;
|
|
|
|
|
|
|
|
|
|
if (!EU_DATE) {
|
|
|
|
|
if (WEEKDAY) {
|
|
|
|
|
slot[4].isalpha = true;
|
|
|
|
|
slot[5].isalpha = true;
|
|
|
|
|
slot[4].curDigit = (uint8_t) weekdayname[0];
|
|
|
|
|
slot[5].curDigit = (uint8_t) weekdayname[1];
|
|
|
|
|
} else {
|
|
|
|
|
slot[4].curDigit = mo/10;
|
|
|
|
|
slot[5].curDigit = mo%10;
|
|
|
|
|
}
|
|
|
|
|
if (CENTER_DATE && da < 10) {
|
|
|
|
|
slot[6].curDigit = da%10;
|
|
|
|
|
if (slot[7].prevDigit == 10 || slot[7].prevDigit == 12) {
|
|
|
|
|
@@ -516,44 +747,41 @@ void handle_tick(struct tm *t, TimeUnits units_changed) {
|
|
|
|
|
} else {
|
|
|
|
|
slot[4].curDigit = da/10;
|
|
|
|
|
slot[5].curDigit = da%10;
|
|
|
|
|
if (CENTER_DATE && mo < 10) {
|
|
|
|
|
slot[6].curDigit = mo%10;
|
|
|
|
|
if (slot[7].prevDigit == 10 || slot[7].prevDigit == 12) {
|
|
|
|
|
slot[7].curDigit = 11;
|
|
|
|
|
} else {
|
|
|
|
|
slot[7].curDigit = 10;
|
|
|
|
|
}
|
|
|
|
|
if (WEEKDAY) {
|
|
|
|
|
slot[6].isalpha = true;
|
|
|
|
|
slot[7].isalpha = true;
|
|
|
|
|
slot[6].curDigit = (uint8_t) weekdayname[0];
|
|
|
|
|
slot[7].curDigit = (uint8_t) weekdayname[1];
|
|
|
|
|
} else {
|
|
|
|
|
slot[6].curDigit = mo/10;
|
|
|
|
|
slot[7].curDigit = mo%10;
|
|
|
|
|
if (CENTER_DATE && mo < 10) {
|
|
|
|
|
slot[6].curDigit = mo%10;
|
|
|
|
|
if (slot[7].prevDigit == 10 || slot[7].prevDigit == 12) {
|
|
|
|
|
slot[7].curDigit = 11;
|
|
|
|
|
} else {
|
|
|
|
|
slot[7].curDigit = 10;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
slot[6].curDigit = mo/10;
|
|
|
|
|
slot[7].curDigit = mo%10;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (NO_ZERO) {
|
|
|
|
|
if (debug) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Slot 0 was %d", (int) slot[0].prevDigit);
|
|
|
|
|
}
|
|
|
|
|
if (ho < 10 && slot[0].prevDigit >= 10) {
|
|
|
|
|
if (slot[0].curDigit == 0) {
|
|
|
|
|
if (NUMSLOTS > 8) {
|
|
|
|
|
if (debug) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "More than 8 slots");
|
|
|
|
|
}
|
|
|
|
|
if (slot[10].prevDigit != 10 && slot[10].prevDigit < 12) {
|
|
|
|
|
if (slot[10].prevDigit != 10 && slot[10].prevDigit != 12) {
|
|
|
|
|
slot[0].curDigit = 11;
|
|
|
|
|
} else {
|
|
|
|
|
slot[0].curDigit = 10;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (debug) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "8 slots or fewer");
|
|
|
|
|
}
|
|
|
|
|
if (slot[0].prevDigit == 10) {
|
|
|
|
|
slot[0].curDigit = 11;
|
|
|
|
|
} else {
|
|
|
|
|
slot[0].curDigit = 10;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Slot 0 is now %d", (int) slot[0].curDigit);
|
|
|
|
|
}
|
|
|
|
|
if (slot[4].curDigit == 0) {
|
|
|
|
|
slot[4].curDigit = 10;
|
|
|
|
|
@@ -582,6 +810,10 @@ void handle_tick(struct tm *t, TimeUnits units_changed) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void initialAnimationDone() {
|
|
|
|
|
initial_anim = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void handle_timer(void *data) {
|
|
|
|
|
time_t curTime;
|
|
|
|
|
|
|
|
|
|
@@ -589,6 +821,12 @@ void handle_timer(void *data) {
|
|
|
|
|
|
|
|
|
|
curTime = time(NULL);
|
|
|
|
|
handle_tick(localtime(&curTime), SECOND_UNIT|MINUTE_UNIT|HOUR_UNIT|DAY_UNIT|MONTH_UNIT|YEAR_UNIT);
|
|
|
|
|
initial_anim = true;
|
|
|
|
|
if (initial_anim) {
|
|
|
|
|
app_timer_register(contrastmode ? 500 : DIGIT_CHANGE_ANIM_DURATION, initialAnimationDone, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -611,13 +849,12 @@ void initSlot(int i, Layer *parent) {
|
|
|
|
|
layer_add_child(parent, s->layer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void deinitSlot(int i) {
|
|
|
|
|
static void deinitSlot(uint8_t i) {
|
|
|
|
|
layer_destroy(slot[i].layer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void animateDigits(struct Animation *anim, const AnimationProgress normTime) {
|
|
|
|
|
int i;
|
|
|
|
|
for (i=0; i<NUMSLOTS; i++) {
|
|
|
|
|
for (uint8_t i=0; i<NUMSLOTS; i++) {
|
|
|
|
|
if (slot[i].curDigit != slot[i].prevDigit) {
|
|
|
|
|
if (allow_animate) {
|
|
|
|
|
slot[i].normTime = normTime;
|
|
|
|
|
@@ -631,7 +868,6 @@ static void animateDigits(struct Animation *anim, const AnimationProgress normTi
|
|
|
|
|
|
|
|
|
|
static void setupUI() {
|
|
|
|
|
Layer *rootLayer;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
window_set_background_color(window, contrastmode ? GColorBlack : BACKGROUND_COLOR);
|
|
|
|
|
|
|
|
|
|
@@ -639,7 +875,7 @@ static void setupUI() {
|
|
|
|
|
|
|
|
|
|
rootLayer = window_get_root_layer(window);
|
|
|
|
|
|
|
|
|
|
for (i=0; i<NUMSLOTS; i++) {
|
|
|
|
|
for (uint8_t i=0; i<NUMSLOTS; i++) {
|
|
|
|
|
initSlot(i, rootLayer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -653,8 +889,7 @@ static void setupUI() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void teardownUI() {
|
|
|
|
|
int i;
|
|
|
|
|
for (i=0; i<NUMSLOTS; i++) {
|
|
|
|
|
for (uint8_t i=0; i<NUMSLOTS; i++) {
|
|
|
|
|
deinitSlot(i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -704,62 +939,46 @@ static void in_received_handler(DictionaryIterator *iter, void *context) {
|
|
|
|
|
Tuple *ns_start_t = dict_find(iter, KEY_NS_START);
|
|
|
|
|
Tuple *ns_stop_t = dict_find(iter, KEY_NS_STOP);
|
|
|
|
|
Tuple *backlight_t = dict_find(iter, KEY_BACKLIGHT);
|
|
|
|
|
Tuple *weekday_t = dict_find(iter, KEY_WEEKDAY);
|
|
|
|
|
Tuple *debug_t = dict_find(iter, KEY_DEBUGWATCH);
|
|
|
|
|
|
|
|
|
|
if (large_mode_t) {
|
|
|
|
|
curPrefs.large_mode = large_mode_t->value->int8;
|
|
|
|
|
if (debug_t) {
|
|
|
|
|
if (debug_t->value->int8 == 1) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Setting debug watch");
|
|
|
|
|
debug = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (eu_date_t) {
|
|
|
|
|
curPrefs.eu_date = eu_date_t->value->int8;
|
|
|
|
|
|
|
|
|
|
if (debug) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Got config");
|
|
|
|
|
}
|
|
|
|
|
if (quick_start_t) {
|
|
|
|
|
curPrefs.quick_start = quick_start_t->value->int8;
|
|
|
|
|
}
|
|
|
|
|
if (leading_zero_t) {
|
|
|
|
|
curPrefs.leading_zero = leading_zero_t->value->int8;
|
|
|
|
|
}
|
|
|
|
|
if (background_color_t) {
|
|
|
|
|
curPrefs.background_color = background_color_t->value->int32;
|
|
|
|
|
}
|
|
|
|
|
if (number_base_color_t) {
|
|
|
|
|
curPrefs.number_base_color = number_base_color_t->value->int32;
|
|
|
|
|
}
|
|
|
|
|
if (number_variation_t) {
|
|
|
|
|
curPrefs.number_variation = number_variation_t->value->int8;
|
|
|
|
|
}
|
|
|
|
|
if (ornament_base_color_t) {
|
|
|
|
|
curPrefs.ornament_base_color = ornament_base_color_t->value->int32;
|
|
|
|
|
}
|
|
|
|
|
if (ornament_variation_t) {
|
|
|
|
|
curPrefs.ornament_variation = ornament_variation_t->value->int8;
|
|
|
|
|
}
|
|
|
|
|
if (invert_t) {
|
|
|
|
|
curPrefs.invert = invert_t->value->int8;
|
|
|
|
|
}
|
|
|
|
|
if (monochrome_t) {
|
|
|
|
|
curPrefs.monochrome = monochrome_t->value->int8;
|
|
|
|
|
}
|
|
|
|
|
if (center_t) {
|
|
|
|
|
curPrefs.center = center_t->value->int8;
|
|
|
|
|
}
|
|
|
|
|
if (btvibe_t) {
|
|
|
|
|
curPrefs.btvibe = btvibe_t->value->int8;
|
|
|
|
|
}
|
|
|
|
|
if (contrast_t) {
|
|
|
|
|
curPrefs.contrast = contrast_t->value->int8;
|
|
|
|
|
}
|
|
|
|
|
if (nightsaver_t) {
|
|
|
|
|
curPrefs.nightsaver = nightsaver_t->value->int8;
|
|
|
|
|
}
|
|
|
|
|
if (ns_start_t) {
|
|
|
|
|
curPrefs.ns_start = ns_start_t->value->int8;
|
|
|
|
|
}
|
|
|
|
|
if (ns_stop_t) {
|
|
|
|
|
curPrefs.ns_stop = ns_stop_t->value->int8;
|
|
|
|
|
}
|
|
|
|
|
if (backlight_t) {
|
|
|
|
|
curPrefs.backlight = backlight_t->value->int8;
|
|
|
|
|
if (large_mode_t) { curPrefs.large_mode = large_mode_t->value->int8; }
|
|
|
|
|
if (eu_date_t) { curPrefs.eu_date = eu_date_t->value->int8; }
|
|
|
|
|
if (quick_start_t) { curPrefs.quick_start = quick_start_t->value->int8; }
|
|
|
|
|
if (leading_zero_t) { curPrefs.leading_zero = leading_zero_t->value->int8; }
|
|
|
|
|
if (background_color_t) { curPrefs.background_color = background_color_t->value->int8; }
|
|
|
|
|
if (number_base_color_t) { curPrefs.number_base_color = number_base_color_t->value->int8; }
|
|
|
|
|
if (number_variation_t) { curPrefs.number_variation = number_variation_t->value->int8; }
|
|
|
|
|
if (ornament_base_color_t) { curPrefs.ornament_base_color = ornament_base_color_t->value->int8; }
|
|
|
|
|
if (ornament_variation_t) { curPrefs.ornament_variation = ornament_variation_t->value->int8; }
|
|
|
|
|
if (invert_t) { curPrefs.invert = invert_t->value->int8; }
|
|
|
|
|
if (monochrome_t) { curPrefs.monochrome = monochrome_t->value->int8; }
|
|
|
|
|
if (center_t) { curPrefs.center = center_t->value->int8; }
|
|
|
|
|
if (btvibe_t) { curPrefs.btvibe = btvibe_t->value->int8; }
|
|
|
|
|
if (contrast_t) { curPrefs.contrast = contrast_t->value->int8; }
|
|
|
|
|
if (nightsaver_t) { curPrefs.nightsaver = nightsaver_t->value->int8; }
|
|
|
|
|
if (ns_start_t) { curPrefs.ns_start = ns_start_t->value->int8; }
|
|
|
|
|
if (ns_stop_t) { curPrefs.ns_stop = ns_stop_t->value->int8; }
|
|
|
|
|
if (backlight_t) { curPrefs.backlight = backlight_t->value->int8; }
|
|
|
|
|
if (weekday_t) { curPrefs.weekday = weekday_t->value->int8; }
|
|
|
|
|
|
|
|
|
|
if (debug) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Writing config");
|
|
|
|
|
}
|
|
|
|
|
persist_write_data(PREFERENCES_KEY, &curPrefs, sizeof(curPrefs));
|
|
|
|
|
if (debug) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Wrote config");
|
|
|
|
|
}
|
|
|
|
|
vibes_short_pulse();
|
|
|
|
|
#if defined(PBL_COLOR)
|
|
|
|
|
if (curPrefs.contrast == false) {
|
|
|
|
|
@@ -782,11 +1001,11 @@ static void in_received_handler(DictionaryIterator *iter, void *context) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (debug) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Tearing down");
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Teardown");
|
|
|
|
|
}
|
|
|
|
|
teardownUI();
|
|
|
|
|
if (debug) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Setting up");
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_INFO, "Setup");
|
|
|
|
|
}
|
|
|
|
|
setupUI();
|
|
|
|
|
if (debug) {
|
|
|
|
|
@@ -795,16 +1014,17 @@ static void in_received_handler(DictionaryIterator *iter, void *context) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void in_dropped_handler(AppMessageResult reason, void *context) {
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_WARNING, "Dropped a message because %i", (int)reason);
|
|
|
|
|
APP_LOG(APP_LOG_LEVEL_WARNING, "Dropped message because %i", (int)reason);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void init() {
|
|
|
|
|
if (watch_info_get_model()==WATCH_INFO_MODEL_UNKNOWN) {
|
|
|
|
|
window = window_create();
|
|
|
|
|
|
|
|
|
|
if (DEBUG) {
|
|
|
|
|
debug = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
window = window_create();
|
|
|
|
|
|
|
|
|
|
// Set up preferences
|
|
|
|
|
if(persist_exists(PREFERENCES_KEY)){
|
|
|
|
|
persist_read_data(PREFERENCES_KEY, &curPrefs, sizeof(curPrefs));
|
|
|
|
|
@@ -828,6 +1048,7 @@ static void init() {
|
|
|
|
|
.ns_start = 0,
|
|
|
|
|
.ns_stop = 6,
|
|
|
|
|
.backlight = false,
|
|
|
|
|
.weekday = false,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -856,10 +1077,6 @@ static void init() {
|
|
|
|
|
|
|
|
|
|
tick_timer_service_subscribe(MINUTE_UNIT, handle_tick);
|
|
|
|
|
|
|
|
|
|
if (debug) {
|
|
|
|
|
//light_enable(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handle_bluetooth(connection_service_peek_pebble_app_connection());
|
|
|
|
|
|
|
|
|
|
battery_state_service_subscribe(battery_handler);
|
|
|
|
|
|