Introduce __attribute__((unused)) (#defined to UNUSED_ATTR) to mark possibly unused...
[kugel-rb.git] / apps / plugins / test_boost.c
blob4da7b05774bd44fd09e229e8848cd9112ad22956
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2009 Björn Stenberg
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include "plugin.h"
24 PLUGIN_HEADER
26 enum plugin_status plugin_start(UNUSED_ATTR const void* parameter)
28 bool done = false;
29 bool boost = false;
30 int count = 0;
32 rb->lcd_setfont(FONT_SYSFIXED);
34 while (!done)
36 char buf[32];
37 int j,x;
38 for (j=1; j<100000; j++)
39 x = j*11;
40 rb->lcd_clear_display();
41 rb->snprintf(buf,sizeof buf, "%s %d",boost?"boost":"normal",count);
42 rb->lcd_putsxy(0, 0, buf);
43 rb->lcd_update();
44 count++;
46 int button = rb->button_get(false);
47 switch (button)
49 case BUTTON_UP:
50 boost = true;
51 rb->cpu_boost(boost);
52 break;
54 case BUTTON_DOWN:
55 boost = false;
56 rb->cpu_boost(boost);
57 break;
59 case BUTTON_LEFT:
60 done = true;
61 break;
65 return PLUGIN_OK;