Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 234947d

Browse files
committed
mspm0: Remove assert
* Both conditions are true due to all calls in target_flash.c being `flash->write(..., flash->writesize)` or `flash->erase(..., flash->blocksize)`
1 parent ab82812 commit 234947d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/target/mspm0.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "buffer_utils.h"
2424
#include "jep106.h"
2525
#include "cortex.h"
26-
#include <assert.h>
2726

2827
#define MSPM0_CONFIG_FLASH_DUMP_SUPPORT (CONFIG_BMDA == 1 || ENABLE_DEBUG == 1)
2928

@@ -292,8 +291,9 @@ static void mspm0_flash_unprotect_sector(target_flash_s *const target_flash, con
292291

293292
static bool mspm0_flash_erase(target_flash_s *const target_flash, const target_addr_t addr, const size_t length)
294293
{
294+
#ifdef DEBUG_TARGET_IS_NOOP
295295
(void)length;
296-
assert(length == target_flash->blocksize);
296+
#endif
297297

298298
target_s *const target = target_flash->t;
299299

@@ -318,8 +318,9 @@ static bool mspm0_flash_erase(target_flash_s *const target_flash, const target_a
318318
static bool mspm0_flash_write(
319319
target_flash_s *const target_flash, target_addr_t dest, const void *const src, const size_t length)
320320
{
321+
#ifdef DEBUG_TARGET_IS_NOOP
321322
(void)length;
322-
assert(length == target_flash->writesize);
323+
#endif
323324

324325
target_s *const target = target_flash->t;
325326

0 commit comments

Comments
 (0)