diff options
-rw-r--r-- | apps/plugins/battery_bench.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index bb0e4f594b..b82e4f858c 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c | |||
@@ -236,22 +236,10 @@ | |||
236 | #endif | 236 | #endif |
237 | 237 | ||
238 | /****************************** Plugin Entry Point ****************************/ | 238 | /****************************** Plugin Entry Point ****************************/ |
239 | int main(void); | 239 | static long start_tick; |
240 | bool exit_tsr(bool); | ||
241 | void thread(void); | ||
242 | |||
243 | |||
244 | enum plugin_status plugin_start(const void* parameter) | ||
245 | { | ||
246 | (void)parameter; | ||
247 | |||
248 | return main(); | ||
249 | } | ||
250 | |||
251 | long start_tick; | ||
252 | 240 | ||
253 | /* Struct for battery information */ | 241 | /* Struct for battery information */ |
254 | struct batt_info | 242 | static struct batt_info |
255 | { | 243 | { |
256 | /* the size of the struct elements is optimised to make the struct size | 244 | /* the size of the struct elements is optimised to make the struct size |
257 | * a power of 2 */ | 245 | * a power of 2 */ |
@@ -269,7 +257,7 @@ static struct event_queue thread_q; | |||
269 | static bool in_usb_mode; | 257 | static bool in_usb_mode; |
270 | static unsigned int buf_idx; | 258 | static unsigned int buf_idx; |
271 | 259 | ||
272 | bool exit_tsr(bool reenter) | 260 | static bool exit_tsr(bool reenter) |
273 | { | 261 | { |
274 | long button; | 262 | long button; |
275 | (void)reenter; | 263 | (void)reenter; |
@@ -305,7 +293,7 @@ bool exit_tsr(bool reenter) | |||
305 | #define HMS(x) (x)/3600,((x)%3600)/60,((x)%3600)%60 | 293 | #define HMS(x) (x)/3600,((x)%3600)/60,((x)%3600)%60 |
306 | 294 | ||
307 | /* use long for aligning */ | 295 | /* use long for aligning */ |
308 | unsigned long thread_stack[THREAD_STACK_SIZE/sizeof(long)]; | 296 | static unsigned long thread_stack[THREAD_STACK_SIZE/sizeof(long)]; |
309 | 297 | ||
310 | #if CONFIG_CHARGING || defined(HAVE_USB_POWER) | 298 | #if CONFIG_CHARGING || defined(HAVE_USB_POWER) |
311 | static unsigned int charge_state(void) | 299 | static unsigned int charge_state(void) |
@@ -378,7 +366,7 @@ static void flush_buffer(void* data) | |||
378 | } | 366 | } |
379 | 367 | ||
380 | 368 | ||
381 | void thread(void) | 369 | static void thread(void) |
382 | { | 370 | { |
383 | bool exit = false; | 371 | bool exit = false; |
384 | char *exit_reason = "unknown"; | 372 | char *exit_reason = "unknown"; |
@@ -467,8 +455,9 @@ static void put_centered_str(const char* str, plcdfunc putsxy, int lcd_width, in | |||
467 | } | 455 | } |
468 | #endif | 456 | #endif |
469 | 457 | ||
470 | int main(void) | 458 | enum plugin_status plugin_start(const void* parameter) |
471 | { | 459 | { |
460 | (void)parameter; | ||
472 | int button, fd; | 461 | int button, fd; |
473 | bool on = false; | 462 | bool on = false; |
474 | start_tick = *rb->current_tick; | 463 | start_tick = *rb->current_tick; |