X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=boards%2Fat91sam7x-ek%2Fexamples%2Fsd_fat%2Fmain.c;h=3d719272ac318660d0cbec1a674c6bf7a8d76fcf;hb=d27346fcb10105852c3e277fb35802e553613965;hp=da45694e08ba2e86b040a560dfe5f29e7b6b537a;hpb=ea12a07185cfa16b2a37d39ec7bdaf988b283c0c;p=bertos.git diff --git a/boards/at91sam7x-ek/examples/sd_fat/main.c b/boards/at91sam7x-ek/examples/sd_fat/main.c index da45694e..3d719272 100644 --- a/boards/at91sam7x-ek/examples/sd_fat/main.c +++ b/boards/at91sam7x-ek/examples/sd_fat/main.c @@ -46,6 +46,48 @@ * - 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 @@ -168,6 +210,7 @@ typedef struct INISetting static SpiDmaAt91 spi_dma; static Serial temp_sensor_bus; static Serial log_port; +static Sd sd; static void init(void) { @@ -220,7 +263,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, 1); if (sd_ok) {