From: asterix Date: Mon, 8 Nov 2010 10:34:40 +0000 (+0000) Subject: Merge some fix from trunk. X-Git-Tag: 2.6.1~7 X-Git-Url: https://codewiz.org/gitweb?p=bertos.git;a=commitdiff_plain;h=010a2d0611571ec1e4bace00b4b6efe8462f512f Merge some fix from trunk. git-svn-id: https://src.develer.com/svnoss/bertos/branches/2.6@4533 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/drv/flash.h b/bertos/drv/flash.h index da1fa801..9ea56650 100644 --- a/bertos/drv/flash.h +++ b/bertos/drv/flash.h @@ -106,9 +106,9 @@ void flash_hw_initUnbuffered(Flash *fls, int flags); #include CPU_HEADER(flash) #define FLASH_WRITE_ONCE BV(0) ///< Allow only one write per block. -#define FLASH_BUFFERED BV(1) ///< Open flash memory using page caching, allowing the modification and partial write. +#define FLASH_UNBUFFERED BV(1) ///< Open flash memory disabling page caching, no modification and partial write are allowed. -#define flash_init_2(fls, flags) (flags & FLASH_BUFFERED) ? \ +#define flash_init_2(fls, flags) (flags & FLASH_UNBUFFERED) ? \ flash_hw_initUnbuffered(fls, flags) : flash_hw_init(fls, flags) #if !CONFIG_FLASH_DISABLE_OLD_API diff --git a/bertos/drv/sd.h b/bertos/drv/sd.h index 22a19d1e..df12bb6e 100644 --- a/bertos/drv/sd.h +++ b/bertos/drv/sd.h @@ -44,12 +44,15 @@ #ifndef DRV_SD_H #define DRV_SD_H +#include "cfg/cfg_sd.h" + #include #include #include -#include "cfg/cfg_sd.h" + +#define SD_UNBUFFERED BV(0) ///< Open SD memory disabling page caching, no modification and partial write are allowed. /** * SD Card context structure. @@ -99,7 +102,7 @@ bool sd_initBuf(Sd *sd, KFile *ch); * * \return true if initialization succeds, false otherwise. */ - #define sd_init(sd, ch, buffered) ((buffered) ? sd_initBuf((sd), (ch)) : sd_initUnbuf((sd), (ch))) + #define sd_init(sd, ch, buffered) ((buffered & SD_UNBUFFERED) ? sd_initUnbuf((sd), (ch)) : sd_initBuf((sd), (ch))) #endif 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 892a6004..98a60096 100644 --- a/boards/at91sam7x-ek/examples/sd_fat/main.c +++ b/boards/at91sam7x-ek/examples/sd_fat/main.c @@ -74,7 +74,7 @@ * * [log_format] * # Default text to insert on each log line - * line_header = BeRTOS Log: + * line_header = BeRTOS Log: * # Use this char to separate each log field * field_sep = ; * @@ -262,7 +262,7 @@ int main(void) INISetting ini_set; memset(&ini_set, 0, sizeof(ini_set)); - sd_ok = sd_init(&spi_dma.fd); + 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!