summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/pdbox/PDa/src/m_sched.c6
-rw-r--r--apps/plugins/pdbox/pdbox.c28
2 files changed, 14 insertions, 20 deletions
diff --git a/apps/plugins/pdbox/PDa/src/m_sched.c b/apps/plugins/pdbox/PDa/src/m_sched.c
index 6500fc2038..88e639d39e 100644
--- a/apps/plugins/pdbox/PDa/src/m_sched.c
+++ b/apps/plugins/pdbox/PDa/src/m_sched.c
@@ -399,7 +399,9 @@ static
399#endif 399#endif
400void sched_tick(t_time next_sys_time) 400void sched_tick(t_time next_sys_time)
401{ 401{
402#ifndef ROCKBOX
402 int countdown = 5000; 403 int countdown = 5000;
404#endif
403 while (clock_setlist && clock_setlist->c_settime < next_sys_time) 405 while (clock_setlist && clock_setlist->c_settime < next_sys_time)
404 { 406 {
405 t_clock *c = clock_setlist; 407 t_clock *c = clock_setlist;
@@ -407,13 +409,13 @@ void sched_tick(t_time next_sys_time)
407 clock_unset(clock_setlist); 409 clock_unset(clock_setlist);
408 outlet_setstacklim(); 410 outlet_setstacklim();
409 (*c->c_fn)(c->c_owner); 411 (*c->c_fn)(c->c_owner);
412#ifndef ROCKBOX
410 if (!countdown--) 413 if (!countdown--)
411 { 414 {
412 countdown = 5000; 415 countdown = 5000;
413#ifndef ROCKBOX
414 sys_pollgui(); 416 sys_pollgui();
415#endif
416 } 417 }
418#endif
417 if (sys_quit) 419 if (sys_quit)
418 return; 420 return;
419 } 421 }
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