diff --git a/boss/src/boss.c b/boss/src/boss.c index c9403f5..b06a041 100644 --- a/boss/src/boss.c +++ b/boss/src/boss.c @@ -10,11 +10,11 @@ PBL_APP_INFO(MY_UUID, RESOURCE_ID_IMAGE_MENU_ICON, APP_INFO_WATCH_FACE); -#define DISPLAY_SECONDS true -#define DISPLAY_FILLED_HANDS false -#define DISPLAY_DATE true +#define DISPLAY_SECONDS false +#define DISPLAY_FILLED_HANDS true +#define DISPLAY_DATE false #define DISPLAY_LOGO true -#define HOUR_VIBRATION false +#define HOUR_VIBRATION true #define HOUR_VIBRATION_START 8 #define HOUR_VIBRATION_END 20 diff --git a/brown/src/brown.c b/brown/src/brown.c index 1a4c12c..552a0a2 100644 --- a/brown/src/brown.c +++ b/brown/src/brown.c @@ -14,8 +14,8 @@ PBL_APP_INFO(MY_UUID, #define DISPLAY_DATE_SHORT true #define DISPLAY_DATE_LONG false #define HOUR_VIBRATION true -#define HOUR_VIBRATION_START 8 -#define HOUR_VIBRATION_END 20 +#define HOUR_VIBRATION_START 0 +#define HOUR_VIBRATION_END 24 Window window; BmpContainer background_image_container; diff --git a/brown/src/brown.c~ b/brown/src/brown.c~ index 56836c4..0bca91d 100644 --- a/brown/src/brown.c~ +++ b/brown/src/brown.c~ @@ -11,10 +11,10 @@ PBL_APP_INFO(MY_UUID, APP_INFO_WATCH_FACE); #define DISPLAY_SECONDS true -#define DISPLAY_DATE_SHORT true +#define DISPLAY_DATE_SHORT false #define DISPLAY_DATE_LONG false -#define HOUR_VIBRATION true -#define HOUR_VIBRATION_START 6 +#define HOUR_VIBRATION false +#define HOUR_VIBRATION_START 8 #define HOUR_VIBRATION_END 20 Window window; diff --git a/classic/src/classic.c b/classic/src/classic.c index e879b3d..3138401 100644 --- a/classic/src/classic.c +++ b/classic/src/classic.c @@ -12,7 +12,7 @@ PBL_APP_INFO(MY_UUID, #define DISPLAY_SECONDS true #define DISPLAY_TIME false -#define HOUR_VIBRATION false +#define HOUR_VIBRATION true #define HOUR_VIBRATION_START 8 #define HOUR_VIBRATION_END 20 diff --git a/fancy/resources/src/fonts/20db.otf b/fancy/resources/src/fonts/20db.otf new file mode 100644 index 0000000..3742e18 Binary files /dev/null and b/fancy/resources/src/fonts/20db.otf differ diff --git a/fancy/resources/src/fonts/Exo-Light.otf b/fancy/resources/src/fonts/Exo-Light.otf new file mode 100644 index 0000000..490fe6d Binary files /dev/null and b/fancy/resources/src/fonts/Exo-Light.otf differ diff --git a/fancy/resources/src/fonts/Roboto-Thin.ttf b/fancy/resources/src/fonts/Roboto-Thin.ttf new file mode 100644 index 0000000..861d63a Binary files /dev/null and b/fancy/resources/src/fonts/Roboto-Thin.ttf differ diff --git a/fancy/resources/src/fonts/SIL Open Font License 1.1.txt b/fancy/resources/src/fonts/SIL Open Font License 1.1.txt new file mode 100644 index 0000000..e4b0c4f --- /dev/null +++ b/fancy/resources/src/fonts/SIL Open Font License 1.1.txt @@ -0,0 +1,91 @@ +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. \ No newline at end of file diff --git a/fancy/resources/src/fonts/Tangerine_Regular.ttf b/fancy/resources/src/fonts/Tangerine_Regular.ttf new file mode 100644 index 0000000..2a2a9e1 Binary files /dev/null and b/fancy/resources/src/fonts/Tangerine_Regular.ttf differ diff --git a/fancy/resources/src/images/fancy_background.png b/fancy/resources/src/images/fancy_background.png new file mode 100644 index 0000000..0d92424 Binary files /dev/null and b/fancy/resources/src/images/fancy_background.png differ diff --git a/fancy/resources/src/images/fancy_logo.png b/fancy/resources/src/images/fancy_logo.png new file mode 100644 index 0000000..661f60d Binary files /dev/null and b/fancy/resources/src/images/fancy_logo.png differ diff --git a/fancy/resources/src/resource_map.json b/fancy/resources/src/resource_map.json new file mode 100644 index 0000000..10a653d --- /dev/null +++ b/fancy/resources/src/resource_map.json @@ -0,0 +1,22 @@ + +{"friendlyVersion": "VERSION", + "versionDefName": "APP_RESOURCES", + + "media": [ + { + "type":"png", + "defName":"IMAGE_BACKGROUND", + "file":"images/fancy_background.png" + }, + { + "type":"png", + "defName":"IMAGE_MENU_ICON", + "file":"images/fancy_logo.png" + }, + { + "type": "font", + "defName": "FONT_EXO_LIGHT_16", + "file": "fonts/Exo-Light.otf" + } + ] +} diff --git a/fancy/resources/src/resource_map.json~ b/fancy/resources/src/resource_map.json~ new file mode 100644 index 0000000..e3993bc --- /dev/null +++ b/fancy/resources/src/resource_map.json~ @@ -0,0 +1,22 @@ + +{"friendlyVersion": "VERSION", + "versionDefName": "APP_RESOURCES", + + "media": [ + { + "type":"png", + "defName":"IMAGE_BACKGROUND", + "file":"images/fancy_background.png" + }, + { + "type":"png", + "defName":"IMAGE_MENU_ICON", + "file":"images/fancy_logo.png" + }, + { + "type": "font", + "defName": "FONT_ROBOTO_THIN_20", + "file": "fonts/Roboto-Thin.ttf" + } + ] +} diff --git a/fancy/src/fancy.c b/fancy/src/fancy.c new file mode 100644 index 0000000..18e3e5a --- /dev/null +++ b/fancy/src/fancy.c @@ -0,0 +1,236 @@ +#include "pebble_os.h" +#include "pebble_app.h" +#include "pebble_fonts.h" + + +#define MY_UUID { 0xEB, 0x90, 0x36, 0x94, 0xC0, 0xF9, 0x42, 0x0F, 0x92, 0x43, 0x20, 0x40, 0x45, 0x70, 0xD2, 0x2D } +PBL_APP_INFO(MY_UUID, + "Fancy", "Zalew", + 1, 0, /* App version */ + RESOURCE_ID_IMAGE_MENU_ICON, + APP_INFO_WATCH_FACE); +/*preprocessor conditions: +DISPLAY_SECONDS - draws seconds hand +DISPLAY_DATE - draws date +HOUR_VIBRATION - short vibration every hour between 8:00 and 22:00 +*/ + +#define DISPLAY_SECONDS true +#define HOUR_VIBRATION true +#define DISPLAY_DATE true +#define HOUR_VIBRATION_START 8 +#define HOUR_VIBRATION_END 20 + +Window window; +BmpContainer background_image_container; + +Layer minute_display_layer; +Layer hour_display_layer; +Layer center_display_layer; +Layer second_display_layer; +#if DISPLAY_DATE +TextLayer date_layer; +GFont date_font; +static char date_text[] = "Sat 20"; +#endif + +const GPathInfo MINUTE_HAND_PATH_POINTS = { + 3, + (GPoint []) { + {-6, 15}, + {6, 15}, + {0, -65}, + } +}; + + +const GPathInfo HOUR_HAND_PATH_POINTS = { + 3, + (GPoint []) { + {-7, 15}, + {7, 15}, + {7, -45}, + } +}; + + +GPath hour_hand_path; +GPath minute_hand_path; + +#if DISPLAY_SECONDS +void second_display_layer_update_callback(Layer *me, GContext* ctx) { + (void)me; + + PblTm t; + get_time(&t); + + int32_t second_angle = t.tm_sec * (0xffff/60); + int second_hand_length = 60; + + graphics_context_set_fill_color(ctx, GColorWhite); + + GPoint center = grect_center_point(&me->frame); + GPoint second = GPoint(center.x + second_hand_length * sin_lookup(second_angle)/0xffff, + center.y + (-second_hand_length) * cos_lookup(second_angle)/0xffff); + + graphics_draw_line(ctx, center, second); +} +#endif +void center_display_layer_update_callback(Layer *me, GContext* ctx) { + (void)me; + + GPoint center = grect_center_point(&me->frame); + graphics_context_set_fill_color(ctx, GColorBlack); + graphics_fill_circle(ctx, center, 2); + graphics_context_set_fill_color(ctx, GColorWhite); + graphics_fill_circle(ctx, center, 1); +} + +void minute_display_layer_update_callback(Layer *me, GContext* ctx) { + (void)me; + + PblTm t; + + get_time(&t); + + unsigned int angle = t.tm_min * 6 + t.tm_sec / 10; + gpath_rotate_to(&minute_hand_path, (TRIG_MAX_ANGLE / 360) * angle); + + graphics_context_set_fill_color(ctx, GColorWhite); + gpath_draw_filled(ctx, &minute_hand_path); + graphics_context_set_stroke_color(ctx, GColorBlack); + gpath_draw_outline(ctx, &minute_hand_path); +} + +void hour_display_layer_update_callback(Layer *me, GContext* ctx) { + (void)me; + + PblTm t; + + get_time(&t); + + unsigned int angle = t.tm_hour * 30 + t.tm_min / 2; + gpath_rotate_to(&hour_hand_path, (TRIG_MAX_ANGLE / 360) * angle); + + graphics_context_set_fill_color(ctx, GColorWhite); + gpath_draw_filled(ctx, &hour_hand_path); + graphics_context_set_stroke_color(ctx, GColorBlack); + gpath_draw_outline(ctx, &hour_hand_path); +} + +#if DISPLAY_DATE +void draw_date(){ + PblTm t; + get_time(&t); + + string_format_time(date_text, sizeof(date_text), "%a %d", &t); + text_layer_set_text(&date_layer, date_text); +} +#endif + +void handle_init(AppContextRef ctx) { + (void)ctx; + + window_init(&window, "Modern Watch"); + window_stack_push(&window, true /* Animated */); + resource_init_current_app(&APP_RESOURCES); + + bmp_init_container(RESOURCE_ID_IMAGE_BACKGROUND, &background_image_container); + layer_add_child(&window.layer, &background_image_container.layer.layer); + +#if DISPLAY_DATE + date_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_EXO_LIGHT_16)); + text_layer_init(&date_layer, GRect(20, 100, 104, 45)); + text_layer_set_text_color(&date_layer, GColorWhite); + text_layer_set_text_alignment(&date_layer, GTextAlignmentCenter); + text_layer_set_background_color(&date_layer, GColorClear); + text_layer_set_font(&date_layer, date_font); + layer_add_child(&window.layer, &date_layer.layer); + + draw_date(); +#endif + + layer_init(&hour_display_layer, window.layer.frame); + hour_display_layer.update_proc = &hour_display_layer_update_callback; + layer_add_child(&window.layer, &hour_display_layer); + + gpath_init(&hour_hand_path, &HOUR_HAND_PATH_POINTS); + gpath_move_to(&hour_hand_path, grect_center_point(&hour_display_layer.frame)); + + layer_init(&minute_display_layer, window.layer.frame); + minute_display_layer.update_proc = &minute_display_layer_update_callback; + layer_add_child(&window.layer, &minute_display_layer); + + gpath_init(&minute_hand_path, &MINUTE_HAND_PATH_POINTS); + gpath_move_to(&minute_hand_path, grect_center_point(&minute_display_layer.frame)); + + layer_init(¢er_display_layer, window.layer.frame); + center_display_layer.update_proc = ¢er_display_layer_update_callback; + layer_add_child(&window.layer, ¢er_display_layer); +#if DISPLAY_SECONDS + layer_init(&second_display_layer, window.layer.frame); + second_display_layer.update_proc = &second_display_layer_update_callback; + layer_add_child(&window.layer, &second_display_layer); +#endif +} + +void handle_deinit(AppContextRef ctx) { + (void)ctx; + + bmp_deinit_container(&background_image_container); +#if DISPLAY_DATE + fonts_unload_custom_font(date_font); +#endif +} + +void handle_tick(AppContextRef ctx, PebbleTickEvent *t){ + (void)t; + (void)ctx; + + if(t->tick_time->tm_sec%10==0) + { + layer_mark_dirty(&minute_display_layer); + + if(t->tick_time->tm_sec==0) + { + if(t->tick_time->tm_min%2==0) + { + layer_mark_dirty(&hour_display_layer); +#if DISPLAY_DATE_ANALOG || DISPLAY_DATE_DIGITAL || DISPLAY_DATE_DIGITAL_DAY + if(t->tick_time->tm_min==0&&t->tick_time->tm_hour==0) + { + draw_date(); + } +#endif +#if HOUR_VIBRATION + if(t->tick_time->tm_min==0 + &&t->tick_time->tm_hour>=HOUR_VIBRATION_START + &&t->tick_time->tm_hour<=HOUR_VIBRATION_END) + { + vibes_double_pulse(); + } +#endif + } + } + } + +#if DISPLAY_SECONDS + layer_mark_dirty(&second_display_layer); +#endif +} + +void pbl_main(void *params) { + PebbleAppHandlers handlers = { + .init_handler = &handle_init, + .deinit_handler = &handle_deinit, + .tick_info = { + .tick_handler = &handle_tick, +#if DISPLAY_SECONDS + .tick_units = SECOND_UNIT +#else + .tick_units = MINUTE_UNIT +#endif + } + }; + app_event_loop(params, &handlers); +} diff --git a/fancy/src/fancy.c~ b/fancy/src/fancy.c~ new file mode 100644 index 0000000..7bc85be --- /dev/null +++ b/fancy/src/fancy.c~ @@ -0,0 +1,236 @@ +#include "pebble_os.h" +#include "pebble_app.h" +#include "pebble_fonts.h" + + +#define MY_UUID { 0xEB, 0x90, 0x36, 0x94, 0xC0, 0xF9, 0x42, 0x0F, 0x92, 0x43, 0x20, 0x40, 0x45, 0x70, 0xD2, 0x2D } +PBL_APP_INFO(MY_UUID, + "Fancy", "Zalew", + 1, 0, /* App version */ + RESOURCE_ID_IMAGE_MENU_ICON, + APP_INFO_WATCH_FACE); +/*preprocessor conditions: +DISPLAY_SECONDS - draws seconds hand +DISPLAY_DATE - draws date +HOUR_VIBRATION - short vibration every hour between 8:00 and 22:00 +*/ + +#define DISPLAY_SECONDS true +#define HOUR_VIBRATION true +#define DISPLAY_DATE true +#define HOUR_VIBRATION_START 8 +#define HOUR_VIBRATION_END 20 + +Window window; +BmpContainer background_image_container; + +Layer minute_display_layer; +Layer hour_display_layer; +Layer center_display_layer; +Layer second_display_layer; +#if DISPLAY_DATE +TextLayer date_layer; +GFont date_font; +static char date_text[] = "Sat 20"; +#endif + +const GPathInfo MINUTE_HAND_PATH_POINTS = { + 3, + (GPoint []) { + {-6, 15}, + {6, 15}, + {0, -65}, + } +}; + + +const GPathInfo HOUR_HAND_PATH_POINTS = { + 3, + (GPoint []) { + {-7, 15}, + {7, 15}, + {7, -45}, + } +}; + + +GPath hour_hand_path; +GPath minute_hand_path; + +#if DISPLAY_SECONDS +void second_display_layer_update_callback(Layer *me, GContext* ctx) { + (void)me; + + PblTm t; + get_time(&t); + + int32_t second_angle = t.tm_sec * (0xffff/60); + int second_hand_length = 60; + + graphics_context_set_fill_color(ctx, GColorWhite); + + GPoint center = grect_center_point(&me->frame); + GPoint second = GPoint(center.x + second_hand_length * sin_lookup(second_angle)/0xffff, + center.y + (-second_hand_length) * cos_lookup(second_angle)/0xffff); + + graphics_draw_line(ctx, center, second); +} +#endif +void center_display_layer_update_callback(Layer *me, GContext* ctx) { + (void)me; + + GPoint center = grect_center_point(&me->frame); + graphics_context_set_fill_color(ctx, GColorBlack); + graphics_fill_circle(ctx, center, 2); + graphics_context_set_fill_color(ctx, GColorWhite); + graphics_fill_circle(ctx, center, 1); +} + +void minute_display_layer_update_callback(Layer *me, GContext* ctx) { + (void)me; + + PblTm t; + + get_time(&t); + + unsigned int angle = t.tm_min * 6 + t.tm_sec / 10; + gpath_rotate_to(&minute_hand_path, (TRIG_MAX_ANGLE / 360) * angle); + + graphics_context_set_fill_color(ctx, GColorWhite); + gpath_draw_filled(ctx, &minute_hand_path); + graphics_context_set_stroke_color(ctx, GColorBlack); + gpath_draw_outline(ctx, &minute_hand_path); +} + +void hour_display_layer_update_callback(Layer *me, GContext* ctx) { + (void)me; + + PblTm t; + + get_time(&t); + + unsigned int angle = t.tm_hour * 30 + t.tm_min / 2; + gpath_rotate_to(&hour_hand_path, (TRIG_MAX_ANGLE / 360) * angle); + + graphics_context_set_fill_color(ctx, GColorWhite); + gpath_draw_filled(ctx, &hour_hand_path); + graphics_context_set_stroke_color(ctx, GColorBlack); + gpath_draw_outline(ctx, &hour_hand_path); +} + +#if DISPLAY_DATE +void draw_date(){ + PblTm t; + get_time(&t); + + string_format_time(date_text, sizeof(date_text), "%a %d", &t); + text_layer_set_text(&date_layer, date_text); +} +#endif + +void handle_init(AppContextRef ctx) { + (void)ctx; + + window_init(&window, "Modern Watch"); + window_stack_push(&window, true /* Animated */); + resource_init_current_app(&APP_RESOURCES); + + bmp_init_container(RESOURCE_ID_IMAGE_BACKGROUND, &background_image_container); + layer_add_child(&window.layer, &background_image_container.layer.layer); + +#if DISPLAY_DATE + date_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_EXO_LIGHT_16)); + text_layer_init(&date_layer, GRect(20, 95, 104, 45)); + text_layer_set_text_color(&date_layer, GColorWhite); + text_layer_set_text_alignment(&date_layer, GTextAlignmentCenter); + text_layer_set_background_color(&date_layer, GColorClear); + text_layer_set_font(&date_layer, date_font); + layer_add_child(&window.layer, &date_layer.layer); + + draw_date(); +#endif + + layer_init(&hour_display_layer, window.layer.frame); + hour_display_layer.update_proc = &hour_display_layer_update_callback; + layer_add_child(&window.layer, &hour_display_layer); + + gpath_init(&hour_hand_path, &HOUR_HAND_PATH_POINTS); + gpath_move_to(&hour_hand_path, grect_center_point(&hour_display_layer.frame)); + + layer_init(&minute_display_layer, window.layer.frame); + minute_display_layer.update_proc = &minute_display_layer_update_callback; + layer_add_child(&window.layer, &minute_display_layer); + + gpath_init(&minute_hand_path, &MINUTE_HAND_PATH_POINTS); + gpath_move_to(&minute_hand_path, grect_center_point(&minute_display_layer.frame)); + + layer_init(¢er_display_layer, window.layer.frame); + center_display_layer.update_proc = ¢er_display_layer_update_callback; + layer_add_child(&window.layer, ¢er_display_layer); +#if DISPLAY_SECONDS + layer_init(&second_display_layer, window.layer.frame); + second_display_layer.update_proc = &second_display_layer_update_callback; + layer_add_child(&window.layer, &second_display_layer); +#endif +} + +void handle_deinit(AppContextRef ctx) { + (void)ctx; + + bmp_deinit_container(&background_image_container); +#if DISPLAY_DATE + fonts_unload_custom_font(date_font); +#endif +} + +void handle_tick(AppContextRef ctx, PebbleTickEvent *t){ + (void)t; + (void)ctx; + + if(t->tick_time->tm_sec%10==0) + { + layer_mark_dirty(&minute_display_layer); + + if(t->tick_time->tm_sec==0) + { + if(t->tick_time->tm_min%2==0) + { + layer_mark_dirty(&hour_display_layer); +#if DISPLAY_DATE_ANALOG || DISPLAY_DATE_DIGITAL || DISPLAY_DATE_DIGITAL_DAY + if(t->tick_time->tm_min==0&&t->tick_time->tm_hour==0) + { + draw_date(); + } +#endif +#if HOUR_VIBRATION + if(t->tick_time->tm_min==0 + &&t->tick_time->tm_hour>=HOUR_VIBRATION_START + &&t->tick_time->tm_hour<=HOUR_VIBRATION_END) + { + vibes_double_pulse(); + } +#endif + } + } + } + +#if DISPLAY_SECONDS + layer_mark_dirty(&second_display_layer); +#endif +} + +void pbl_main(void *params) { + PebbleAppHandlers handlers = { + .init_handler = &handle_init, + .deinit_handler = &handle_deinit, + .tick_info = { + .tick_handler = &handle_tick, +#if DISPLAY_SECONDS + .tick_units = SECOND_UNIT +#else + .tick_units = MINUTE_UNIT +#endif + } + }; + app_event_loop(params, &handlers); +} diff --git a/maurice/src/maurice.c b/maurice/src/maurice.c index c04a1fa..912460e 100644 --- a/maurice/src/maurice.c +++ b/maurice/src/maurice.c @@ -13,7 +13,7 @@ PBL_APP_INFO(MY_UUID, #define DISPLAY_SECONDS true #define DISPLAY_LOGO true #define DISPLAY_DATE true -#define HOUR_VIBRATION false +#define HOUR_VIBRATION true #define HOUR_VIBRATION_START 8 #define HOUR_VIBRATION_END 20 diff --git a/modern/src/modern.c b/modern/src/modern.c index b595996..15f2ac2 100644 --- a/modern/src/modern.c +++ b/modern/src/modern.c @@ -21,10 +21,10 @@ HOUR_VIBRATION - short vibration every hour between 8:00 and 22:00 #define DISPLAY_SECONDS true #define DISPLAY_DATE_ANALOG false -#define DISPLAY_DATE_DIGITAL false +#define DISPLAY_DATE_DIGITAL true #define DISPLAY_DATE_DIGITAL_DAY false -#define DISPLAY_LOGO true -#define HOUR_VIBRATION false +#define DISPLAY_LOGO false +#define HOUR_VIBRATION true #define HOUR_VIBRATION_START 8 #define HOUR_VIBRATION_END 20