From 112ad0ac421f47d819af11ae18b2218b508737bf Mon Sep 17 00:00:00 2001 From: Wincent Balin Date: Mon, 24 May 2010 23:38:04 +0000 Subject: pdbox: Code cleanup git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26274 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/pdbox/pdbox.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'apps/plugins/pdbox/pdbox.c') diff --git a/apps/plugins/pdbox/pdbox.c b/apps/plugins/pdbox/pdbox.c index 56371af81f..cdec7a279c 100644 --- a/apps/plugins/pdbox/pdbox.c +++ b/apps/plugins/pdbox/pdbox.c @@ -124,7 +124,7 @@ void gui_thread(void) /* Core thread */ void core_thread(void) { - /* Add the directory the called .pd resides in to lib directories. */ + /* Add the directory the called .pd file resides in to lib directories. */ sys_findlibdir(filename); /* Open the PD design file. */ @@ -146,7 +146,7 @@ void core_thread(void) while(sys_send_dacs() != SENDDACS_NO) sched_tick(sys_time + sys_time_per_dsp_tick); - yield(); + rb->sleep(1); } rb->thread_exit(); @@ -178,12 +178,8 @@ enum plugin_status plugin_start(const void* parameter) rb->splash(HZ, "Not enough memory!"); return PLUGIN_ERROR; } -#if 1 + init_memory_pool(mem_size, mem_pool); -#endif -#if 0 - set_memory_pool(mem_pool, mem_size); -#endif /* Initialize net. */ net_init(); @@ -207,6 +203,12 @@ enum plugin_status plugin_start(const void* parameter) DEFAULTADVANCE, /* Scheduler advance */ 1 /* Enable */); + /* Initialize scheduler time variables. */ + sys_time = 0; + sys_time_per_dsp_tick = (TIMEUNITPERSEC) * + ((double) sys_schedblocksize) / sys_dacsr; + + /* Create stacks for threads. */ core_stack = getbytes(CORESTACKSIZE); gui_stack = getbytes(GUISTACKSIZE); @@ -242,12 +244,6 @@ enum plugin_status plugin_start(const void* parameter) if(core_thread_id == 0 || gui_thread_id == 0) return PLUGIN_ERROR; - /* Initialize scheduler time variables. */ - sys_time = 0; - sys_time_per_dsp_tick = (TIMEUNITPERSEC) * - ((double) sys_schedblocksize) / sys_dacsr; - - /* Main loop. */ while(!quit) { @@ -272,12 +268,8 @@ enum plugin_status plugin_start(const void* parameter) net_destroy(); /* Clear memory pool. */ -#if 1 destroy_memory_pool(mem_pool); -#endif -#if 0 - clear_memory_pool(); -#endif return PLUGIN_OK; } + -- cgit v1.2.3