bool ReflowParametersStorage::write(const ReflowParameters& params) { // the flash device deals in pages even though we require far less // than that. uint32_t page[64]; // copy in the magic number page[0]=0xDEADBEEF; // bit-copy in the ReflowParameters structure memcpy(&page[1],¶ms,sizeof(params)); // declare the flash device Flash flash; // erase the last page if(!flash.eraseLastSector()) return false; // write the last page return flash.writeLastPage(reinterpret_cast<const uint8_t *>(page)); }