Skip to content

Commit

Permalink
Fix restyled errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pankore committed Feb 17, 2022
1 parent 3257c6a commit bce2ac9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/platform/Ameba/AmebaOTAImageProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <uint8_t*> (block.data() + imageProcessor->pOtaTgtHdr->FileImgHdr[0].Offset);
uint8_t * tempbufptr = const_cast<uint8_t *>(block.data() + imageProcessor->pOtaTgtHdr->FileImgHdr[0].Offset);
memcpy(imageProcessor->signature, tempbufptr, 8);
tempbufptr += 8;

Expand All @@ -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);
Expand Down Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/platform/Ameba/AmebaOTAImageProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#include <app/clusters/ota-requestor/OTADownloader.h>
#include <cstring>
#include <device_lock.h>
#include <lib/core/OTAImageHeader.h>
#include <platform/CHIPDeviceLayer.h>
#include <platform/OTAImageProcessor.h>
#include <lib/core/OTAImageHeader.h>

#if defined(CONFIG_PLATFORM_8710C)
#include "ota_8710c.h"
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit bce2ac9

Please sign in to comment.