bool ReflowParametersStorage::read(ReflowParameters& params) { // the flash device deals in pages even though we require far less // than that. uint32_t page[64]; // declare the flash device Flash flash; // read the last page memset(page,0,sizeof(page)); if(!flash.readLastPage(reinterpret_cast<uint8_t *>(page))) return false; // check the magic number if(page[0]!=0xDEADBEEF) return false; // bit-copy out the parameters memcpy(¶ms,&page[1],sizeof(params)); // completed OK return true; }