![]() Uint16_t bucrc = CRC::crc16(usBu, sizeof(usBu) - sizeof(usBu.CRC) ) #include // (via Libraries) Miscfunctions:77:71: error: cannot convert 'usersettings' to 'const uint8_t* ' for argument '1' to 'uint16_t CRC::crc16(const uint8_t*, size_t)' Problem is that I do not know how to pass the struct-content to the crc calculator. To know if the read value from flash is valid my idea is to calculate a 16-bit crc for all of the struct except the last two bytes where crc is stored. Using the ESP_EEPROM library will also lower the wear by its own magic. The code below is intended to be run like every 5 seconds and will check if the settings have changed and then commit them to flash and if they has been changed. In the example below, the asterisk (*) option displays the file’s hash value using all available algorithms.I had the idea that I wanted to have a flexible way to have user-settings in my different ESP8266 nodes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |