Keep pebble time watchface backlight on for longer than 3 seconds

The pebble time watchface dims pretty fast and it only lasts 3 seconds, unfortunately there is no option right to increase that. in watchface it is possible to change this behavior programatically here is how i did it.


  1.   static int seconds;
  2.   static void set_backlight(){
  3.   light_enable_interaction();
  4.   if (seconds<=4)return;
  5.   app_timer_register(3000,set_backlight, NULL);
  6.   }
  7.   static void accel_tap_handler(AccelAxisType axis,int32_t direction) {
  8.   light_enable_interaction();
  9.   seconds = 10;
  10.   app_timer_register(3000,set_backlight, NULL);
  11.   }
  12.   static void main_window_load(Window *window) {
  13.   ...
  14.   accel_tap_service_subscribe(&accel_tap_handler);
  15.   ...
  16.   }
  17.   static void tick_handler(struct tm *tick_time, TimeUnits units_changed) {
  18.   if (seconds>0)seconds--;
  19.   ...
  20.   }
  21.   static void init() {
  22.   ...
  23.   tick_timer_service_subscribe(SECOND_UNIT, tick_handler);
  24.   ...
  25.   }
  26.