From d14c11ed6f463320866567825c731d89ef2f98c2 Mon Sep 17 00:00:00 2001 From: batt Date: Fri, 1 Feb 2008 09:49:08 +0000 Subject: [PATCH] Set correct debug pins for A git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1076 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, 29 insertions(+), 27 deletions(-) diff --git a/cpu/arm/drv/kdebug_at91.c b/cpu/arm/drv/kdebug_at91.c index 64b3845f..b7e24cd3 100644 --- a/cpu/arm/drv/kdebug_at91.c +++ b/cpu/arm/drv/kdebug_at91.c @@ -76,23 +76,16 @@ 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(10); - PIOA_ASR = BV(10); + PIOA_PDR = BV(DTXD); + PIOA_ASR = BV(DTXD); #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(9); - PIOA_ASR = BV(9); - + PIOA_PDR = BV(DRXD); + PIOA_ASR = BV(DRXD); #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 f91690e8..1e80d147 100644 --- a/cpu/arm/io/at91sam7.h +++ b/cpu/arm/io/at91sam7.h @@ -185,7 +185,7 @@ /*\}*/ /** - * USART pins name + * USART & DEBUG pin names *\{ */ #if CPU_ARM_AT91SAM7S256 @@ -193,16 +193,17 @@ #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 RXD0 0 // PA0 + #define TXD0 1 // PA1 + #define RXD1 5 // PA5 + #define TXD1 6 // PA6 + #define DTXD 28 // PA28 + #define DRXD 27 // PA27 #else - #error No USART pins name definition for selected ARM CPU - + #error No USART & debug pin names definition for selected ARM CPU #endif /*\}*/ diff --git a/drv/timer_test.c b/drv/timer_test.c index c5be24c7..10b76c42 100644 --- a/drv/timer_test.c +++ b/drv/timer_test.c @@ -52,9 +52,10 @@ *#* *#*/ -#include "timer.c" -#include "mware/event.c" -#include "os/hptime.c" +#include +#include "timer.h" +#include +//#include "os/hptime.c" static void timer_test_constants(void) { @@ -134,14 +135,18 @@ 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); +// wdt_init(7); + kdbg_init(); + sysirq_init(); 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 4c2f3126..0db24f1c 100644 --- a/kern/proc_test.c +++ b/kern/proc_test.c @@ -1,5 +1,6 @@ #include +#include #include /** @@ -28,14 +29,16 @@ static void NORETURN proc_test_thread2(void) } } -static cpustack_t proc_test_stack1[CONFIG_PROC_DEFSTACKSIZE / sizeof(cpustack_t)]; -static cpustack_t proc_test_stack2[CONFIG_PROC_DEFSTACKSIZE / sizeof(cpustack_t)]; +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)]; /** * 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