Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. struct config_t {
  2.     uint8_t foo;
  3.     uint16_t bar;
  4. };
  5.  
  6. uint8_t ptr[512];
  7. struct config_t *config;
  8.  
  9. //read configuration from SD card
  10. readSector(10 /*sector number*/, ptr);
  11. config = (struct config_t*)ptr;
  12.  
  13. if (config->foo) {do something;}
  14. config->bar = 35; //update some paramter
  15.  
  16. //save configuration to SD card
  17. writeSector(10, ptr);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement