From 6eced34422f390ee7f58195bd2d3293a422396a7 Mon Sep 17 00:00:00 2001 From: Marcus Priesch Date: Sun, 20 Aug 2017 00:12:57 +0200 Subject: [PATCH] fixed size_t, irq --- examples/osd/ota-update/res_upload_image.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/osd/ota-update/res_upload_image.c b/examples/osd/ota-update/res_upload_image.c index 885f5085e..54dcfa935 100644 --- a/examples/osd/ota-update/res_upload_image.c +++ b/examples/osd/ota-update/res_upload_image.c @@ -61,7 +61,7 @@ // We allocate this statically, otherwise we cannot flash a new image // when ram is exhausted! static uint8_t current_page [256]; -static size_t current_offset = 0; +static uint32_t current_offset = 0; #define PAGESIZE (sizeof (current_page)) static void @@ -171,8 +171,11 @@ res_put_handler(void *request, void *response, uint8_t *buffer, uint16_t preferr if (!packet->block1_more) { // we are finished + sreg = SREG; + cli (); bootloader_backup_irq_table (1); // FIXME: 1 is hardcoded bootloader_set_boot_next (1); + SREG = sreg; } REST.set_response_status(response, REST.status.CHANGED);