New plugin: FFT, A frequency analyzer plugin
[kugel-rb.git] / apps / plugins / test_boost.c
blob0cd2696e333b86fea7655ed39bbf520133a2b817
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(const void* parameter)
28 (void)parameter;
29 bool done = false;
30 bool boost = false;
31 int count = 0;
33 rb->lcd_setfont(FONT_SYSFIXED);
35 while (!done)
37 char buf[32];
38 int j,x;
39 for (j=1; j<100000; j++)
40 x = j*11;
41 rb->lcd_clear_display();
42 rb->snprintf(buf,sizeof buf, "%s %d",boost?"boost":"normal",count);
43 rb->lcd_putsxy(0, 0, buf);
44 rb->lcd_update();
45 count++;
47 int button = rb->button_get(false);
48 switch (button)
50 case BUTTON_UP:
51 boost = true;
52 rb->cpu_boost(boost);
53 break;
55 case BUTTON_DOWN:
56 boost = false;
57 rb->cpu_boost(boost);
58 break;
60 case BUTTON_LEFT:
61 done = true;
62 break;
66 return PLUGIN_OK;