summaryrefslogtreecommitdiff
path: root/apps/plugins/clock/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/clock/clock.c')
-rw-r--r--apps/plugins/clock/clock.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/apps/plugins/clock/clock.c b/apps/plugins/clock/clock.c
index 9279a182ee..f0001780bf 100644
--- a/apps/plugins/clock/clock.c
+++ b/apps/plugins/clock/clock.c
@@ -56,8 +56,6 @@ const struct button_mapping* plugin_contexts[]={
56#define ACTION_SKIN_PREV PLA_DEC 56#define ACTION_SKIN_PREV PLA_DEC
57#define ACTION_SKIN_PREV_REPEAT PLA_DEC_REPEAT 57#define ACTION_SKIN_PREV_REPEAT PLA_DEC_REPEAT
58 58
59extern const struct plugin_api* rb;
60
61/************************** 59/**************************
62 * Cleanup on plugin return 60 * Cleanup on plugin return
63 *************************/ 61 *************************/
@@ -111,7 +109,7 @@ void format_date(char* buffer, struct time* time, enum date_format format){
111/********************************************************************** 109/**********************************************************************
112 * Plugin starts here 110 * Plugin starts here
113 **********************************************************************/ 111 **********************************************************************/
114enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter){ 112enum plugin_status plugin_start(const void* parameter){
115 int button; 113 int button;
116 int last_second = -1; 114 int last_second = -1;
117 bool redraw=true; 115 bool redraw=true;
@@ -120,7 +118,6 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
120 struct counter counter; 118 struct counter counter;
121 bool exit_clock = false; 119 bool exit_clock = false;
122 (void)parameter; 120 (void)parameter;
123 rb = api;
124 121
125#if LCD_DEPTH > 1 122#if LCD_DEPTH > 1
126 rb->lcd_set_backdrop(NULL); 123 rb->lcd_set_backdrop(NULL);
@@ -129,7 +126,6 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
129 load_settings(); 126 load_settings();
130 127
131 /* init xlcd functions */ 128 /* init xlcd functions */
132 xlcd_init(rb);
133 counter_init(&counter); 129 counter_init(&counter);
134 clock_draw_set_colors(); 130 clock_draw_set_colors();
135 131
@@ -142,7 +138,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
142 /************************* 138 /*************************
143 * Scan for button presses 139 * Scan for button presses
144 ************************/ 140 ************************/
145 button = pluginlib_getaction(rb, HZ/10, plugin_contexts, PLA_ARRAY_COUNT); 141 button = pluginlib_getaction(HZ/10, plugin_contexts, PLA_ARRAY_COUNT);
146 redraw=true;/* we'll set it to false afterwards if there was no action */ 142 redraw=true;/* we'll set it to false afterwards if there was no action */
147 switch (button){ 143 switch (button){
148 case ACTION_COUNTER_TOGGLE: /* start/stop counter */ 144 case ACTION_COUNTER_TOGGLE: /* start/stop counter */