1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2010 Thomas Martitz
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 ****************************************************************************/
26 #define BUF_SIZE ((PLUGIN_BUFFER_SIZE-(10<<10)) / (sizeof(int)))
28 static volatile int buf
[BUF_SIZE
];
29 #define KB_PER_SEC(delta) ((BUF_SIZE*sizeof(buf[0])*LOOP_REPEAT/delta) >> 10)
31 enum plugin_status
plugin_start(const void* parameter
)
39 rb
->lcd_setfont(FONT_SYSFIXED
);
47 last_tick
= *rb
->current_tick
;
49 for(i
= 0; i
< LOOP_REPEAT
; i
++)
51 for (j
= 0; j
< BUF_SIZE
; j
++)
54 delta
= *rb
->current_tick
- last_tick
;
55 rb
->screens
[0]->clear_display();
56 rb
->screens
[0]->putsf(0, line
++, "%s", boost
?"boosted":"unboosted");
57 rb
->screens
[0]->putsf(0, line
++, "bufsize: %u", BUF_SIZE
*sizeof(buf
[0]));
58 rb
->screens
[0]->putsf(0, line
++, "loop#: %d", ++count
);
59 rb
->screens
[0]->putsf(0, line
++, "write ticks: %d (%d kB/s)", delta
,
61 last_tick
= *rb
->current_tick
;
62 for(i
= 0; i
< LOOP_REPEAT
; i
++)
64 for(j
= 0; j
< BUF_SIZE
; j
++)
67 delta
= *rb
->current_tick
- last_tick
;
68 rb
->screens
[0]->putsf(0, line
++, "read ticks: %d (%d kB/s)", delta
,
70 rb
->screens
[0]->update();
72 int button
= rb
->button_get(false);