summaryrefslogtreecommitdiff
path: root/bsp/avr32uc3b0
diff options
context:
space:
mode:
Diffstat (limited to 'bsp/avr32uc3b0')
-rw-r--r--bsp/avr32uc3b0/application.c2
-rw-r--r--bsp/avr32uc3b0/board.c90
-rw-r--r--bsp/avr32uc3b0/rtconfig.h26
-rw-r--r--bsp/avr32uc3b0/startup.c22
4 files changed, 70 insertions, 70 deletions
diff --git a/bsp/avr32uc3b0/application.c b/bsp/avr32uc3b0/application.c
index aeca191c18..6b87b226f4 100644
--- a/bsp/avr32uc3b0/application.c
+++ b/bsp/avr32uc3b0/application.c
@@ -52,7 +52,7 @@ int rt_application_init()
{
/* create led1 thread */
rt_thread_init(&thread_led1,
- "led1",
+ "led1",
rt_thread_entry_led1,
RT_NULL,
&thread_led1_stack[0],
diff --git a/bsp/avr32uc3b0/board.c b/bsp/avr32uc3b0/board.c
index 4227eee47d..226e59e551 100644
--- a/bsp/avr32uc3b0/board.c
+++ b/bsp/avr32uc3b0/board.c
@@ -16,11 +16,11 @@
#include "intc.h"
#include "serial.h"
-#define FOSC0 12000000
-#define FCPU 60000000
-#define FHSB FCPU
-#define FPBA FCPU
-#define FPBB FCPU
+#define FOSC0 12000000
+#define FCPU 60000000
+#define FHSB FCPU
+#define FPBA FCPU
+#define FPBB FCPU
extern void rt_hw_serial_isr(void);
extern void rt_hw_usart_init(void);
@@ -30,10 +30,10 @@ extern void rt_hw_usart_init(void);
*/
static void rt_hw_timer_handler(void)
{
- // Clears the interrupt request.
- Set_system_register(AVR32_COMPARE, FCPU / RT_TICK_PER_SECOND);
+ // Clears the interrupt request.
+ Set_system_register(AVR32_COMPARE, FCPU / RT_TICK_PER_SECOND);
- rt_tick_increase();
+ rt_tick_increase();
}
/**
@@ -41,35 +41,35 @@ static void rt_hw_timer_handler(void)
*/
static void peripherals_init(void)
{
- /*
- * PM initialization: OSC0 = 12MHz XTAL, PLL0 = 60MHz System Clock
- */
- pm_freq_param_t pm_freq_param =
- {
- .cpu_f = FCPU,
- .pba_f = FPBA,
- .osc0_f = FOSC0,
- .osc0_startup = AVR32_PM_OSCCTRL0_STARTUP_2048_RCOSC
- };
- pm_configure_clocks(&pm_freq_param);
+ /*
+ * PM initialization: OSC0 = 12MHz XTAL, PLL0 = 60MHz System Clock
+ */
+ pm_freq_param_t pm_freq_param =
+ {
+ .cpu_f = FCPU,
+ .pba_f = FPBA,
+ .osc0_f = FOSC0,
+ .osc0_startup = AVR32_PM_OSCCTRL0_STARTUP_2048_RCOSC
+ };
+ pm_configure_clocks(&pm_freq_param);
- /*
- * USART1 initialization
- */
- gpio_enable_module_pin(AVR32_USART1_TXD_0_1_PIN, AVR32_USART1_TXD_0_1_FUNCTION);
- gpio_enable_module_pin(AVR32_USART1_RXD_0_1_PIN, AVR32_USART1_RXD_0_1_FUNCTION);
- static const usart_options_t usartOptions = {
- .baudrate = 115200,
- .charlength = 8,
- .paritytype = USART_NO_PARITY,
- .stopbits = USART_1_STOPBIT,
- .channelmode = USART_NORMAL_CHMODE
- };
- usart_init_rs232(&AVR32_USART1, &usartOptions, FCPU);
+ /*
+ * USART1 initialization
+ */
+ gpio_enable_module_pin(AVR32_USART1_TXD_0_1_PIN, AVR32_USART1_TXD_0_1_FUNCTION);
+ gpio_enable_module_pin(AVR32_USART1_RXD_0_1_PIN, AVR32_USART1_RXD_0_1_FUNCTION);
+ static const usart_options_t usartOptions = {
+ .baudrate = 115200,
+ .charlength = 8,
+ .paritytype = USART_NO_PARITY,
+ .stopbits = USART_1_STOPBIT,
+ .channelmode = USART_NORMAL_CHMODE
+ };
+ usart_init_rs232(&AVR32_USART1, &usartOptions, FCPU);
- INTC_init_interrupts();
- INTC_register_interrupt(&rt_hw_serial_isr, AVR32_USART1_IRQ, AVR32_INTC_INT0);
- AVR32_USART1.ier = AVR32_USART_IER_RXRDY_MASK;
+ INTC_init_interrupts();
+ INTC_register_interrupt(&rt_hw_serial_isr, AVR32_USART1_IRQ, AVR32_INTC_INT0);
+ AVR32_USART1.ier = AVR32_USART_IER_RXRDY_MASK;
}
/**
@@ -77,21 +77,21 @@ static void peripherals_init(void)
*/
static void cpu_counter_init(void)
{
- INTC_register_interrupt(&rt_hw_timer_handler, AVR32_CORE_COMPARE_IRQ, AVR32_INTC_INT3);
- Set_system_register(AVR32_COMPARE, FCPU / RT_TICK_PER_SECOND);
- Set_system_register(AVR32_COUNT, 0);
+ INTC_register_interrupt(&rt_hw_timer_handler, AVR32_CORE_COMPARE_IRQ, AVR32_INTC_INT3);
+ Set_system_register(AVR32_COMPARE, FCPU / RT_TICK_PER_SECOND);
+ Set_system_register(AVR32_COUNT, 0);
}
void rt_hw_board_init(void)
{
- extern struct rt_device _rt_usart_device;
- extern struct avr32_serial_device uart;
+ extern struct rt_device _rt_usart_device;
+ extern struct avr32_serial_device uart;
- Disable_global_interrupt();
+ Disable_global_interrupt();
- peripherals_init();
- cpu_counter_init();
+ peripherals_init();
+ cpu_counter_init();
- rt_hw_serial_register(&_rt_usart_device, "uart1", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_STREAM, &uart);
- rt_console_set_device("uart1");
+ rt_hw_serial_register(&_rt_usart_device, "uart1", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_STREAM, &uart);
+ rt_console_set_device("uart1");
}
diff --git a/bsp/avr32uc3b0/rtconfig.h b/bsp/avr32uc3b0/rtconfig.h
index 93d95f1046..16e8194a89 100644
--- a/bsp/avr32uc3b0/rtconfig.h
+++ b/bsp/avr32uc3b0/rtconfig.h
@@ -12,16 +12,16 @@
#define RTCONFIG_H_
/* RT_NAME_MAX*/
-#define RT_NAME_MAX 8
+#define RT_NAME_MAX 8
/* RT_ALIGN_SIZE*/
-#define RT_ALIGN_SIZE 4
+#define RT_ALIGN_SIZE 4
/* PRIORITY_MAX*/
-#define RT_THREAD_PRIORITY_MAX 32
+#define RT_THREAD_PRIORITY_MAX 32
/* Tick per Second*/
-#define RT_TICK_PER_SECOND 100
+#define RT_TICK_PER_SECOND 100
/* SECTION: RT_DEBUG */
/* Thread Debug*/
@@ -69,7 +69,7 @@
/* SECTION: Console options */
/* the buffer size of console*/
#define RT_USING_CONSOLE
-#define RT_CONSOLEBUF_SIZE 128
+#define RT_CONSOLEBUF_SIZE 128
/* SECTION: FinSH shell options */
/* Using FinSH as Shell*/
@@ -84,21 +84,21 @@
#define RT_USING_DFS_ELMFAT
#define RT_DFS_ELM_WORD_ACCESS
-#define RT_DFS_ELM_DRIVES 2
+#define RT_DFS_ELM_DRIVES 2
/* SECTION: DFS options */
/* the max number of mounted filesystem */
-#define DFS_FILESYSTEMS_MAX 2
-/* the max number of opened files */
-#define DFS_FD_MAX 8
-/* the max number of cached sector */
-#define DFS_CACHE_MAX_NUM 4
+#define DFS_FILESYSTEMS_MAX 2
+/* the max number of opened files */
+#define DFS_FD_MAX 8
+/* the max number of cached sector */
+#define DFS_CACHE_MAX_NUM 4
/* SECTION: RT-Thread/GUI */
//#define RT_USING_RTGUI
/* name length of RTGUI object */
-#define RTGUI_NAME_MAX 12
+#define RTGUI_NAME_MAX 12
/* support 16 weight font */
#define RTGUI_USING_FONT16
/* support Chinese font */
@@ -112,6 +112,6 @@
/* use mouse cursor */
/* #define RTGUI_USING_MOUSE_CURSOR */
/* default font size in RTGUI */
-#define RTGUI_DEFAULT_FONT_SIZE 16
+#define RTGUI_DEFAULT_FONT_SIZE 16
#endif /* RTCONFIG_H_ */
diff --git a/bsp/avr32uc3b0/startup.c b/bsp/avr32uc3b0/startup.c
index dbebd21ceb..278b248599 100644
--- a/bsp/avr32uc3b0/startup.c
+++ b/bsp/avr32uc3b0/startup.c
@@ -21,21 +21,21 @@ extern void finsh_set_device(const char* device);
int main(void)
{
#ifdef RT_USING_HEAP
- extern void __heap_start__;
- extern void __heap_end__;
+ extern void __heap_start__;
+ extern void __heap_end__;
#endif
- rt_hw_board_init();
- rt_system_tick_init();
- rt_system_object_init();
- rt_system_timer_init();
+ rt_hw_board_init();
+ rt_system_tick_init();
+ rt_system_object_init();
+ rt_system_timer_init();
#ifdef RT_USING_HEAP
- rt_system_heap_init(&__heap_start__, &__heap_end__);
+ rt_system_heap_init(&__heap_start__, &__heap_end__);
#endif
- rt_system_scheduler_init();
- rt_application_init();
+ rt_system_scheduler_init();
+ rt_application_init();
#ifdef RT_USING_FINSH
/* init finsh */
@@ -44,7 +44,7 @@ int main(void)
#endif
rt_thread_idle_init();
- rt_system_scheduler_start();
+ rt_system_scheduler_start();
- return 0;
+ return 0;
}