From 57bc2725ffb9ebe4c40ad1942090d462e1208a5d Mon Sep 17 00:00:00 2001 From: arighi Date: Tue, 25 May 2010 12:46:42 +0000 Subject: [PATCH 1/1] Add comments to the "empty" preset templates across the supported boards. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3824 38d2e660-2303-0410-9eaa-f027e97ec537 --- boards/arduino/templates/empty/main.c | 18 +++++++++++--- boards/at91sam7s-ek/templates/empty/main.c | 18 +++++++++++--- boards/at91sam7x-ek/templates/empty/main.c | 18 +++++++++++--- boards/ek-lm3s1968/templates/empty/main.c | 28 +++++++++++++++++----- boards/lpc-p2378/templates/empty/main.c | 18 +++++++++++--- boards/stm32-p103/templates/empty/main.c | 13 +++++++++- boards/triface/templates/empty/main.c | 18 +++++++++++--- 7 files changed, 109 insertions(+), 22 deletions(-) diff --git a/boards/arduino/templates/empty/main.c b/boards/arduino/templates/empty/main.c index 0f946199..2bbaf044 100644 --- a/boards/arduino/templates/empty/main.c +++ b/boards/arduino/templates/empty/main.c @@ -51,20 +51,32 @@ static Serial out; static void init(void) { + /* Enable all the interrupts */ IRQ_ENABLE; + /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); + /* Initialize system timer */ timer_init(); - proc_init(); - LED_INIT(); - + /* Initialize UART0 */ ser_init(&out, SER_UART0); + /* Configure UART0 to work at 115.200 bps */ ser_setbaudrate(&out, 115200); + /* Initialize LED driver */ + LED_INIT(); + + /* + * Kernel initialization: processes (allow to create and dispatch + * processes using proc_new()). + */ + proc_init(); } int main(void) { init(); + + /* Put your code here... */ while (1) { } diff --git a/boards/at91sam7s-ek/templates/empty/main.c b/boards/at91sam7s-ek/templates/empty/main.c index 87326772..f5c8b305 100644 --- a/boards/at91sam7s-ek/templates/empty/main.c +++ b/boards/at91sam7s-ek/templates/empty/main.c @@ -49,20 +49,32 @@ static Serial out; static void init(void) { + /* Enable all the interrupts */ IRQ_ENABLE; + /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); + /* Initialize system timer */ timer_init(); - proc_init(); - LED_INIT(); - + /* Initialize UART0 */ ser_init(&out, SER_UART0); + /* Configure UART0 to work at 115.200 bps */ ser_setbaudrate(&out, 115200); + /* Initialize LED driver */ + LED_INIT(); + + /* + * Kernel initialization: processes (allow to create and dispatch + * processes using proc_new()). + */ + proc_init(); } int main(void) { init(); + + /* Put your code here... */ while (1) { } diff --git a/boards/at91sam7x-ek/templates/empty/main.c b/boards/at91sam7x-ek/templates/empty/main.c index 0f946199..2bbaf044 100644 --- a/boards/at91sam7x-ek/templates/empty/main.c +++ b/boards/at91sam7x-ek/templates/empty/main.c @@ -51,20 +51,32 @@ static Serial out; static void init(void) { + /* Enable all the interrupts */ IRQ_ENABLE; + /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); + /* Initialize system timer */ timer_init(); - proc_init(); - LED_INIT(); - + /* Initialize UART0 */ ser_init(&out, SER_UART0); + /* Configure UART0 to work at 115.200 bps */ ser_setbaudrate(&out, 115200); + /* Initialize LED driver */ + LED_INIT(); + + /* + * Kernel initialization: processes (allow to create and dispatch + * processes using proc_new()). + */ + proc_init(); } int main(void) { init(); + + /* Put your code here... */ while (1) { } diff --git a/boards/ek-lm3s1968/templates/empty/main.c b/boards/ek-lm3s1968/templates/empty/main.c index d79b9880..659b51b5 100644 --- a/boards/ek-lm3s1968/templates/empty/main.c +++ b/boards/ek-lm3s1968/templates/empty/main.c @@ -40,40 +40,56 @@ #include #include -#include #include #include #include #include -#include #include #include -static uint8_t raster[RAST_SIZE(LCD_WIDTH, LCD_HEIGHT)]; +/* Bitmap to display on the OLED display */ static Bitmap lcd_bitmap; +/* Raster associated to the Bitmap image */ +static uint8_t raster[RAST_SIZE(LCD_WIDTH, LCD_HEIGHT)]; static Serial out; static void init(void) { + /* Enable all the interrupts */ IRQ_ENABLE; + /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); + /* Initialize system timer */ timer_init(); - proc_init(); + /* Initialize UART0 */ + ser_init(&out, SER_UART0); + /* Configure UART0 to work at 115.200 bps */ + ser_setbaudrate(&out, 115200); + /* Initialize LED driver */ LED_INIT(); + /* Initialize the OLED display (RIT128x96) */ rit128x96_init(); + /* Draw an empty Bitmap on the screen */ gfx_bitmapInit(&lcd_bitmap, raster, LCD_WIDTH, LCD_HEIGHT); + /* Refresh the display */ rit128x96_blitBitmap(&lcd_bitmap); + /* Initialize the keypad driver */ kbd_init(); - ser_init(&out, SER_UART0); - ser_setbaudrate(&out, 115200); + /* + * Kernel initialization: processes (allow to create and dispatch + * processes using proc_new()). + */ + proc_init(); } int main(void) { init(); + + /* Put your code here... */ while (1) { } diff --git a/boards/lpc-p2378/templates/empty/main.c b/boards/lpc-p2378/templates/empty/main.c index 0f946199..2bbaf044 100644 --- a/boards/lpc-p2378/templates/empty/main.c +++ b/boards/lpc-p2378/templates/empty/main.c @@ -51,20 +51,32 @@ static Serial out; static void init(void) { + /* Enable all the interrupts */ IRQ_ENABLE; + /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); + /* Initialize system timer */ timer_init(); - proc_init(); - LED_INIT(); - + /* Initialize UART0 */ ser_init(&out, SER_UART0); + /* Configure UART0 to work at 115.200 bps */ ser_setbaudrate(&out, 115200); + /* Initialize LED driver */ + LED_INIT(); + + /* + * Kernel initialization: processes (allow to create and dispatch + * processes using proc_new()). + */ + proc_init(); } int main(void) { init(); + + /* Put your code here... */ while (1) { } diff --git a/boards/stm32-p103/templates/empty/main.c b/boards/stm32-p103/templates/empty/main.c index 33777883..577a98a6 100644 --- a/boards/stm32-p103/templates/empty/main.c +++ b/boards/stm32-p103/templates/empty/main.c @@ -46,17 +46,28 @@ static void init(void) { + /* Enable all the interrupts */ IRQ_ENABLE; + /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); + /* Initialize system timer */ timer_init(); - proc_init(); + /* Initialize LED driver */ LED_INIT(); + + /* + * Kernel initialization: processes (allow to create and dispatch + * processes using proc_new()). + */ + proc_init(); } int main(void) { init(); + + /* Put your code here... */ while (1) { } diff --git a/boards/triface/templates/empty/main.c b/boards/triface/templates/empty/main.c index 0f946199..2bbaf044 100644 --- a/boards/triface/templates/empty/main.c +++ b/boards/triface/templates/empty/main.c @@ -51,20 +51,32 @@ static Serial out; static void init(void) { + /* Enable all the interrupts */ IRQ_ENABLE; + /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); + /* Initialize system timer */ timer_init(); - proc_init(); - LED_INIT(); - + /* Initialize UART0 */ ser_init(&out, SER_UART0); + /* Configure UART0 to work at 115.200 bps */ ser_setbaudrate(&out, 115200); + /* Initialize LED driver */ + LED_INIT(); + + /* + * Kernel initialization: processes (allow to create and dispatch + * processes using proc_new()). + */ + proc_init(); } int main(void) { init(); + + /* Put your code here... */ while (1) { } -- 2.25.1