Restore wrong committ.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 1 Feb 2008 09:52:42 +0000 (09:52 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 1 Feb 2008 09:52:42 +0000 (09:52 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1077 38d2e660-2303-0410-9eaa-f027e97ec537

cpu/arm/drv/kdebug_at91.c
cpu/arm/io/at91sam7.h
drv/timer_test.c
kern/proc_test.c

index b7e24cd3cc38e7c836543f8aa637f33eaf3635b1..64b3845f37ea3a07dafec6cf694a3abaf2646939 100644 (file)
@@ -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
index 1e80d147ae0c5ea43ec644749872e5e1d24e9d65..f91690e82fa05b3c7c1673353dfe981b89f36024 100644 (file)
 /*\}*/
 
 /**
- * USART & DEBUG pin names
+ * USART pins name
  *\{
  */
 #if CPU_ARM_AT91SAM7S256
        #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
 /*\}*/
 
index 10b76c42f9bf68d1b52c8067f2d5742f9973541e..c5be24c7eb0c264f7b1861993685ec097460f1b2 100644 (file)
  *#*
  *#*/
 
-#include <cpu/irq.h>
-#include "timer.h"
-#include <mware/event.h>
-//#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();
index 0db24f1c690f3053f88a935aaf4c18df43486c56..4c2f3126d76feea80fea461fa709c70defb6d97b 100644 (file)
@@ -1,6 +1,5 @@
 
 #include <kern/proc.h>
-#include <kern/monitor.h>
 #include <drv/timer.h>
 
 /**
@@ -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");