diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2009-06-29 14:29:46 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2009-06-29 14:29:46 +0000 |
commit | 89ccd5c145e45ad541a02f38e2ad07fb916f7135 (patch) | |
tree | 5fc32e78d793022246e3893f7c420f52d624c96e | |
parent | b955dff268005d3d55ee3f38af0875718ab6021a (diff) | |
download | rockbox-89ccd5c145e45ad541a02f38e2ad07fb916f7135.tar.gz rockbox-89ccd5c145e45ad541a02f38e2ad07fb916f7135.zip |
Remove int_prio argument from timer_register, and move the only use for it into alpine_cdc plugin, since this plugin is only built on SH7034
Also remove it from TIMER_START()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21558 a1c6a512-1295-4272-9138-f99709370657
25 files changed, 42 insertions, 68 deletions
diff --git a/apps/plugin.h b/apps/plugin.h index 2a5b6829c0..160eb2b1e7 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -128,12 +128,12 @@ void* plugin_get_buffer(size_t *buffer_size); | |||
128 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 128 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
129 | 129 | ||
130 | /* increase this every time the api struct changes */ | 130 | /* increase this every time the api struct changes */ |
131 | #define PLUGIN_API_VERSION 156 | 131 | #define PLUGIN_API_VERSION 157 |
132 | 132 | ||
133 | /* update this to latest version if a change to the api struct breaks | 133 | /* update this to latest version if a change to the api struct breaks |
134 | backwards compatibility (and please take the opportunity to sort in any | 134 | backwards compatibility (and please take the opportunity to sort in any |
135 | new function which are "waiting" at the end of the function table) */ | 135 | new function which are "waiting" at the end of the function table) */ |
136 | #define PLUGIN_MIN_API_VERSION 156 | 136 | #define PLUGIN_MIN_API_VERSION 157 |
137 | 137 | ||
138 | /* plugin return codes */ | 138 | /* plugin return codes */ |
139 | enum plugin_status { | 139 | enum plugin_status { |
@@ -461,8 +461,8 @@ struct plugin_api { | |||
461 | void (*cpucache_invalidate)(void); | 461 | void (*cpucache_invalidate)(void); |
462 | #endif | 462 | #endif |
463 | bool (*timer_register)(int reg_prio, void (*unregister_callback)(void), | 463 | bool (*timer_register)(int reg_prio, void (*unregister_callback)(void), |
464 | long cycles, int int_prio, | 464 | long cycles, void (*timer_callback)(void) |
465 | void (*timer_callback)(void) IF_COP(, int core)); | 465 | IF_COP(, int core)); |
466 | void (*timer_unregister)(void); | 466 | void (*timer_unregister)(void); |
467 | bool (*timer_set_period)(long count); | 467 | bool (*timer_set_period)(long count); |
468 | 468 | ||
diff --git a/apps/plugins/alpine_cdc.c b/apps/plugins/alpine_cdc.c index 494fa17842..73bc49ff00 100644 --- a/apps/plugins/alpine_cdc.c +++ b/apps/plugins/alpine_cdc.c | |||
@@ -231,11 +231,13 @@ void timer_set_mode(int mode) | |||
231 | 231 | ||
232 | if (mode == TM_RX_TIMEOUT) | 232 | if (mode == TM_RX_TIMEOUT) |
233 | { | 233 | { |
234 | rb->timer_register(1, NULL, gTimer.timeout, 11, timer4_isr IF_COP(, CPU)); | 234 | rb->timer_register(1, NULL, gTimer.timeout, timer4_isr IF_COP(, CPU)); |
235 | IPRD = (IPRD & 0xFF0F) | 11 << 4; /* interrupt priority */ | ||
235 | } | 236 | } |
236 | else if (mode == TM_TRANSMIT) | 237 | else if (mode == TM_TRANSMIT) |
237 | { | 238 | { |
238 | rb->timer_register(1, NULL, gTimer.transmit, 14, timer4_isr IF_COP(, CPU)); | 239 | rb->timer_register(1, NULL, gTimer.transmit, timer4_isr IF_COP(, CPU)); |
240 | IPRD = (IPRD & 0xFF0F) | 14 << 4; /* interrupt priority */ | ||
239 | } | 241 | } |
240 | else | 242 | else |
241 | { | 243 | { |
diff --git a/apps/plugins/doom/i_system.c b/apps/plugins/doom/i_system.c index 09a61808fd..601ffc3b27 100644 --- a/apps/plugins/doom/i_system.c +++ b/apps/plugins/doom/i_system.c | |||
@@ -109,7 +109,7 @@ int I_GetTime (void) | |||
109 | void I_Init (void) | 109 | void I_Init (void) |
110 | { | 110 | { |
111 | #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE) | 111 | #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE) |
112 | rb->timer_register(1, NULL, TIMER_FREQ/TICRATE, 1, doomtime IF_COP(, CPU)); | 112 | rb->timer_register(1, NULL, TIMER_FREQ/TICRATE, doomtime IF_COP(, CPU)); |
113 | #endif | 113 | #endif |
114 | I_InitSound(); | 114 | I_InitSound(); |
115 | } | 115 | } |
diff --git a/apps/plugins/lib/grey_core.c b/apps/plugins/lib/grey_core.c index ea70ae942b..6fa422be05 100644 --- a/apps/plugins/lib/grey_core.c +++ b/apps/plugins/lib/grey_core.c | |||
@@ -648,11 +648,10 @@ void grey_show(bool enable) | |||
648 | #endif | 648 | #endif |
649 | #if NUM_CORES > 1 | 649 | #if NUM_CORES > 1 |
650 | rb->timer_register(1, NULL, TIMER_FREQ / LCD_SCANRATE, | 650 | rb->timer_register(1, NULL, TIMER_FREQ / LCD_SCANRATE, |
651 | 1, _timer_isr, | 651 | _timer_isr, |
652 | (_grey_info.flags & GREY_ON_COP) ? COP : CPU); | 652 | (_grey_info.flags & GREY_ON_COP) ? COP : CPU); |
653 | #else | 653 | #else |
654 | rb->timer_register(1, NULL, TIMER_FREQ / LCD_SCANRATE, 1, | 654 | rb->timer_register(1, NULL, TIMER_FREQ / LCD_SCANRATE, _timer_isr); |
655 | _timer_isr); | ||
656 | #endif | 655 | #endif |
657 | #endif /* !SIMULATOR */ | 656 | #endif /* !SIMULATOR */ |
658 | rb->screen_dump_set_hook(grey_screendump_hook); | 657 | rb->screen_dump_set_hook(grey_screendump_hook); |
diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c index 8906c923a0..10b9e41738 100644 --- a/apps/plugins/metronome.c +++ b/apps/plugins/metronome.c | |||
@@ -910,7 +910,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
910 | #endif /* CONFIG_CODEC != SWCODEC */ | 910 | #endif /* CONFIG_CODEC != SWCODEC */ |
911 | 911 | ||
912 | calc_period(); | 912 | calc_period(); |
913 | rb->timer_register(1, NULL, TIMER_FREQ/1024, 1, timer_callback IF_COP(, CPU)); | 913 | rb->timer_register(1, NULL, TIMER_FREQ/1024, timer_callback IF_COP(, CPU)); |
914 | 914 | ||
915 | draw_display(); | 915 | draw_display(); |
916 | 916 | ||
diff --git a/apps/plugins/test_scanrate.c b/apps/plugins/test_scanrate.c index 7a0a13bc94..7746916386 100644 --- a/apps/plugins/test_scanrate.c +++ b/apps/plugins/test_scanrate.c | |||
@@ -162,7 +162,7 @@ int plugin_main(void) | |||
162 | rb->cpu_boost(true); | 162 | rb->cpu_boost(true); |
163 | #endif | 163 | #endif |
164 | /* The actual frequency is twice the displayed value */ | 164 | /* The actual frequency is twice the displayed value */ |
165 | rb->timer_register(1, NULL, TIMER_FREQ * 5 / scan_rate, 1, | 165 | rb->timer_register(1, NULL, TIMER_FREQ * 5 / scan_rate, |
166 | timer_isr IF_COP(, CPU)); | 166 | timer_isr IF_COP(, CPU)); |
167 | 167 | ||
168 | while (!done) | 168 | while (!done) |
diff --git a/apps/plugins/video.c b/apps/plugins/video.c index bcbbb99d80..bd8a95eb71 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c | |||
@@ -562,10 +562,10 @@ int SeekTo(int fd, int nPos) | |||
562 | gPlay.bVideoUnderrun = false; | 562 | gPlay.bVideoUnderrun = false; |
563 | /* start display interrupt */ | 563 | /* start display interrupt */ |
564 | #if FREQ == 12000000 /* Ondio speed kludge */ | 564 | #if FREQ == 12000000 /* Ondio speed kludge */ |
565 | rb->timer_register(1, NULL, gPlay.nFrameTimeAdjusted, 1, | 565 | rb->timer_register(1, NULL, gPlay.nFrameTimeAdjusted, |
566 | timer4_isr IF_COP(, CPU)); | 566 | timer4_isr IF_COP(, CPU)); |
567 | #else | 567 | #else |
568 | rb->timer_register(1, NULL, gFileHdr.video_frametime, 1, | 568 | rb->timer_register(1, NULL, gFileHdr.video_frametime, |
569 | timer4_isr IF_COP(, CPU)); | 569 | timer4_isr IF_COP(, CPU)); |
570 | #endif | 570 | #endif |
571 | } | 571 | } |
@@ -748,10 +748,10 @@ int PlayTick(int fd) | |||
748 | { /* start the video */ | 748 | { /* start the video */ |
749 | #if FREQ == 12000000 /* Ondio speed kludge */ | 749 | #if FREQ == 12000000 /* Ondio speed kludge */ |
750 | rb->timer_register(1, NULL, | 750 | rb->timer_register(1, NULL, |
751 | gPlay.nFrameTimeAdjusted, 1, timer4_isr); | 751 | gPlay.nFrameTimeAdjusted, timer4_isr); |
752 | #else | 752 | #else |
753 | rb->timer_register(1, NULL, | 753 | rb->timer_register(1, NULL, |
754 | gFileHdr.video_frametime, 1, timer4_isr); | 754 | gFileHdr.video_frametime, timer4_isr); |
755 | #endif | 755 | #endif |
756 | } | 756 | } |
757 | } | 757 | } |
diff --git a/docs/PLUGIN_API.new b/docs/PLUGIN_API.new index 7e597eed58..d54d7a1ce0 100644 --- a/docs/PLUGIN_API.new +++ b/docs/PLUGIN_API.new | |||
@@ -2438,11 +2438,10 @@ void thread_wait(struct thread_entry *thread) | |||
2438 | \param thread | 2438 | \param thread |
2439 | \description | 2439 | \description |
2440 | 2440 | ||
2441 | bool timer_register(int reg_prio, void (*unregister_callback)(void), long cycles, int int_prio, void (*timer_callback)(void) IF_COP(, int core)) | 2441 | bool timer_register(int reg_prio, void (*unregister_callback)(void), long cycles, void (*timer_callback)(void) IF_COP(, int core)) |
2442 | \param reg_prio | 2442 | \param reg_prio |
2443 | \param unregister_callback | 2443 | \param unregister_callback |
2444 | \param cycles | 2444 | \param cycles |
2445 | \param int_prio | ||
2446 | \param core | 2445 | \param core |
2447 | \param timer_callback | 2446 | \param timer_callback |
2448 | \return | 2447 | \return |
diff --git a/firmware/backlight.c b/firmware/backlight.c index 12acca00a7..8eded957f7 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -332,7 +332,7 @@ static void backlight_dim(int value) | |||
332 | if (bl_timer_active) | 332 | if (bl_timer_active) |
333 | return ; | 333 | return ; |
334 | 334 | ||
335 | if (timer_register(0, backlight_release_timer, 2, 0, backlight_isr | 335 | if (timer_register(0, backlight_release_timer, 2, backlight_isr |
336 | IF_COP(, CPU))) | 336 | IF_COP(, CPU))) |
337 | { | 337 | { |
338 | #ifdef _BACKLIGHT_FADE_BOOST | 338 | #ifdef _BACKLIGHT_FADE_BOOST |
diff --git a/firmware/export/timer.h b/firmware/export/timer.h index 678d9ad8c6..7b56330e18 100644 --- a/firmware/export/timer.h +++ b/firmware/export/timer.h | |||
@@ -41,7 +41,7 @@ | |||
41 | #define TIMER_FREQ CPU_FREQ | 41 | #define TIMER_FREQ CPU_FREQ |
42 | #endif | 42 | #endif |
43 | bool timer_register(int reg_prio, void (*unregister_callback)(void), | 43 | bool timer_register(int reg_prio, void (*unregister_callback)(void), |
44 | long cycles, int int_prio, void (*timer_callback)(void) | 44 | long cycles, void (*timer_callback)(void) |
45 | IF_COP(,int core)); | 45 | IF_COP(,int core)); |
46 | bool timer_set_period(long cycles); | 46 | bool timer_set_period(long cycles); |
47 | #ifdef CPU_COLDFIRE | 47 | #ifdef CPU_COLDFIRE |
diff --git a/firmware/profile.c b/firmware/profile.c index cb68f18d8e..6700eca404 100644 --- a/firmware/profile.c +++ b/firmware/profile.c | |||
@@ -140,7 +140,7 @@ void profile_thread_started(int current_thread) { | |||
140 | if (profiling < PROF_ERROR) { | 140 | if (profiling < PROF_ERROR) { |
141 | /* After we de-mask, if profiling is active, reactivate the timer */ | 141 | /* After we de-mask, if profiling is active, reactivate the timer */ |
142 | timer_register(0, profile_timer_unregister, | 142 | timer_register(0, profile_timer_unregister, |
143 | TIMER_FREQ/10000, 0, profile_timer_tick IF_COP(, 0 ) ); | 143 | TIMER_FREQ/10000, profile_timer_tick IF_COP(, 0 ) ); |
144 | } | 144 | } |
145 | } | 145 | } |
146 | } | 146 | } |
@@ -169,7 +169,7 @@ void profstart(int current_thread) { | |||
169 | pfds[0].self_pc = 0; | 169 | pfds[0].self_pc = 0; |
170 | memset(indices,0,INDEX_SIZE * sizeof(unsigned short)); | 170 | memset(indices,0,INDEX_SIZE * sizeof(unsigned short)); |
171 | timer_register( | 171 | timer_register( |
172 | 0, profile_timer_unregister, TIMER_FREQ/10000, 0, profile_timer_tick IF_COP(, 0 ) ); | 172 | 0, profile_timer_unregister, TIMER_FREQ/10000, profile_timer_tick IF_COP(, 0 ) ); |
173 | profiling = PROF_ON; | 173 | profiling = PROF_ON; |
174 | } | 174 | } |
175 | 175 | ||
diff --git a/firmware/target/arm/as3525/timer-target.h b/firmware/target/arm/as3525/timer-target.h index d42afaa2c4..b1bdfed78f 100644 --- a/firmware/target/arm/as3525/timer-target.h +++ b/firmware/target/arm/as3525/timer-target.h | |||
@@ -30,7 +30,7 @@ void __timer_stop(void); | |||
30 | #define __TIMER_SET(cycles, set) \ | 30 | #define __TIMER_SET(cycles, set) \ |
31 | __timer_set(cycles, set) | 31 | __timer_set(cycles, set) |
32 | 32 | ||
33 | #define __TIMER_START(int_prio) \ | 33 | #define __TIMER_START() \ |
34 | __timer_start() | 34 | __timer_start() |
35 | 35 | ||
36 | #define __TIMER_STOP(...) \ | 36 | #define __TIMER_STOP(...) \ |
diff --git a/firmware/target/arm/at91sam/lyre_proto1/timer-target.h b/firmware/target/arm/at91sam/lyre_proto1/timer-target.h index 1db63c5211..b8298d3d77 100644 --- a/firmware/target/arm/at91sam/lyre_proto1/timer-target.h +++ b/firmware/target/arm/at91sam/lyre_proto1/timer-target.h | |||
@@ -32,7 +32,7 @@ void __timer_stop(void); | |||
32 | #define __TIMER_SET(cycles, set) \ | 32 | #define __TIMER_SET(cycles, set) \ |
33 | __timer_set(cycles, set) | 33 | __timer_set(cycles, set) |
34 | 34 | ||
35 | #define __TIMER_START(int_prio) \ | 35 | #define __TIMER_START() \ |
36 | __timer_start() | 36 | __timer_start() |
37 | 37 | ||
38 | #define __TIMER_STOP(...) \ | 38 | #define __TIMER_STOP(...) \ |
diff --git a/firmware/target/arm/imx31/gigabeat-s/timer-target.h b/firmware/target/arm/imx31/gigabeat-s/timer-target.h index 4ea459719c..f019a45519 100644 --- a/firmware/target/arm/imx31/gigabeat-s/timer-target.h +++ b/firmware/target/arm/imx31/gigabeat-s/timer-target.h | |||
@@ -31,7 +31,7 @@ void _timer_stop(void); | |||
31 | #define __TIMER_SET(cycles, set) \ | 31 | #define __TIMER_SET(cycles, set) \ |
32 | _timer_set(cycles, set) | 32 | _timer_set(cycles, set) |
33 | 33 | ||
34 | #define __TIMER_START(int_prio) \ | 34 | #define __TIMER_START() \ |
35 | _timer_start() | 35 | _timer_start() |
36 | 36 | ||
37 | #define __TIMER_STOP(...) \ | 37 | #define __TIMER_STOP(...) \ |
diff --git a/firmware/target/arm/pnx0101/timer-target.h b/firmware/target/arm/pnx0101/timer-target.h index 68d0e6b58a..853da07838 100644 --- a/firmware/target/arm/pnx0101/timer-target.h +++ b/firmware/target/arm/pnx0101/timer-target.h | |||
@@ -30,7 +30,7 @@ void __timer_stop(void); | |||
30 | #define __TIMER_SET(cycles, set) \ | 30 | #define __TIMER_SET(cycles, set) \ |
31 | __timer_set(cycles, set) | 31 | __timer_set(cycles, set) |
32 | 32 | ||
33 | #define __TIMER_START(int_prio) \ | 33 | #define __TIMER_START() \ |
34 | __timer_start() | 34 | __timer_start() |
35 | 35 | ||
36 | #define __TIMER_STOP(...) \ | 36 | #define __TIMER_STOP(...) \ |
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/timer-target.h b/firmware/target/arm/s3c2440/gigabeat-fx/timer-target.h index 577d0f947c..700833486d 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/timer-target.h +++ b/firmware/target/arm/s3c2440/gigabeat-fx/timer-target.h | |||
@@ -32,7 +32,7 @@ void __timer_stop(void); | |||
32 | #define __TIMER_SET(cycles, set) \ | 32 | #define __TIMER_SET(cycles, set) \ |
33 | __timer_set(cycles, set) | 33 | __timer_set(cycles, set) |
34 | 34 | ||
35 | #define __TIMER_START(int_prio) \ | 35 | #define __TIMER_START() \ |
36 | __timer_start() | 36 | __timer_start() |
37 | 37 | ||
38 | #define __TIMER_STOP(...) \ | 38 | #define __TIMER_STOP(...) \ |
diff --git a/firmware/target/arm/tcc780x/timer-target.h b/firmware/target/arm/tcc780x/timer-target.h index c477ca6c70..d6a8c4b0aa 100644 --- a/firmware/target/arm/tcc780x/timer-target.h +++ b/firmware/target/arm/tcc780x/timer-target.h | |||
@@ -31,7 +31,7 @@ void __timer_stop(void); | |||
31 | #define __TIMER_SET(cycles, set) \ | 31 | #define __TIMER_SET(cycles, set) \ |
32 | __timer_set(cycles, set) | 32 | __timer_set(cycles, set) |
33 | 33 | ||
34 | #define __TIMER_START(int_prio) \ | 34 | #define __TIMER_START() \ |
35 | __timer_start() | 35 | __timer_start() |
36 | 36 | ||
37 | #define __TIMER_STOP(...) \ | 37 | #define __TIMER_STOP(...) \ |
diff --git a/firmware/target/arm/timer-target.h b/firmware/target/arm/timer-target.h index 6801cfe783..7b7fdabdce 100644 --- a/firmware/target/arm/timer-target.h +++ b/firmware/target/arm/timer-target.h | |||
@@ -39,10 +39,10 @@ void __timer_stop(void); | |||
39 | __timer_set(cycles, set) | 39 | __timer_set(cycles, set) |
40 | 40 | ||
41 | #if NUM_CORES > 1 | 41 | #if NUM_CORES > 1 |
42 | #define __TIMER_START(int_prio, core) \ | 42 | #define __TIMER_START(core) \ |
43 | __timer_start(core) | 43 | __timer_start(core) |
44 | #else | 44 | #else |
45 | #define __TIMER_START(int_prio) \ | 45 | #define __TIMER_START() \ |
46 | __timer_start() | 46 | __timer_start() |
47 | #endif | 47 | #endif |
48 | 48 | ||
diff --git a/firmware/target/arm/tms320dm320/timer-target.h b/firmware/target/arm/tms320dm320/timer-target.h index 072f7e06a9..9f3ffdf712 100644 --- a/firmware/target/arm/tms320dm320/timer-target.h +++ b/firmware/target/arm/tms320dm320/timer-target.h | |||
@@ -31,7 +31,7 @@ void __timer_stop(void); | |||
31 | #define __TIMER_SET(cycles, set) \ | 31 | #define __TIMER_SET(cycles, set) \ |
32 | __timer_set(cycles, set) | 32 | __timer_set(cycles, set) |
33 | 33 | ||
34 | #define __TIMER_START(int_prio) \ | 34 | #define __TIMER_START() \ |
35 | __timer_start() | 35 | __timer_start() |
36 | 36 | ||
37 | #define __TIMER_STOP(...) \ | 37 | #define __TIMER_STOP(...) \ |
diff --git a/firmware/target/coldfire/timer-target.h b/firmware/target/coldfire/timer-target.h index c7f695a0c8..29488887e8 100644 --- a/firmware/target/coldfire/timer-target.h +++ b/firmware/target/coldfire/timer-target.h | |||
@@ -31,7 +31,7 @@ void __timer_stop(void); | |||
31 | #define __TIMER_SET(cycles, set) \ | 31 | #define __TIMER_SET(cycles, set) \ |
32 | __timer_set(cycles, set) | 32 | __timer_set(cycles, set) |
33 | 33 | ||
34 | #define __TIMER_START(int_prio) \ | 34 | #define __TIMER_START() \ |
35 | __timer_start() | 35 | __timer_start() |
36 | 36 | ||
37 | #define __TIMER_STOP(...) \ | 37 | #define __TIMER_STOP(...) \ |
diff --git a/firmware/target/mips/ingenic_jz47xx/timer-target.h b/firmware/target/mips/ingenic_jz47xx/timer-target.h index d42bd41bdc..2e072440ab 100644 --- a/firmware/target/mips/ingenic_jz47xx/timer-target.h +++ b/firmware/target/mips/ingenic_jz47xx/timer-target.h | |||
@@ -33,7 +33,7 @@ void __timer_stop(void); | |||
33 | #define __TIMER_SET(cycles, set) \ | 33 | #define __TIMER_SET(cycles, set) \ |
34 | __timer_set(cycles, set) | 34 | __timer_set(cycles, set) |
35 | 35 | ||
36 | #define __TIMER_START(int_prio) \ | 36 | #define __TIMER_START() \ |
37 | __timer_start() | 37 | __timer_start() |
38 | 38 | ||
39 | #define __TIMER_STOP(...) \ | 39 | #define __TIMER_STOP(...) \ |
diff --git a/firmware/target/sh/archos/timer-archos.c b/firmware/target/sh/archos/timer-archos.c index e7526a8409..c61318f721 100644 --- a/firmware/target/sh/archos/timer-archos.c +++ b/firmware/target/sh/archos/timer-archos.c | |||
@@ -71,9 +71,9 @@ bool __timer_set(long cycles, bool start) | |||
71 | return true; | 71 | return true; |
72 | } | 72 | } |
73 | 73 | ||
74 | bool __timer_start(int int_prio) | 74 | bool __timer_start(void) |
75 | { | 75 | { |
76 | IPRD = (IPRD & 0xFF0F) | int_prio << 4; /* interrupt priority */ | 76 | IPRD = (IPRD & 0xFF0F) | 1 << 4; /* interrupt priority */ |
77 | or_b(0x10, &TSTR); /* start timer 4 */ | 77 | or_b(0x10, &TSTR); /* start timer 4 */ |
78 | return true; | 78 | return true; |
79 | } | 79 | } |
diff --git a/firmware/target/sh/archos/timer-target.h b/firmware/target/sh/archos/timer-target.h index 08fcae1156..89dfe57eb3 100644 --- a/firmware/target/sh/archos/timer-target.h +++ b/firmware/target/sh/archos/timer-target.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "config.h" | 24 | #include "config.h" |
25 | 25 | ||
26 | bool __timer_set(long cycles, bool start); | 26 | bool __timer_set(long cycles, bool start); |
27 | bool __timer_start(int int_prio); | 27 | bool __timer_start(void); |
28 | void __timer_stop(void); | 28 | void __timer_stop(void); |
29 | 29 | ||
30 | #define TIMER_FREQ CPU_FREQ | 30 | #define TIMER_FREQ CPU_FREQ |
@@ -32,8 +32,8 @@ void __timer_stop(void); | |||
32 | #define __TIMER_SET(cycles, set) \ | 32 | #define __TIMER_SET(cycles, set) \ |
33 | __timer_set(cycles, set) | 33 | __timer_set(cycles, set) |
34 | 34 | ||
35 | #define __TIMER_START(int_prio) \ | 35 | #define __TIMER_START() \ |
36 | __timer_start(int_prio) | 36 | __timer_start() |
37 | 37 | ||
38 | #define __TIMER_STOP(...) \ | 38 | #define __TIMER_STOP(...) \ |
39 | __timer_stop() | 39 | __timer_stop() |
diff --git a/firmware/timer.c b/firmware/timer.c index 8cd165bd35..077176b96f 100644 --- a/firmware/timer.c +++ b/firmware/timer.c | |||
@@ -30,18 +30,6 @@ static int timer_prio = -1; | |||
30 | void SHAREDBSS_ATTR (*pfn_timer)(void) = NULL; /* timer callback */ | 30 | void SHAREDBSS_ATTR (*pfn_timer)(void) = NULL; /* timer callback */ |
31 | void SHAREDBSS_ATTR (*pfn_unregister)(void) = NULL; /* unregister callback */ | 31 | void SHAREDBSS_ATTR (*pfn_unregister)(void) = NULL; /* unregister callback */ |
32 | 32 | ||
33 | #ifndef __TIMER_SET | ||
34 | /* Define these if not defined by target to make the #else cases compile | ||
35 | * even if the target doesn't have them implemented. */ | ||
36 | #define __TIMER_SET(cycles, set) false | ||
37 | #if NUM_CORES > 1 | ||
38 | #define __TIMER_START(int_prio, core) false | ||
39 | #else | ||
40 | #define __TIMER_START(int_prio) false | ||
41 | #endif | ||
42 | #define __TIMER_STOP() | ||
43 | #endif | ||
44 | |||
45 | static bool timer_set(long cycles, bool start) | 33 | static bool timer_set(long cycles, bool start) |
46 | { | 34 | { |
47 | return __TIMER_SET(cycles, start); | 35 | return __TIMER_SET(cycles, start); |
@@ -49,17 +37,12 @@ static bool timer_set(long cycles, bool start) | |||
49 | 37 | ||
50 | /* Register a user timer, called every <cycles> TIMER_FREQ cycles */ | 38 | /* Register a user timer, called every <cycles> TIMER_FREQ cycles */ |
51 | bool timer_register(int reg_prio, void (*unregister_callback)(void), | 39 | bool timer_register(int reg_prio, void (*unregister_callback)(void), |
52 | long cycles, int int_prio, void (*timer_callback)(void) | 40 | long cycles, void (*timer_callback)(void) |
53 | IF_COP(, int core)) | 41 | IF_COP(, int core)) |
54 | { | 42 | { |
55 | if (reg_prio <= timer_prio || cycles == 0) | 43 | if (reg_prio <= timer_prio || cycles == 0) |
56 | return false; | 44 | return false; |
57 | 45 | ||
58 | #if CONFIG_CPU == SH7034 | ||
59 | if (int_prio < 1 || int_prio > 15) | ||
60 | return false; | ||
61 | #endif | ||
62 | |||
63 | if (!timer_set(cycles, true)) | 46 | if (!timer_set(cycles, true)) |
64 | return false; | 47 | return false; |
65 | 48 | ||
@@ -68,18 +51,10 @@ bool timer_register(int reg_prio, void (*unregister_callback)(void), | |||
68 | timer_prio = reg_prio; | 51 | timer_prio = reg_prio; |
69 | 52 | ||
70 | #if NUM_CORES > 1 | 53 | #if NUM_CORES > 1 |
71 | return __TIMER_START(int_prio, core); | 54 | return __TIMER_START(core); |
72 | #else | 55 | #else |
73 | return __TIMER_START(int_prio); | 56 | return __TIMER_START(); |
74 | #endif | 57 | #endif |
75 | |||
76 | /* Cover for targets that don't use all these */ | ||
77 | (void)reg_prio; | ||
78 | (void)unregister_callback; | ||
79 | (void)cycles; | ||
80 | /* TODO: Implement for PortalPlayer and iFP (if possible) */ | ||
81 | (void)int_prio; | ||
82 | (void)timer_callback; | ||
83 | } | 58 | } |
84 | 59 | ||
85 | bool timer_set_period(long cycles) | 60 | bool timer_set_period(long cycles) |
diff --git a/uisimulator/sdl/timer.c b/uisimulator/sdl/timer.c index f4368bb745..369aeab929 100644 --- a/uisimulator/sdl/timer.c +++ b/uisimulator/sdl/timer.c | |||
@@ -36,9 +36,8 @@ Uint32 SDL_timer_callback(Uint32 interval, void *param){ | |||
36 | ((int)((1000*cycles)/TIMER_FREQ)) | 36 | ((int)((1000*cycles)/TIMER_FREQ)) |
37 | 37 | ||
38 | bool timer_register(int reg_prio, void (*unregister_callback)(void), | 38 | bool timer_register(int reg_prio, void (*unregister_callback)(void), |
39 | long cycles, int int_prio, void (*timer_callback)(void)) | 39 | long cycles, void (*timer_callback)(void)) |
40 | { | 40 | { |
41 | (void)int_prio;/* interrupt priority not used */ | ||
42 | (void)unregister_callback; | 41 | (void)unregister_callback; |
43 | if (reg_prio <= timer_prio || cycles == 0) | 42 | if (reg_prio <= timer_prio || cycles == 0) |
44 | return false; | 43 | return false; |