Index: apps/plugins/pdbox/PDa/src/m_sched.c =================================================================== --- apps/plugins/pdbox/PDa/src/m_sched.c (revision 21272) +++ apps/plugins/pdbox/PDa/src/m_sched.c (working copy) @@ -14,8 +14,10 @@ /* T.Grill - enable PD global thread locking - sys_lock, sys_unlock, sys_trylock functions */ -#define THREAD_LOCKING +#ifndef ROCKBOX +#define THREAD_LOCKING #include "pthread.h" +#endif static int sys_quit; @@ -169,10 +171,15 @@ sched_diddsp, sched_didpoll, sched_didnothing); } +#ifndef ROCKBOX static int sys_histphase; +#endif int sys_addhist(int phase) { +#ifdef ROCKBOX + (void) phase; +#endif #ifndef FIXEDPOINT int i, j, phasewas = sys_histphase; t_time newtime = sys_getrealtime(); @@ -216,7 +223,11 @@ void glob_audiostatus(void) { +#ifdef ROCKBOX + int nresync, nresyncphase, i; +#else int dev, nresync, nresyncphase, i; +#endif nresync = (oss_nresync >= NRESYNC ? NRESYNC : oss_nresync); nresyncphase = oss_resyncphase - 1; post("audio I/O error history:"); @@ -251,7 +262,9 @@ if (type != ERR_NOTHING && !sched_diored && (sched_diddsp >= sched_dioredtime)) { +#ifndef ROCKBOX sys_vgui("pdtk_pd_dio 1\n"); +#endif sched_diored = 1; } sched_dioredtime = @@ -266,10 +279,15 @@ static void sched_pollformeters( void) { int inclip, outclip, indb, outdb; +#ifdef ROCKBOX + static int sched_nextmeterpolltime; +#else static int sched_nextmeterpolltime, sched_nextpingtime; +#endif /* if there's no GUI but we're running in "realtime", here is where we arrange to ping the watchdog every 2 seconds. */ +#ifndef ROCKBOX #ifdef __linux__ if (sys_nogui && sys_hipriority && (sched_diddsp - sched_nextpingtime > 0)) { @@ -279,12 +297,15 @@ (2* sys_dacsr) /(int)sys_schedblocksize; } #endif +#endif /* ROCKBOX */ if (sched_diddsp - sched_nextmeterpolltime < 0) return; if (sched_diored && (sched_diddsp - sched_dioredtime > 0)) { +#ifndef ROCKBOX sys_vgui("pdtk_pd_dio 0\n"); +#endif sched_diored = 0; } if (sched_meterson) @@ -304,7 +325,9 @@ if (inclip != sched_lastinclip || outclip != sched_lastoutclip || indb != sched_lastindb || outdb != sched_lastoutdb) { +#ifndef ROCKBOX sys_vgui("pdtk_pd_meters %d %d %d %d\n", indb, outdb, inclip, outclip); +#endif sched_lastinclip = inclip; sched_lastoutclip = outclip; sched_lastindb = indb; @@ -316,6 +339,9 @@ void glob_meters(void *dummy, float f) { +#ifdef ROCKBOX + (void) dummy; +#endif if (f == 0) sys_getmeters(0, 0); sched_meterson = (f != 0); @@ -390,7 +416,9 @@ int m_scheduler_pda( void) { +#ifndef ROCKBOX int idlecount = 0; +#endif sys_time_per_dsp_tick = (TIMEUNITPERSEC) * ((double)sys_schedblocksize) / sys_dacsr; @@ -405,11 +433,15 @@ sys_initmidiqueue(); while (!sys_quit) { +#ifndef ROCKBOX int didsomething = 0; +#endif int timeforward; sys_addhist(0); +#ifndef ROCKBOX waitfortick: +#endif if (sched_usedacs) { timeforward = sys_send_dacs(); @@ -564,7 +596,7 @@ void sys_lock(void) {} void sys_unlock(void) {} -int sys_trylock(void) {} +int sys_trylock(void) { return 0; } #endif