Jump to content

Saving and loading data via sd card


david1982

Recommended Posts

If you don't want to do it manually then the best option is to use an existing library. I don't know specific embedded solutions for this but I guess any C INI file parser that you will find using google will work.

If you don't have the required resources then the best option is always to create your own set of configuration and settings structs and save them in binary to a file. You can then simply read back the raw data and cast it into the same struct again.

You'll find a lot of examples on how to save and restore structs to binary files in C using google.

~ Tectu

Link to comment
Share on other sites

Saving in binary is very quick and easy, just write the struct to the file. Binary however is difficult if you want someone to be able to edit it when the sdcard is not in your device. In that case you should use some text format.

If you need to use a text format a function to look at is gprintg which is equivalent to fprintf except it uses gfile.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...