Skip to content

Commit

Permalink
samx5x: minimize scope of variables
Browse files Browse the repository at this point in the history
  • Loading branch information
robots committed Mar 3, 2025
1 parent 014accb commit 3263fe0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/target/samx5x.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,6 @@ static bool samx5x_user_page_write(target_flash_s *f, target_addr_t dest, const

target_s *t = f->t;
uint8_t buffer[SAMX5X_PAGE_SIZE];
uint32_t current_word;
uint32_t value;
uint32_t factory_mask;
bool changed = false;

DEBUG_INFO("User page write addr=0x%08" PRIx32 " len=0x%08" PRIx32 "\n", dest, (uint32_t)len);
Expand All @@ -647,6 +644,9 @@ static bool samx5x_user_page_write(target_flash_s *f, target_addr_t dest, const

for (uint32_t addr = 0; addr < SAMX5X_PAGE_SIZE; addr += 4) {
factory_mask = 0;
uint32_t current_word;
uint32_t value;
uint32_t factory_mask = 0U;

/* sample words from current page and new page content */
memcpy(&current_word, buffer + addr, 4);
Expand Down

0 comments on commit 3263fe0

Please sign in to comment.