From bce2ac98fb47824fc1f08d55f54f327a6e375b59 Mon Sep 17 00:00:00 2001 From: pankore <86098180+pankore@users.noreply.github.com> Date: Wed, 16 Feb 2022 22:42:31 +0800 Subject: [PATCH] Fix restyled errors --- src/platform/Ameba/AmebaOTAImageProcessor.cpp | 8 +++----- src/platform/Ameba/AmebaOTAImageProcessor.h | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/platform/Ameba/AmebaOTAImageProcessor.cpp b/src/platform/Ameba/AmebaOTAImageProcessor.cpp index 79a894b67f3f03..8dab10230950e5 100644 --- a/src/platform/Ameba/AmebaOTAImageProcessor.cpp +++ b/src/platform/Ameba/AmebaOTAImageProcessor.cpp @@ -230,7 +230,7 @@ void AmebaOTAImageProcessor::HandleProcessBlock(intptr_t context) imageProcessor->signature = &(imageProcessor->pOtaTgtHdr->Sign[0][0]); // Store the signature temporarily - uint8_t * tempbufptr = const_cast (block.data() + imageProcessor->pOtaTgtHdr->FileImgHdr[0].Offset); + uint8_t * tempbufptr = const_cast(block.data() + imageProcessor->pOtaTgtHdr->FileImgHdr[0].Offset); memcpy(imageProcessor->signature, tempbufptr, 8); tempbufptr += 8; @@ -254,8 +254,7 @@ void AmebaOTAImageProcessor::HandleProcessBlock(intptr_t context) else // received subsequent blocks { device_mutex_lock(RT_DEV_LOCK_FLASH); - if (ota_writestream_user(imageProcessor->flash_addr + imageProcessor->size, block.size(), - block.data()) < 0) + if (ota_writestream_user(imageProcessor->flash_addr + imageProcessor->size, block.size(), block.data()) < 0) { ChipLogError(SoftwareUpdate, "Write to flash failed"); device_mutex_unlock(RT_DEV_LOCK_FLASH); @@ -288,8 +287,7 @@ void AmebaOTAImageProcessor::HandleProcessBlock(intptr_t context) if (imageProcessor->block_len > 0) { device_mutex_lock(RT_DEV_LOCK_FLASH); - if (flash_burst_write(&flash_ota, imageProcessor->flash_addr + 32, imageProcessor->block_len, - block.data() + 32) < 0) + if (flash_burst_write(&flash_ota, imageProcessor->flash_addr + 32, imageProcessor->block_len, block.data() + 32) < 0) { device_mutex_unlock(RT_DEV_LOCK_FLASH); ChipLogError(SoftwareUpdate, "Write to flash failed"); diff --git a/src/platform/Ameba/AmebaOTAImageProcessor.h b/src/platform/Ameba/AmebaOTAImageProcessor.h index ab1798ff102485..36a609af173380 100644 --- a/src/platform/Ameba/AmebaOTAImageProcessor.h +++ b/src/platform/Ameba/AmebaOTAImageProcessor.h @@ -21,9 +21,9 @@ #include #include #include +#include #include #include -#include #if defined(CONFIG_PLATFORM_8710C) #include "ota_8710c.h" @@ -79,7 +79,7 @@ class AmebaOTAImageProcessor : public OTAImageProcessorInterface #endif MutableByteSpan mBlock; OTADownloader * mDownloader; - uint32_t size = 0; + uint32_t size = 0; bool readHeader = false; uint32_t flash_addr; OTAImageHeaderParser mHeaderParser;