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
/*\}*/
/**
- * 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
/*\}*/
*#*
*#*/
-#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)
{
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();
#include <kern/proc.h>
-#include <kern/monitor.h>
#include <drv/timer.h>
/**
}
}
-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");