1
0
Fork 0
forked from len0rd/rockbox

Fix logic of test_codec for targets with HAVE_ADJUSTABLE_CPU_FREQ.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30374 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2011-08-29 13:00:35 +00:00
parent e137e9e47f
commit 656625b30e

View file

@ -20,8 +20,6 @@
****************************************************************************/ ****************************************************************************/
#include "plugin.h" #include "plugin.h"
/* All swcodec targets have BUTTON_SELECT apart from the H10 and M3 */ /* All swcodec targets have BUTTON_SELECT apart from the H10 and M3 */
#if CONFIG_KEYPAD == IRIVER_H10_PAD #if CONFIG_KEYPAD == IRIVER_H10_PAD
@ -52,7 +50,6 @@ static const struct opt_items boost_settings[2] = {
{ "No", -1 }, { "No", -1 },
{ "Yes", -1 }, { "Yes", -1 },
}; };
#endif #endif
/* Log functions copied from test_disk.c */ /* Log functions copied from test_disk.c */
@ -225,7 +222,6 @@ void close_wav(void)
/* Returns buffer to malloc array. Only codeclib should need this. */ /* Returns buffer to malloc array. Only codeclib should need this. */
static void* codec_get_buffer(size_t *size) static void* codec_get_buffer(size_t *size)
{ {
DEBUGF("codec_get_buffer(%"PRIuPTR")\n",(uintptr_t)size);
*size = CODEC_SIZE; *size = CODEC_SIZE;
return codec_mallocbuf; return codec_mallocbuf;
} }
@ -835,11 +831,11 @@ enum plugin_status plugin_start(const void* parameter)
enum enum
{ {
SPEED_TEST = 0,
SPEED_TEST_DIR,
#ifdef HAVE_ADJUSTABLE_CPU_FREQ #ifdef HAVE_ADJUSTABLE_CPU_FREQ
BOOST, BOOST = 0,
#endif #endif
SPEED_TEST = 1,
SPEED_TEST_DIR,
WRITE_WAV, WRITE_WAV,
SPEED_TEST_WITH_DSP, SPEED_TEST_WITH_DSP,
SPEED_TEST_DIR_WITH_DSP, SPEED_TEST_DIR_WITH_DSP,
@ -851,11 +847,11 @@ enum plugin_status plugin_start(const void* parameter)
MENUITEM_STRINGLIST( MENUITEM_STRINGLIST(
menu, "test_codec", NULL, menu, "test_codec", NULL,
"Speed test",
"Speed test folder",
#ifdef HAVE_ADJUSTABLE_CPU_FREQ #ifdef HAVE_ADJUSTABLE_CPU_FREQ
"Boosting", "Boosting",
#endif #endif
"Speed test",
"Speed test folder",
"Write WAV", "Write WAV",
"Speed test with DSP", "Speed test with DSP",
"Speed test folder with DSP", "Speed test folder with DSP",
@ -874,8 +870,8 @@ menu:
#endif #endif
result = rb->do_menu(&menu, &selection, NULL, false); result = rb->do_menu(&menu, &selection, NULL, false);
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
if (result == BOOST) if (result == BOOST)
{ {
rb->set_option("Boosting", &boost, INT, rb->set_option("Boosting", &boost, INT,
@ -894,17 +890,18 @@ menu:
scandir = 0; scandir = 0;
if ((checksum = (result == CHECKSUM || result == CHECKSUM_DIR))) /* Map test runs with checksum calcualtion to standard runs
#ifdef HAVE_ADJUSTABLE_CPU_FREQ * SPEED_TEST and SPEED_TEST_DIR and set the 'checksum' flag. */
result -= 7; if ((checksum = (result == CHECKSUM ||
#else result == CHECKSUM_DIR)))
result -= 6; result -= 6;
#endif
if ((use_dsp = ((result >= SPEED_TEST_WITH_DSP) /* Map test runs with DSP to standard runs SPEED_TEST,
&& (result <= WRITE_WAV_WITH_DSP)))) { * SPEED_TEST_DIR and WRITE_WAV and set the 'use_dsp' flag. */
if ((use_dsp = (result >= SPEED_TEST_WITH_DSP &&
result <= WRITE_WAV_WITH_DSP)))
result -= 3; result -= 3;
}
if (result == SPEED_TEST) { if (result == SPEED_TEST) {
wavinfo.fd = -1; wavinfo.fd = -1;
log_init(false); log_init(false);