mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/stm32: flashpage: use common helper functions
This commit is contained in:
parent
917cf85225
commit
49585fc517
@ -130,6 +130,7 @@ extern "C" {
|
||||
#if defined(CPU_FAM_STM32F2) || defined(CPU_FAM_STM32F4) || \
|
||||
defined(CPU_FAM_STM32F7)
|
||||
#define PERIPH_FLASHPAGE_CUSTOM_PAGESIZES
|
||||
#define PERIPH_FLASHPAGE_NEEDS_FLASHPAGE_ADDR
|
||||
|
||||
/**
|
||||
* @brief stm32 dual bank configuration
|
||||
|
@ -328,16 +328,6 @@ size_t flashpage_size(unsigned page)
|
||||
}
|
||||
}
|
||||
|
||||
void *flashpage_addr(unsigned page)
|
||||
{
|
||||
uintptr_t addr = CPU_FLASH_BASE;
|
||||
while (page) {
|
||||
addr += flashpage_size(--page);
|
||||
}
|
||||
|
||||
return (void*)addr;
|
||||
}
|
||||
|
||||
unsigned flashpage_page(void *addr)
|
||||
{
|
||||
/* Calculates the flashpage number based on the address for the
|
||||
|
Loading…
Reference in New Issue
Block a user