Closed freemp closed 1 year ago
It lets you upload firmware data without losing it if not applied right after. By using the length
parameter in open()
, pageAddress
and pageIndex
is recalculated basing on the size of the previously written data. With this, you may either continue uploading or perform apply
anytime later.
but what about second attempt to upload from start? maybe just don't call open() again if you can continue the transfer
Why a second attempt if all data is in flash already? Maybe I can't re-attempt, for whatever reason. I would like to be able to upload firmware now, keep it in stock, and apply anytime later.
You cannot continue the transfer if the device is reset meanwhile. But you could if you simply pass and process the previously uploaded size with open(), as proposed.
the flash is written in pages. the unwritten part of the buffer will get lost. but after you close(), you can call apply() any time.
and the second attempt doesn't have to be the same version of the sketch. the IDE always uploads from start.
how would you track what you have currently in flash?
but why you even use this library? the InternalStorageAVR is simple, you can incorporate the code from it into your sketch and have better control over it.
what for is it good?