diff options
Diffstat (limited to 'nuttx/arch/c5471/src')
-rw-r--r-- | nuttx/arch/c5471/src/c5471.h | 17 | ||||
-rw-r--r-- | nuttx/arch/c5471/src/up_internal.h | 19 | ||||
-rw-r--r-- | nuttx/arch/c5471/src/up_leds.c | 12 |
3 files changed, 25 insertions, 23 deletions
diff --git a/nuttx/arch/c5471/src/c5471.h b/nuttx/arch/c5471/src/c5471.h index df49a7eb0..b91c9f3d1 100644 --- a/nuttx/arch/c5471/src/c5471.h +++ b/nuttx/arch/c5471/src/c5471.h @@ -40,10 +40,18 @@ * Included Files ************************************************************/ +#include <nuttx/config.h> + #ifndef __ASSEMBLY__ # include <sys/types.h> #endif +#if defined(CONFIG_BOARD_C5471EVM) +# include <arch/board/c5471evm.h> +#else +# warning "Undefined C5471 Board" +#endif + /************************************************************ * Definitions ************************************************************/ @@ -72,10 +80,6 @@ #define CC_Z_BIT (1 << 30) #define CC_N_BIT (1 << 31) -/* Clocking *************************************************/ - -#define C5471_CLOCK 47500000 /* 47.5 MHz */ - /* UARTs ****************************************************/ #define UART_IRDA_BASE 0xffff0800 @@ -370,11 +374,6 @@ static inline void putreg16(uint16 val, unsigned int addr) __asm__ __volatile__("\tstrh %0, [%1]\n\t": : "r"(val), "r"(addr)); } -/* Most C5471 registers are 16-bits wide */ - -#define getreg(a) getreg16(1) -#define putreg(v,a) putreg16(v,a) - #endif #endif /* __C5471_H */ diff --git a/nuttx/arch/c5471/src/up_internal.h b/nuttx/arch/c5471/src/up_internal.h index c50a78483..60cc25273 100644 --- a/nuttx/arch/c5471/src/up_internal.h +++ b/nuttx/arch/c5471/src/up_internal.h @@ -40,6 +40,14 @@ * Included Files ************************************************************/ +#include <nuttx/config.h> + +#if defined(CONFIG_BOARD_C5471EVM) +# include <arch/board/c5471evm.h> +#else +# warning "Undefined C5471 Board" +#endif + /************************************************************ * Definitions ************************************************************/ @@ -55,17 +63,6 @@ #undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */ #undef CONFIG_DUMP_ON_EXIT /* Dump task state on exit */ -/* LED definitions */ - -#define LED_STARTED 0 -#define LED_HEAPALLOCATE 1 -#define LED_IRQSENABLED 2 -#define LED_STACKCREATED 3 -#define LED_INIRQ 4 -#define LED_SIGNAL 5 -#define LED_ASSERTION 6 -#define LED_PANIC 7 - /************************************************************ * Public Types ************************************************************/ diff --git a/nuttx/arch/c5471/src/up_leds.c b/nuttx/arch/c5471/src/up_leds.c index ee1241ede..9ecd74d86 100644 --- a/nuttx/arch/c5471/src/up_leds.c +++ b/nuttx/arch/c5471/src/up_leds.c @@ -45,8 +45,12 @@ * Definitions ************************************************************/ -#define CS2 *(volatile uint32*)0xffff2e08 -#define LEDS *(volatile uint32*)0x01000000 +#if defined(CONFIG_BOARD_C5471EVM) +# define CS2 *(volatile uint32*)0xffff2e08 +# define LEDS *(volatile uint32*)0x01000000 +#else +# warning "Undefined C5471 board" +#endif /************************************************************ * Private Data @@ -69,7 +73,8 @@ static uint32 g_ledstate; #ifdef CONFIG_C5471_LEDS void up_ledinit(void) { - /* Enable acces to LEDs */ +#if defined(CONFIG_BOARD_C5471EVM) + /* Enable access to LEDs */ CS2 = 0x000013db; @@ -77,6 +82,7 @@ void up_ledinit(void) g_ledstate = 0x000000fe; LEDS = g_ledstate; +#endif } /************************************************************ |