summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2009-01-13 22:52:18 +0000
committerBjörn Stenberg <bjorn@haxx.se>2009-01-13 22:52:18 +0000
commit3bfb9d44ae6440b75eaf494a1100f6c1ed21a666 (patch)
treef26051f5a54f10f317e2ee8c63bf8a04eda60366
parentf1c9376cf78656ee5ad27df967d1e172cd67f0e0 (diff)
downloadrockbox-3bfb9d44ae6440b75eaf494a1100f6c1ed21a666.tar.gz
rockbox-3bfb9d44ae6440b75eaf494a1100f6c1ed21a666.zip
A simple boost test plugin.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19767 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/test_boost.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/apps/plugins/test_boost.c b/apps/plugins/test_boost.c
new file mode 100644
index 0000000000..f235e78026
--- /dev/null
+++ b/apps/plugins/test_boost.c
@@ -0,0 +1,69 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id: test_scanrate.c 19673 2009-01-04 23:33:15Z saratoga $
9*
10* Copyright (C) 2009 Björn Stenberg
11*
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.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21
22#include "plugin.h"
23
24PLUGIN_HEADER
25
26enum plugin_status plugin_start(const struct plugin_api* api,
27 const void* parameter)
28{
29 (void)parameter;
30 const struct plugin_api* rb = api;
31 bool done = false;
32 bool boost = false;
33 int count = 0;
34
35 rb->lcd_setfont(FONT_SYSFIXED);
36
37 while (!done)
38 {
39 char buf[32];
40 int j,x;
41 for (j=1; j<100000; j++)
42 x = j*11;
43 rb->lcd_clear_display();
44 rb->snprintf(buf,sizeof buf, "%s %d",boost?"boost":"normal",count);
45 rb->lcd_putsxy(0, 0, buf);
46 rb->lcd_update();
47 count++;
48
49 int button = rb->button_get(false);
50 switch (button)
51 {
52 case BUTTON_UP:
53 boost = true;
54 rb->cpu_boost(boost);
55 break;
56
57 case BUTTON_DOWN:
58 boost = false;
59 rb->cpu_boost(boost);
60 break;
61
62 case BUTTON_LEFT:
63 done = true;
64 break;
65 }
66 }
67
68 return PLUGIN_OK;
69}