Merge some fix from trunk.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 8 Nov 2010 10:34:40 +0000 (10:34 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 8 Nov 2010 10:34:40 +0000 (10:34 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/branches/2.6@4533 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/drv/flash.h
bertos/drv/sd.h
boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_adc.h
boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_debug.h
boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_fat.h
boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_lcd_hd44.h
boards/at91sam7x-ek/examples/sd_fat/cfg/cfg_xmodem.h
boards/at91sam7x-ek/examples/sd_fat/main.c
boards/at91sam7x-ek/examples/sd_fat/project.bertos
boards/at91sam7x-ek/examples/sd_fat/sd_fat.mk

index da1fa80143251cdcaf320d7a7457c69e23f4b36e..9ea5665075e815793a0e9daf8ccaa2a2d903e8a0 100644 (file)
@@ -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
index 22a19d1e7d09322be23dc605caf16d58085fbe11..df12bb6e7a0639a2cdd05bdff6cf7513f862307c 100644 (file)
 #ifndef DRV_SD_H
 #define DRV_SD_H
 
+#include "cfg/cfg_sd.h"
+
 #include <io/kfile.h>
 #include <io/kblock.h>
 
 #include <fs/fatfs/diskio.h>
 
-#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
 
index 90aeb7bdfd13119341ca045ebf4d4ccb117eaa7c..df2587be517232fd86b9192faa5c39172c793330 100644 (file)
 
 /**
  * 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
 
  * 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
index 7ea52a0b72df7be900b58330a237448bd32ed094..10639848f13d4d660778b5b0f542fad3dbbba055 100644 (file)
  */
 #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 */
index 83772f45047a2d37e8dc8e3d41d9a8f99a2b07b3..fcd717af3591aede4c4b578bab04e6f794d445c2 100644 (file)
 #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"
index 78f1f20bb9088b5accd1772a37401e939b29b0b6..7bea43766328eb6b69640e8c29210cc2289f4a06 100644 (file)
  */
 #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 */
 
index c17bda624c436c8254ace0db9faf25816d729845..38db7359a17e9208be9c5c36e31be52aa76ad3fd 100644 (file)
@@ -32,7 +32,6 @@
  *
  * \brief Configuration file for xmodem module.
  *
- *
  * \author Daniele Basile <asterix@develer.com>
  */
 
index 892a6004d7c67850b02574c4ab237732dba4b1db..98a6009624f37faa090d414c7bd7cf2b02f7a67f 100644 (file)
@@ -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)
                {
index 4834b5720562a85a9f099a50a76f3b4ef5495ceb..34b2024bdd5ca072ef7d8b139affe64ea063ec3d 100644 (file)
@@ -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
index 6a0cf557ea0e49522ea0c88bcc6db4d7eac03e9f..32ca7a26e331ac07821d38a258316f1a4b0c05d9 100644 (file)
@@ -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!