Skip to content

Commit e2d0a98

Browse files
committed
Added emery (Pebble Time 2) support, with 200x228 screen
1 parent 625ad5f commit e2d0a98

File tree

3 files changed

+95
-12
lines changed

3 files changed

+95
-12
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"aplite",
2727
"basalt",
2828
"chalk",
29-
"diorite"
29+
"diorite",
30+
"emery"
3031
],
3132
"uuid": "33a003e9-91ec-40fe-b652-b41248212f74",
3233
"watchapp": {

src/c/watch_config.h

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,31 @@
3232
#else
3333
#define BAT_POS GRect(0, 140, 180, 180) /* probably taller than really needed */
3434
#endif /* DRAW_BATTERY */
35-
36-
#else /* PBL_RECT 144x168*/
37-
#define CLOCK_POS GRect(0, 52, 144, 168) /* probably taller than really needed */
38-
#define HEALTH_POS GRect(0, 40, 144, 168)
39-
#define BT_POS GRect(0, 120, 144, 168) /* probably taller than really needed */
40-
#define DATE_POS GRect(0, 140, 144, 168) /* probably taller than really needed */
41-
#ifdef DRAW_BATTERY
42-
#define BAT_POS GRect(5, 150, 144, 168)
43-
#else
44-
#define BAT_POS GRect(0, 140, 144, 168) /* probably taller than really needed */
45-
#endif /* DRAW_BATTERY */
35+
#else /* PBL_RECT 144x168 */
36+
#if PBL_DISPLAY_HEIGHT == 228 // 200x228 Pebble Time 2 (emery)
37+
// TODO center? shift slight to right a little more, and down
38+
#define CLOCK_POS GRect(0, 52, 200, 228) /* probably taller than really needed */
39+
#define HEALTH_POS GRect(0, 40, 200, 228)
40+
// below untested
41+
#define BT_POS GRect(0, 120, 200, 228) /* probably taller than really needed */
42+
// FIXME below should be lower...
43+
#define DATE_POS GRect(0, 205, 200, 228) /* probably taller than really needed */
44+
#ifdef DRAW_BATTERY
45+
#define BAT_POS GRect(5, 215, 200, 228)
46+
#else
47+
#define BAT_POS GRect(0, 205, 200, 228) /* probably taller than really needed */
48+
#endif /* DRAW_BATTERY */
49+
#else // 144x168 Original pebbles; Pebble Classic (aplite), Pebble Time (basalt), Pebble 2 (diorite), Pebble 2 Duo (flint)
50+
#define CLOCK_POS GRect(0, 52, 144, 168) /* probably taller than really needed */
51+
#define HEALTH_POS GRect(0, 40, 144, 168)
52+
#define BT_POS GRect(0, 120, 144, 168) /* probably taller than really needed */
53+
#define DATE_POS GRect(0, 140, 144, 168) /* probably taller than really needed */
54+
#ifdef DRAW_BATTERY
55+
#define BAT_POS GRect(5, 150, 144, 168)
56+
#else
57+
#define BAT_POS GRect(0, 140, 144, 168) /* probably taller than really needed */
58+
#endif /* DRAW_BATTERY */
59+
#endif // end of original rectangle size
4660
#endif /* end of Round or rectangle */
4761

4862
/* for screen shots and font testing

src/c/watchface.c

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,74 @@ void init()
958958
time_color = DEFAULT_TIME_COLOR;
959959
background_color = DEFAULT_BACKGROUND_COLOR;
960960

961+
APP_LOG(APP_LOG_LEVEL_INFO, "PBL_DISPLAY_HEIGHT : %d", PBL_DISPLAY_HEIGHT);
962+
APP_LOG(APP_LOG_LEVEL_INFO, "PBL_DISPLAY_WIDTH : %d", PBL_DISPLAY_WIDTH);
963+
964+
// https://developer.repebble.com/docs/c/Foundation/WatchInfo/#WatchInfoModel
965+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model: %d", watch_info_get_model());
966+
#ifdef DEBUG_HARDWARE_ID
967+
// Generated code
968+
switch(watch_info_get_model())
969+
{
970+
case WATCH_INFO_MODEL_UNKNOWN:
971+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model WATCH_INFO_MODEL_UNKNOWN"); // Unknown model.
972+
break;
973+
974+
case WATCH_INFO_MODEL_PEBBLE_ORIGINAL:
975+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model WATCH_INFO_MODEL_PEBBLE_ORIGINAL"); // Original Pebble.
976+
break;
977+
978+
case WATCH_INFO_MODEL_PEBBLE_STEEL:
979+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model WATCH_INFO_MODEL_PEBBLE_STEEL"); // Pebble Steel.
980+
break;
981+
982+
case WATCH_INFO_MODEL_PEBBLE_TIME:
983+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model WATCH_INFO_MODEL_PEBBLE_TIME"); // Pebble Time.
984+
break;
985+
986+
case WATCH_INFO_MODEL_PEBBLE_TIME_STEEL:
987+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model WATCH_INFO_MODEL_PEBBLE_TIME_STEEL"); // Pebble Time Steel.
988+
break;
989+
990+
case WATCH_INFO_MODEL_PEBBLE_TIME_ROUND_14:
991+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model WATCH_INFO_MODEL_PEBBLE_TIME_ROUND_14"); // Pebble Time Round, 14mm lug size.
992+
break;
993+
994+
case WATCH_INFO_MODEL_PEBBLE_TIME_ROUND_20:
995+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model WATCH_INFO_MODEL_PEBBLE_TIME_ROUND_20"); // Pebble Time Round, 20mm lug size.
996+
break;
997+
998+
case WATCH_INFO_MODEL_PEBBLE_2_HR:
999+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model WATCH_INFO_MODEL_PEBBLE_2_HR"); // Pebble 2 HR.
1000+
break;
1001+
1002+
case WATCH_INFO_MODEL_PEBBLE_2_SE:
1003+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model WATCH_INFO_MODEL_PEBBLE_2_SE"); // Pebble 2 SE.
1004+
break;
1005+
1006+
case WATCH_INFO_MODEL_PEBBLE_TIME_2:
1007+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model WATCH_INFO_MODEL_PEBBLE_TIME_2"); // Pebble Time 2.
1008+
break;
1009+
1010+
case WATCH_INFO_MODEL_COREDEVICES_C2D:
1011+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model WATCH_INFO_MODEL_COREDEVICES_C2D"); // CoreDevices C2D (Core 2 Duo)
1012+
break;
1013+
1014+
case WATCH_INFO_MODEL_COREDEVICES_CT2:
1015+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model WATCH_INFO_MODEL_COREDEVICES_CT2"); // CoreDevices CT2 (Core Time 2)
1016+
break;
1017+
1018+
case WATCH_INFO_MODEL__MAX:
1019+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model WATCH_INFO_MODEL__MAX"); // Max
1020+
break;
1021+
1022+
default:
1023+
APP_LOG(APP_LOG_LEVEL_INFO, "watch_info_get_model UNKNOWN");
1024+
break;
1025+
}
1026+
#endif // DEBUG_HARDWARE_ID
1027+
1028+
9611029
major_version = get_major_app_version();
9621030
APP_LOG(APP_LOG_LEVEL_INFO, "get_major_app_version: %d", major_version);
9631031

0 commit comments

Comments
 (0)