Merge some fix from trunk.
[bertos.git] / boards / at91sam7x-ek / examples / sd_fat / main.c
index da45694e08ba2e86b040a560dfe5f29e7b6b537a..98a6009624f37faa090d414c7bd7cf2b02f7a67f 100644 (file)
  * - wait the sample_time (from ini file)
  * - contine from beginning.
  *
+ * Here we put the ini file that this example uses. To use it copy
+ * the folling configutation line into the file called sd_fat.ini (or see INI_FILE_NAME
+ * define if you want chande the name).
+ * \code
+ *
+ *   # Bertos SD fat project example
+ *   #
+ *   # Basic configurarion
+ *   #
+ *
+ *   [log]
+ *   # Name of log file
+ *   name = test.log
+ *   # Enable the logging on serial device (enable = 1, disable = 0)
+ *   log_on_serial = 1
+ *   # Enable logging on sd file (enable = 1, disable = 0)
+ *   log_on_file = 1
+ *   # Period between two log in millisecond
+ *   sample_time = 1000
+ *
+ *   [serial_log]
+ *   # Select serial port where log
+ *   port = 0
+ *   # Serial port baudrate
+ *   baud = 115200
+ *
+ *   [log_format]
+ *   # Default text to insert on each log line
+ *   line_header = BeRTOS Log:
+ *   # Use this char to separate each log field
+ *   field_sep = ;
+ *
+ *   [temperature]
+ *   unit_label = C
+ *
+ *   [pressure]
+ *   unit_label = hPa
+ *
+ *   [voltage]
+ *   unit_label = V
+ *
+ * \endcode
  */
 
 #include <cfg/debug.h>
@@ -220,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)
                {