Current location

narf Source control manager Git

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Mehani <shtrom@ssji.net>2014-12-30 22:57:40 +1100
committerOlivier Mehani <shtrom@ssji.net>2014-12-30 22:57:40 +1100
commit86368afaca9a06dec656032e0ea1ab3cfd67b494 (patch)
tree1b2cb7ae6e3af103046923448240c88ce080cb5e
parente438fd186d7fdb86987d9ac8574249e328dcfbfe (diff)
Faster image change, for demosfastdemo
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
-rw-r--r--src/MinistryOfSillyWatches.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/MinistryOfSillyWatches.c b/src/MinistryOfSillyWatches.c
index 3d72b8d..f05eee7 100644
--- a/src/MinistryOfSillyWatches.c
+++ b/src/MinistryOfSillyWatches.c
@@ -52,7 +52,7 @@ static int cane_length;
} while(0)
static void load_face(struct tm *t) {
- switch(t->tm_hour % 12) {
+ switch(t->tm_sec % 12) {
case 0:
SET_FACE(0);
break;
@@ -115,7 +115,7 @@ static void cane_update_proc(struct Layer *layer, GContext *ctx) {
time_t now = time(NULL);
struct tm *t = localtime(&now);
- int32_t angle = TRIG_MAX_ANGLE * (t->tm_min*60 + t->tm_sec) / 3600;
+ int32_t angle = TRIG_MAX_ANGLE * (t->tm_sec*60 + t->tm_sec) / 3600;
cane.y = (int16_t)(-cos_lookup(angle) * (int32_t)cane_length / TRIG_MAX_RATIO) + center.y;
cane.x = (int16_t)(sin_lookup(angle) * (int32_t)cane_length / TRIG_MAX_RATIO) + center.x;
@@ -172,7 +172,7 @@ static void init(void) {
* the time elapsed since the full minute, just like analog watches.
* This is disabled by default to avoid using too much battery.
*/
- tick_timer_service_subscribe(MINUTE_UNIT, tick_handler);
+ tick_timer_service_subscribe(SECOND_UNIT, tick_handler);
const bool animated = true;
window_stack_push(window, animated);
}