projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merged from external project:
[bertos.git]
/
app
/
at91sam7s
/
at91sam7s.c
diff --git
a/app/at91sam7s/at91sam7s.c
b/app/at91sam7s/at91sam7s.c
index 000d3322235a65bcbb66a3d9b6a2f2fcff24d89b..275af6e565faf6246d980d8d198ed674a8af9ac7 100644
(file)
--- a/
app/at91sam7s/at91sam7s.c
+++ b/
app/at91sam7s/at91sam7s.c
@@
-37,17
+37,16
@@
* \brief AT91SAM7S-EK porting test.
*/
* \brief AT91SAM7S-EK porting test.
*/
+#include <cfg/macros.h>
#include <drv/timer.h>
#include <drv/sysirq_at91.h>
#include <drv/timer.h>
#include <drv/sysirq_at91.h>
+#include <kern/proc.h>
#include <drv/ser.h>
#include <cfg/macros.h>
#include <io/arm.h>
#include <drv/ser.h>
#include <cfg/macros.h>
#include <io/arm.h>
-static int iort = 23;
-static int iort1 = 232;
-static int iort2 = 233;
-
Timer leds_timer;
Timer leds_timer;
+Serial ser_fd;
static void leds_toggle(void)
{
static void leds_toggle(void)
{
@@
-73,51
+72,45
@@
static void leds_toggle(void)
int main(void)
{
int main(void)
{
+ char msg[]="BeRTOS, be fast be beatiful be realtime";
kdbg_init();
kdbg_init();
- sysirq_init();
timer_init();
timer_init();
+ proc_init();
+ ASSERT(!IRQ_ENABLED());
/* Open the main communication port */
/* Open the main communication port */
- Serial *host_port = ser_open(0);
- ser_setbaudrate(host_port, 115200);
- ser_setparity(host_port, SER_PARITY_NONE);
+ ser_init(&ser_fd, 0);
+ ser_setbaudrate(&ser_fd, 115200);
+ ser_setparity(&ser_fd, SER_PARITY_NONE);
+
IRQ_ENABLE;
IRQ_ENABLE;
+ ASSERT(IRQ_ENABLED());
/* Disable all pullups */
PIOA_PUDR = 0xffffffff;
/* Set PA0..3 connected to PIOA */
/* Disable all pullups */
PIOA_PUDR = 0xffffffff;
/* Set PA0..3 connected to PIOA */
- PIOA_PER = 0x000000
0
f;
+ PIOA_PER = 0x000000
1
f;
/* Set PA0..3 as output */
/* Set PA0..3 as output */
- PIOA_OER = 0x000000
0
f;
+ PIOA_OER = 0x000000
1
f;
/* Disable multidrive on all pins */
/* Disable multidrive on all pins */
- PIOA_MDDR = 0x000000
0
f;
+ PIOA_MDDR = 0x000000
1
f;
/* Set PA0..3 to 1 to turn off leds */
PIOA_SODR = 0x0000000f;
/* turn first led on */
PIOA_CODR = 0x00000001;
/* Set PA0..3 to 1 to turn off leds */
PIOA_SODR = 0x0000000f;
/* turn first led on */
PIOA_CODR = 0x00000001;
+ timer_setSoftint(&leds_timer, (Hook)leds_toggle, 0);
+ timer_setDelay(&leds_timer, ms_to_ticks(100));
+ timer_add(&leds_timer);
-
-
-/*
- timer_set_event_softint(&leds_timer, (Hook)leds_toggle, 0);
- timer_setDelay(&leds_timer, ms_to_ticks(100));
- timer_add(&leds_timer);
-*/
-
+ ASSERT(proc_testRun() == 0);
// Main loop
for(;;)
{
// Main loop
for(;;)
{
- ser_printf(host_port," %s", "a");
- kprintf("W la figa!\n");
- iort+= 1;
- iort1+= 1;
- iort2+= 1;
+ kfile_printf(&ser_fd.fd, "From serial 0: %s\r\n", msg);
}
}
-
return 0;
}
return 0;
}
-