diff options
author | (no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-09-09 01:08:38 +0000 |
---|---|---|
committer | (no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-09-09 01:08:38 +0000 |
commit | 520784c7ba6a8325e413a293ab11840d982ba87d (patch) | |
tree | 44ee93d44102d47014c6ff696ebc93e8de402e01 /openpcd/firmware/src/os/main.c | |
parent | b0317c72667378333e1008c49559e974f3e7c15d (diff) |
- major reorganization, split source tree in
- os: core "operating system"
- pcd: PCD (reader) side
- picc: PICC (transponder) side
- rewrite linker script almost from scratch (for correct DFU operation)
git-svn-id: https://svn.openpcd.org:2342/trunk@142 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpcd/firmware/src/os/main.c')
-rw-r--r-- | openpcd/firmware/src/os/main.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/openpcd/firmware/src/os/main.c b/openpcd/firmware/src/os/main.c new file mode 100644 index 0000000..c40fd79 --- /dev/null +++ b/openpcd/firmware/src/os/main.c @@ -0,0 +1,35 @@ +#include <errno.h> +#include <string.h> +#include <include/lib_AT91SAM7.h> +#include <os/dbgu.h> +#include <os/led.h> +#include "../openpcd.h" + +int main(void) +{ + /* initialize LED and debug unit */ + led_init(); + AT91F_DBGU_Init(); + + /* call application specific init function */ + _init_func(); + + // Enable User Reset and set its minimal assertion to 960 us + AT91C_BASE_RSTC->RSTC_RMR = + AT91C_RSTC_URSTEN | (0x4 << 8) | (unsigned int)(0xA5 << 24); + +#ifdef DEBUG_CLOCK_PA6 + AT91F_PMC_EnablePCK(AT91C_BASE_PMC, 0, AT91C_PMC_CSS_PLL_CLK); + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, 0, AT91C_PA6_PCK0); +#endif + + /* switch on first led */ + led_switch(1, 1); + + DEBUGPCRF("entering main (idle) loop"); + while (1) { + /* Call application specific main idle function */ + _main_func(); + dbgu_rb_flush(); + } +} |