From: asterix Date: Mon, 8 Nov 2010 10:25:55 +0000 (+0000) Subject: Update example project to new bertos api. X-Git-Tag: 2.7.0~394 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=9ca90f0f5b0c85e3e1286a60207f9b4e364677f9;p=bertos.git Update example project to new bertos api. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4532 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_adc.h b/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_adc.h index 90aeb7bd..df2587be 100644 --- a/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_adc.h +++ b/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_adc.h @@ -56,9 +56,12 @@ /** * Clock Frequency for ADC conversion. + * This frequency will be rounded down to an integer + * submultiple of CPU_FREQ. * * $WIZ$ type = "int" * $WIZ$ supports = "at91" + * $WIZ$ max = 5000000 */ #define CONFIG_ADC_CLOCK 4800000UL @@ -66,16 +69,16 @@ * Minimum time for starting up a conversion [us]. * * $WIZ$ type = "int" - * $WIZ$ min = 0 + * $WIZ$ min = 20 * $WIZ$ supports = "at91" */ #define CONFIG_ADC_STARTUP_TIME 20 /** - * Minimum time for sample and hold [us]. + * Minimum time for sample and hold [ns]. * * $WIZ$ type = "int" - * $WIZ$ min = 0 + * $WIZ$ min = 600 * $WIZ$ supports = "at91" */ #define CONFIG_ADC_SHTIME 834 diff --git a/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_debug.h b/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_debug.h index 7ea52a0b..10639848 100644 --- a/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_debug.h +++ b/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_debug.h @@ -51,4 +51,20 @@ */ #define CONFIG_KDEBUG_BAUDRATE 115200UL +/** + * Clock source for the UART module. You need to write the code to reprogram the respective clock at the required frequency in your project before calling kdbg_init(). + * + * $WIZ$ type = "enum" + * $WIZ$ value_list = "kdbg_clk_src" + * $WIZ$ supports = "msp430" + */ +#define CONFIG_KDEBUG_CLOCK_SOURCE KDBG_UART_SMCLK + +/** + * Clock frequency. (Only if different from MCLK's frequency, otherwise leave it zero) + * $WIZ$ type = "int"; min = 0 + * $WIZ$ supports = "msp430" + */ +#define CONFIG_KDEBUG_CLOCK_FREQ 0UL + #endif /* CFG_DEBUG_H */ diff --git a/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_fat.h b/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_fat.h index 83772f45..fcd717af 100644 --- a/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_fat.h +++ b/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_fat.h @@ -40,6 +40,23 @@ #ifndef CFG_FAT_H #define CFG_FAT_H +/** + * Module logging level. + * + * $WIZ$ type = "enum" + * $WIZ$ value_list = "log_level" + */ +#define FAT_LOG_LEVEL LOG_LVL_ERR + +/** + * Module logging format. + * + * $WIZ$ type = "enum" + * $WIZ$ value_list = "log_format" + */ +#define FAT_LOG_FORMAT LOG_FMT_VERBOSE + + /** * Use word alignment to access FAT structure. * $WIZ$ type = "boolean" diff --git a/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_lcd_hd44.h b/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_lcd_hd44.h index 78f1f20b..7bea4376 100644 --- a/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_lcd_hd44.h +++ b/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_lcd_hd44.h @@ -51,5 +51,19 @@ */ #define CONFIG_LCD_ADDRESS_FAST 1 +/** + * Number of columns in LCD display. + * $WIZ$ type = "enum" + * $WIZ$ value_list = "lcd_hd44_cols" + */ +#define CONFIG_LCD_COLS LCD_HD44_COLS_16 + +/** + * Number of rows in LCD display. + * $WIZ$ type = "enum" + * $WIZ$ value_list = "lcd_hd44_rows" + */ +#define CONFIG_LCD_ROWS LCD_HD44_ROWS_2 + #endif /* CFG_LCD_H */ diff --git a/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_xmodem.h b/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_xmodem.h index c17bda62..38db7359 100644 --- a/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_xmodem.h +++ b/boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_xmodem.h @@ -32,7 +32,6 @@ * * \brief Configuration file for xmodem module. * - * * \author Daniele Basile */ diff --git a/boards/at91sam7x-ek/examples/sd_fat/main.c b/boards/at91sam7x-ek/examples/sd_fat/main.c index 3d719272..c51da3e6 100644 --- a/boards/at91sam7x-ek/examples/sd_fat/main.c +++ b/boards/at91sam7x-ek/examples/sd_fat/main.c @@ -263,7 +263,7 @@ int main(void) INISetting ini_set; memset(&ini_set, 0, sizeof(ini_set)); - sd_ok = sd_init(&sd, &spi_dma.fd, 1); + sd_ok = sd_init(&sd, &spi_dma.fd, 0); if (sd_ok) { diff --git a/boards/at91sam7x-ek/examples/sd_fat/project.bertos b/boards/at91sam7x-ek/examples/sd_fat/project.bertos index 4834b572..34b2024b 100644 --- a/boards/at91sam7x-ek/examples/sd_fat/project.bertos +++ b/boards/at91sam7x-ek/examples/sd_fat/project.bertos @@ -44,29 +44,29 @@ p21 ssS'ENABLED_MODULES' p22 (lp23 -S'ser' +S'adc' p24 -aS'tmp123' +aS'fat' p25 -aS'formatwr' +aS'tmp123' p26 -aS'sd' +aS'ini_reader' p27 -aS'adc' +aS'debug' p28 -aS'sprintf' +aS'ser' p29 aS'kfile' p30 -aS'fat' +aS'sprintf' p31 aS'timer' p32 -aS'kfilefifo' +aS'formatwr' p33 -aS'ini_reader' +aS'kfilefifo' p34 -aS'debug' +aS'sd' p35 asS'CPU_NAME' p36 diff --git a/boards/at91sam7x-ek/examples/sd_fat/sd_fat.mk b/boards/at91sam7x-ek/examples/sd_fat/sd_fat.mk index 6a0cf557..32ca7a26 100644 --- a/boards/at91sam7x-ek/examples/sd_fat/sd_fat.mk +++ b/boards/at91sam7x-ek/examples/sd_fat/sd_fat.mk @@ -19,27 +19,29 @@ sd_fat_HW_PATH = boards/at91sam7x-ek # Files automatically generated by the wizard. DO NOT EDIT, USE sd_fat_USER_CSRC INSTEAD! sd_fat_WIZARD_CSRC = \ + bertos/fs/fatfs/diskio.c \ bertos/cpu/arm/drv/timer_at91.c \ - bertos/struct/kfile_fifo.c \ - bertos/fs/fat.c \ - bertos/kern/kfile.c \ - bertos/drv/tmp123.c \ - bertos/mware/ini_reader.c \ - bertos/cpu/arm/drv/sysirq_at91.c \ - bertos/cpu/arm/drv/adc_arm.c \ + bertos/mware/sprintf.c \ + bertos/cpu/arm/drv/adc_at91.c \ + bertos/io/kfile.c \ bertos/cpu/arm/drv/ser_arm.c \ - bertos/cpu/arm/drv/timer_arm.c \ bertos/cpu/arm/drv/ser_at91.c \ bertos/drv/adc.c \ - bertos/mware/sprintf.c \ bertos/drv/timer.c \ bertos/fs/fatfs/ff.c \ - bertos/mware/event.c \ - bertos/cpu/arm/drv/adc_at91.c \ - bertos/mware/formatwr.c \ bertos/drv/ser.c \ bertos/mware/hex.c \ + bertos/drv/tmp123.c \ + bertos/mware/ini_reader.c \ + bertos/cpu/arm/drv/adc_arm.c \ + bertos/struct/kfile_fifo.c \ + bertos/mware/formatwr.c \ bertos/drv/sd.c \ + bertos/io/kblock.c \ + bertos/mware/event.c \ + bertos/cpu/arm/drv/sysirq_at91.c \ + bertos/cpu/arm/drv/timer_arm.c \ + bertos/fs/fat.c \ # # Files automatically generated by the wizard. DO NOT EDIT, USE sd_fat_USER_PCSRC INSTEAD!