File tree Expand file tree Collapse file tree 6 files changed +3321
-3320
lines changed Expand file tree Collapse file tree 6 files changed +3321
-3320
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,8 @@ int main() {
207207 /* Initialize the lzss module with the data which
208208 * it requires.
209209 */
210- lzss_init (&update_file, (uint32_t )SKETCH_START);
210+ uint32_t const LZSS_FILE_SIZE = update_file.size () - sizeof (ota_header.buf );
211+ lzss_init (&update_file, (uint32_t )SKETCH_START, LZSS_FILE_SIZE);
211212 /* During the process of decoding UPDATE.BIN.LZSS
212213 * is decompressed and stored as UPDATE.BIN.
213214 */
Original file line number Diff line number Diff line change @@ -48,12 +48,12 @@ static uint32_t flash_addr = 0;
4848 PUBLIC FUNCTIONS
4949 **************************************************************************************/
5050
51- void lzss_init (WiFiStorageFile * update_file_ptr, uint32_t const sketch_start)
51+ void lzss_init (WiFiStorageFile * update_file_ptr, uint32_t const sketch_start, uint32_t const lzss_file_size )
5252{
5353 SKETCH_START = sketch_start;
5454 flash_addr = sketch_start;
5555 update_file = update_file_ptr;
56- LZSS_FILE_SIZE = update_file-> size () ;
56+ LZSS_FILE_SIZE = lzss_file_size ;
5757}
5858
5959void lzss_flush ()
Original file line number Diff line number Diff line change 1313 FUNCTION DEFINITION
1414 **************************************************************************************/
1515
16- void lzss_init (WiFiStorageFile * update_file_ptr , uint32_t const sketch_start );
16+ void lzss_init (WiFiStorageFile * update_file_ptr , uint32_t const sketch_start , uint32_t const lzss_file_size );
1717void lzss_decode ();
1818void lzss_flush ();
1919
You can’t perform that action at this time.
0 commit comments