From 3fb02f719f0bea99548a6bc7fe7c37e9d25ce800 Mon Sep 17 00:00:00 2001 From: henryk Date: Tue, 13 Nov 2007 15:26:14 +0000 Subject: Slight progress, still: enabling tc_fdt crashes the processor after some bits git-svn-id: https://svn.openpcd.org:2342/trunk@326 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/tc_fdt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'openpicc/application/tc_fdt.c') diff --git a/openpicc/application/tc_fdt.c b/openpicc/application/tc_fdt.c index 55da9ca..0193863 100644 --- a/openpicc/application/tc_fdt.c +++ b/openpicc/application/tc_fdt.c @@ -29,11 +29,14 @@ * */ +#include +#include #include #include #include "dbgu.h" #include "openpicc.h" +#include "led.h" #include "tc_cdiv.h" #include "tc_fdt.h" @@ -54,6 +57,8 @@ void tc_frame_end_set(u_int16_t count) static void tc_fdt_irq(void) { + portSAVE_CONTEXT(); + vLedSetGreen(1); u_int32_t sr = tcfdt->TC_SR; DEBUGP("tc_fdt_irq: TC2_SR=0x%08x TC2_CV=0x%08x ", sr, tcfdt->TC_CV); @@ -77,6 +82,9 @@ static void tc_fdt_irq(void) DEBUGP("Compare_C "); } DEBUGPCR(""); + AT91F_AIC_AcknowledgeIt(); + vLedSetGreen(0); + portRESTORE_CONTEXT(); } void tc_fdt_print(void) @@ -123,4 +131,3 @@ void tc_fdt_init(void) tcfdt->TC_IER = AT91C_TC_CPAS | AT91C_TC_CPBS | AT91C_TC_CPCS | AT91C_TC_ETRGS; } - -- cgit v1.2.3