summaryrefslogtreecommitdiff
path: root/apps/plugins/pdbox/pdbox.c
diff options
context:
space:
mode:
authorWincent Balin <wincent@rockbox.org>2010-05-24 23:38:04 +0000
committerWincent Balin <wincent@rockbox.org>2010-05-24 23:38:04 +0000
commit112ad0ac421f47d819af11ae18b2218b508737bf (patch)
treeef26b4d4dc9f9469a68392360cd44c303f8a62cb /apps/plugins/pdbox/pdbox.c
parentfead75812bec5a88bb042383b7fc9ecccb807a87 (diff)
downloadrockbox-112ad0ac421f47d819af11ae18b2218b508737bf.tar.gz
rockbox-112ad0ac421f47d819af11ae18b2218b508737bf.zip
pdbox: Code cleanup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26274 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pdbox/pdbox.c')
-rw-r--r--apps/plugins/pdbox/pdbox.c28
1 files changed, 10 insertions, 18 deletions
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)
124/* Core thread */ 124/* Core thread */
125void core_thread(void) 125void core_thread(void)
126{ 126{
127 /* Add the directory the called .pd resides in to lib directories. */ 127 /* Add the directory the called .pd file resides in to lib directories. */
128 sys_findlibdir(filename); 128 sys_findlibdir(filename);
129 129
130 /* Open the PD design file. */ 130 /* Open the PD design file. */
@@ -146,7 +146,7 @@ void core_thread(void)
146 while(sys_send_dacs() != SENDDACS_NO) 146 while(sys_send_dacs() != SENDDACS_NO)
147 sched_tick(sys_time + sys_time_per_dsp_tick); 147 sched_tick(sys_time + sys_time_per_dsp_tick);
148 148
149 yield(); 149 rb->sleep(1);
150 } 150 }
151 151
152 rb->thread_exit(); 152 rb->thread_exit();
@@ -178,12 +178,8 @@ enum plugin_status plugin_start(const void* parameter)
178 rb->splash(HZ, "Not enough memory!"); 178 rb->splash(HZ, "Not enough memory!");
179 return PLUGIN_ERROR; 179 return PLUGIN_ERROR;
180 } 180 }
181#if 1 181
182 init_memory_pool(mem_size, mem_pool); 182 init_memory_pool(mem_size, mem_pool);
183#endif
184#if 0
185 set_memory_pool(mem_pool, mem_size);
186#endif
187 183
188 /* Initialize net. */ 184 /* Initialize net. */
189 net_init(); 185 net_init();
@@ -207,6 +203,12 @@ enum plugin_status plugin_start(const void* parameter)
207 DEFAULTADVANCE, /* Scheduler advance */ 203 DEFAULTADVANCE, /* Scheduler advance */
208 1 /* Enable */); 204 1 /* Enable */);
209 205
206 /* Initialize scheduler time variables. */
207 sys_time = 0;
208 sys_time_per_dsp_tick = (TIMEUNITPERSEC) *
209 ((double) sys_schedblocksize) / sys_dacsr;
210
211
210 /* Create stacks for threads. */ 212 /* Create stacks for threads. */
211 core_stack = getbytes(CORESTACKSIZE); 213 core_stack = getbytes(CORESTACKSIZE);
212 gui_stack = getbytes(GUISTACKSIZE); 214 gui_stack = getbytes(GUISTACKSIZE);
@@ -242,12 +244,6 @@ enum plugin_status plugin_start(const void* parameter)
242 if(core_thread_id == 0 || gui_thread_id == 0) 244 if(core_thread_id == 0 || gui_thread_id == 0)
243 return PLUGIN_ERROR; 245 return PLUGIN_ERROR;
244 246
245 /* Initialize scheduler time variables. */
246 sys_time = 0;
247 sys_time_per_dsp_tick = (TIMEUNITPERSEC) *
248 ((double) sys_schedblocksize) / sys_dacsr;
249
250
251 /* Main loop. */ 247 /* Main loop. */
252 while(!quit) 248 while(!quit)
253 { 249 {
@@ -272,12 +268,8 @@ enum plugin_status plugin_start(const void* parameter)
272 net_destroy(); 268 net_destroy();
273 269
274 /* Clear memory pool. */ 270 /* Clear memory pool. */
275#if 1
276 destroy_memory_pool(mem_pool); 271 destroy_memory_pool(mem_pool);
277#endif
278#if 0
279 clear_memory_pool();
280#endif
281 272
282 return PLUGIN_OK; 273 return PLUGIN_OK;
283} 274}
275