From 3d3ba5cae20af3f5d1a75d7a3d727a2199160137 Mon Sep 17 00:00:00 2001 From: batt Date: Fri, 1 Feb 2008 09:52:42 +0000 Subject: [PATCH] Restore wrong committ. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1077 38d2e660-2303-0410-9eaa-f027e97ec537 --- cpu/arm/drv/kdebug_at91.c | 15 +++++++++++---- cpu/arm/io/at91sam7.h | 19 +++++++++---------- drv/timer_test.c | 15 +++++---------- kern/proc_test.c | 7 ++----- 4 files changed, 27 insertions(+), 29 deletions(-) diff --git a/cpu/arm/drv/kdebug_at91.c b/cpu/arm/drv/kdebug_at91.c index b7e24cd3..64b3845f 100644 --- a/cpu/arm/drv/kdebug_at91.c +++ b/cpu/arm/drv/kdebug_at91.c @@ -76,16 +76,23 @@ INLINE void kdbg_hw_init(void) DBGU_MR = US_CHMODE_NORMAL | US_CHRL_8 | US_PAR_NO | US_NBSTOP_1; /* Enable DBGU transmitter. */ DBGU_CR = BV(US_TXEN); + #if !CPU_ARM_AT91SAM7S256 && !CPU_ARM_AT91SAM7X256 + #warning Check Debug Unit AT91 pins on datasheet! + #endif /* Disable PIO on DGBU tx pin. */ - PIOA_PDR = BV(DTXD); - PIOA_ASR = BV(DTXD); + PIOA_PDR = BV(10); + PIOA_ASR = BV(10); #if 0 /* Disable Rx for now */ /* Enable DBGU receiver. */ DBGU_CR = BV(US_RXEN); + #if !CPU_ARM_AT91SAM7S256 + #warning Check Debug Unit AT91 pins on datasheet! + #endif /* Disable PIO on DGBU rx pin. */ - PIOA_PDR = BV(DRXD); - PIOA_ASR = BV(DRXD); + PIOA_PDR = BV(9); + PIOA_ASR = BV(9); + #endif #else #error CONFIG_KDEBUG_PORT should be KDEBUG_PORT_DBGU diff --git a/cpu/arm/io/at91sam7.h b/cpu/arm/io/at91sam7.h index 1e80d147..f91690e8 100644 --- a/cpu/arm/io/at91sam7.h +++ b/cpu/arm/io/at91sam7.h @@ -185,7 +185,7 @@ /*\}*/ /** - * USART & DEBUG pin names + * USART pins name *\{ */ #if CPU_ARM_AT91SAM7S256 @@ -193,17 +193,16 @@ #define TXD0 6 #define RXD1 21 #define TXD1 22 - #define DTXD 10 - #define DRXD 9 + #elif CPU_ARM_AT91SAM7X256 - #define RXD0 0 // PA0 - #define TXD0 1 // PA1 - #define RXD1 5 // PA5 - #define TXD1 6 // PA6 - #define DTXD 28 // PA28 - #define DRXD 27 // PA27 + #define RXD0 0 // PA0 + #define TXD0 1 // PA1 + #define RXD1 5 // PA5 + #define TXD1 6 // PA6 + #else - #error No USART & debug pin names definition for selected ARM CPU + #error No USART pins name definition for selected ARM CPU + #endif /*\}*/ diff --git a/drv/timer_test.c b/drv/timer_test.c index 10b76c42..c5be24c7 100644 --- a/drv/timer_test.c +++ b/drv/timer_test.c @@ -52,10 +52,9 @@ *#* *#*/ -#include -#include "timer.h" -#include -//#include "os/hptime.c" +#include "timer.c" +#include "mware/event.c" +#include "os/hptime.c" static void timer_test_constants(void) { @@ -135,18 +134,14 @@ static void timer_test_poll(void) start_time += 1000; kprintf("seconds = %d, ticks=%ld\n", secs, now); } -// wdt_reset(); + wdt_reset(); } } int main(void) { -// wdt_init(7); - kdbg_init(); - sysirq_init(); + wdt_init(7); timer_init(); - IRQ_ENABLE; - timer_test_constants(); timer_test_delay(); timer_test_async(); diff --git a/kern/proc_test.c b/kern/proc_test.c index 0db24f1c..4c2f3126 100644 --- a/kern/proc_test.c +++ b/kern/proc_test.c @@ -1,6 +1,5 @@ #include -#include #include /** @@ -29,16 +28,14 @@ static void NORETURN proc_test_thread2(void) } } -static cpustack_t proc_test_stack1[256];//CONFIG_PROC_DEFSTACKSIZE / sizeof(cpustack_t)]; -static cpustack_t proc_test_stack2[256];//CONFIG_PROC_DEFSTACKSIZE / sizeof(cpustack_t)]; -static cpustack_t monitor_stack[256];//CONFIG_PROC_DEFSTACKSIZE / sizeof(cpustack_t)]; +static cpustack_t proc_test_stack1[CONFIG_PROC_DEFSTACKSIZE / sizeof(cpustack_t)]; +static cpustack_t proc_test_stack2[CONFIG_PROC_DEFSTACKSIZE / sizeof(cpustack_t)]; /** * Proc scheduling test */ void NORETURN proc_test(void) { - monitor_start(sizeof(monitor_stack), monitor_stack); proc_new(proc_test_thread1, NULL, sizeof(proc_test_stack1), proc_test_stack1); proc_new(proc_test_thread2, NULL, sizeof(proc_test_stack2), proc_test_stack2); kputs("Created tasks\n"); -- 2.25.1