1
0
Fork 0
forked from len0rd/rockbox

Commit FS#11810 by Alexander Meshcheryakov. Boosts the CPU and limits LCD update rate while recursively scanning files in the properties plugin, improving its scan speed.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28841 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Giacomelli 2010-12-16 05:49:30 +00:00
parent abf4065181
commit fa49771809

View file

@ -146,6 +146,7 @@ static bool _dir_properties(DPS* dps)
/* recursively scan directories in search of files
and informs the user of the progress */
bool result;
static long lasttick=0;
int dirlen;
DIR* dir;
struct dirent* entry;
@ -173,6 +174,9 @@ static bool _dir_properties(DPS* dps)
continue; /* skip these */
dps->dc++; /* new directory */
if (*rb->current_tick - lasttick > (HZ/8))
{
lasttick = *rb->current_tick;
rb->lcd_clear_display();
rb->lcd_puts(0,0,"SCANNING...");
rb->lcd_puts(0,1,dps->dirname);
@ -183,6 +187,7 @@ static bool _dir_properties(DPS* dps)
rb->lcd_putsf(0,5,"Size: %ld %cB", (long) (dps->bc >> (10*log)),
human_size_prefix[log]);
rb->lcd_update();
}
/* recursion */
result = _dir_properties(dps);
@ -211,9 +216,17 @@ static bool dir_properties(char* selected_file)
};
rb->strlcpy(dps.dirname, selected_file, MAX_PATH);
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
rb->cpu_boost(true);
#endif
if(false == _dir_properties(&dps))
return false;
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
rb->cpu_boost(false);
#endif
rb->strlcpy(str_dirname, selected_file, MAX_PATH);
rb->snprintf(str_dircount, sizeof str_dircount, "Subdirs: %d", dps.dc);
rb->snprintf(str_filecount, sizeof str_filecount, "Files: %d", dps.fc);