Skip to content

Commit

Permalink
For the hal_flash API's make the change to uintptr_t to support 64-bi…
Browse files Browse the repository at this point in the history
…t explicit using `ARCH_64BIT` or known 64-bit architectures.
  • Loading branch information
dgarske committed Aug 4, 2023
1 parent c3056c8 commit 77ba9cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions hal/nxp_t2080.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ void hal_init(void)
#endif
}

int hal_flash_write(uintptr_t address, const uint8_t *data, int len)
int hal_flash_write(uint32_t address, const uint8_t *data, int len)
{
(void)address;
(void)data;
Expand All @@ -541,7 +541,7 @@ int hal_flash_write(uintptr_t address, const uint8_t *data, int len)
return 0;
}

int hal_flash_erase(uintptr_t address, int len)
int hal_flash_erase(uint32_t address, int len)
{
(void)address;
(void)len;
Expand Down
13 changes: 8 additions & 5 deletions include/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ void hal_deinit();
#endif

void hal_init(void);
#if !defined(FORCE_32BIT) && INTPTR_MAX == INT64_MAX /* 64-bit platform */
int hal_flash_write(uintptr_t address, const uint8_t *data, int len);
int hal_flash_erase(uintptr_t address, int len);
#if defined(ARCH_64BIT) || \
defined(ARCH_x86_64) || defined(ARCH_AARCH64) || defined(ARCH_SIM)
/* 64-bit platforms */
int hal_flash_write(uintptr_t address, const uint8_t *data, int len);
int hal_flash_erase(uintptr_t address, int len);
#else
int hal_flash_write(uint32_t address, const uint8_t *data, int len);
int hal_flash_erase(uint32_t address, int len);
/* original 32-bit */
int hal_flash_write(uint32_t address, const uint8_t *data, int len);
int hal_flash_erase(uint32_t address, int len);
#endif
void hal_flash_unlock(void);
void hal_flash_lock(void);
Expand Down

0 comments on commit 77ba9cf

Please sign in to comment.