mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #16781 from benpicco/flashpage_page-const
drivers/flashpage: flashpage_page() takes a const argument
This commit is contained in:
commit
9294a31856
@ -329,7 +329,7 @@ size_t flashpage_size(unsigned page)
|
||||
}
|
||||
}
|
||||
|
||||
unsigned flashpage_page(void *addr)
|
||||
unsigned flashpage_page(const void *addr)
|
||||
{
|
||||
/* Calculates the flashpage number based on the address for the
|
||||
* non-homogeneous flashpage stm32 series.
|
||||
|
@ -190,7 +190,7 @@ static inline void *flashpage_addr(unsigned page)
|
||||
*
|
||||
* @return page containing the given address
|
||||
*/
|
||||
static inline unsigned flashpage_page(void *addr)
|
||||
static inline unsigned flashpage_page(const void *addr)
|
||||
{
|
||||
return (((intptr_t)addr - CPU_FLASH_BASE) / FLASHPAGE_SIZE);
|
||||
}
|
||||
@ -200,7 +200,7 @@ static inline unsigned flashpage_page(void *addr)
|
||||
/* Bare prototypes for the above functions. See above for the documentation */
|
||||
size_t flashpage_size(unsigned page);
|
||||
void *flashpage_addr(unsigned page);
|
||||
unsigned flashpage_page(void *addr);
|
||||
unsigned flashpage_page(const void *addr);
|
||||
|
||||
#endif
|
||||
|
||||
@ -319,7 +319,7 @@ static inline void *flashpage_rwwee_addr(unsigned page)
|
||||
*
|
||||
* @return RWWEE page containing the given address
|
||||
*/
|
||||
static inline int flashpage_rwwee_page(void *addr)
|
||||
static inline int flashpage_rwwee_page(const void *addr)
|
||||
{
|
||||
return (int)(((int)addr - CPU_FLASH_RWWEE_BASE) / FLASHPAGE_SIZE);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ void *flashpage_addr(unsigned page)
|
||||
#endif /* PERIPH_FLASHPAGE_NEEDS_FLASHPAGE_ADDR */
|
||||
|
||||
#ifdef PERIPH_FLASHPAGE_NEEDS_FLASHPAGE_PAGE
|
||||
unsigned flashpage_page(void *addr)
|
||||
unsigned flashpage_page(const void *addr)
|
||||
{
|
||||
unsigned page = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user