summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/kernel-jz4740.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-12-20 01:48:46 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-12-20 01:48:46 +0000
commitc983e3b1d25503e71d0d7cba7c921b16c216770b (patch)
treee0c0b53295106e144be44f93817c961d57e41174 /firmware/target/mips/ingenic_jz47xx/kernel-jz4740.c
parent0301ed559451ba4561b21e438d29b9ee29e31353 (diff)
downloadrockbox-c983e3b1d25503e71d0d7cba7c921b16c216770b.tar.gz
rockbox-c983e3b1d25503e71d0d7cba7c921b16c216770b.tar.bz2
rockbox-c983e3b1d25503e71d0d7cba7c921b16c216770b.zip
Ingenic targets:
* LCD rework * Dynamic DMA enabling * PCM cleanup * USB: replace printf() with logf() * System: get rid of in_interrupt_mode() * Backlight: add support for software PWM git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19495 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/kernel-jz4740.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/kernel-jz4740.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/kernel-jz4740.c b/firmware/target/mips/ingenic_jz47xx/kernel-jz4740.c
index dcfdfd6a38..431af490da 100644
--- a/firmware/target/mips/ingenic_jz47xx/kernel-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/kernel-jz4740.c
@@ -24,38 +24,26 @@
#include "kernel.h"
#include "jz4740.h"
-#define USE_RTC_CLOCK 0
void tick_start(unsigned int interval_in_ms)
{
- unsigned int tps = interval_in_ms;
unsigned int latch;
+
__cpm_start_tcu();
__tcu_stop_counter(0);
__tcu_disable_pwm_output(0);
- __tcu_stop_counter(1);
- __tcu_disable_pwm_output(1);
- __tcu_stop_counter(2);
- __tcu_disable_pwm_output(2);
- __tcu_clear_full_match_flag(2);
__tcu_mask_half_match_irq(0);
__tcu_unmask_full_match_irq(0);
-#if USE_RTC_CLOCK
- __tcu_select_rtcclk(0);
- __tcu_select_clk_div1(0);
- latch = (__cpm_get_rtcclk() + (tps>>1)) / tps;
-#else
__tcu_select_extalclk(0);
__tcu_select_clk_div4(0);
- latch = (JZ_EXTAL / 4 + (tps>>1)) / tps;
-#endif
+ latch = (JZ_EXTAL / 4 + (interval_in_ms>>1)) / interval_in_ms;
+
REG_TCU_TCNT(0) = 0;
REG_TCU_TDFR(0) = latch;
REG_TCU_TDHR(0) = latch;
- //REG_TCU_TDHR(0) = 0;
__tcu_clear_full_match_flag(0);
__tcu_start_counter(0);