1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

mtd_flashpage: only depend on periph_flashpage

The features in flashpage_raw are now default in flashpage and do not
have to be included as a separate dependency
This commit is contained in:
Koen Zandberg 2020-11-09 16:45:35 +01:00
parent 1c063a74ea
commit 3aa5203bc5
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B
3 changed files with 9 additions and 8 deletions

View File

@ -1,2 +1,2 @@
FEATURES_REQUIRED += periph_flashpage
FEATURES_REQUIRED += periph_flashpage_raw
FEATURES_REQUIRED += periph_flashpage_pagewise

View File

@ -42,7 +42,7 @@ static int _read(mtd_dev_t *dev, void *buf, uint32_t addr, uint32_t size)
(void)dev;
if (addr % FLASHPAGE_RAW_ALIGNMENT) {
if (addr % FLASHPAGE_WRITE_BLOCK_ALIGNMENT) {
return -EINVAL;
}
@ -61,13 +61,13 @@ static int _write(mtd_dev_t *dev, const void *buf, uint32_t addr, uint32_t size)
{
(void)dev;
if (addr % FLASHPAGE_RAW_ALIGNMENT) {
if (addr % FLASHPAGE_WRITE_BLOCK_ALIGNMENT) {
return -EINVAL;
}
if ((uintptr_t)buf % FLASHPAGE_RAW_ALIGNMENT) {
if ((uintptr_t)buf % FLASHPAGE_WRITE_BLOCK_ALIGNMENT) {
return -EINVAL;
}
if (size % FLASHPAGE_RAW_BLOCKSIZE) {
if (size % FLASHPAGE_WRITE_BLOCK_SIZE) {
return -EOVERFLOW;
}
if (addr + size > MTD_FLASHPAGE_END_ADDR) {
@ -80,7 +80,7 @@ static int _write(mtd_dev_t *dev, const void *buf, uint32_t addr, uint32_t size)
uint32_t dst_addr = addr;
#endif
flashpage_write_raw((void *)dst_addr, buf, size);
flashpage_write((void *)dst_addr, buf, size);
return 0;
}
@ -106,7 +106,7 @@ int _erase(mtd_dev_t *dev, uint32_t addr, uint32_t size)
#endif
for (size_t i = 0; i < size; i += sector_size) {
flashpage_write(flashpage_page((void *)(dst_addr + i)), NULL);
flashpage_erase(flashpage_page((void *)(dst_addr + i)));
}
return 0;

View File

@ -122,7 +122,8 @@ static void test_mtd_write_erase(void)
static void test_mtd_write_read(void)
{
const char buf[] __attribute__ ((aligned (FLASHPAGE_RAW_ALIGNMENT))) = "ABCDEFGHIJKLMNO";
const char buf[] __attribute__ ((aligned (FLASHPAGE_WRITE_BLOCK_ALIGNMENT)))
= "ABCDEFGHIJKLMNO";
/* stm32l0x and stm32l1x erase its flash with 0's */
#if defined(CPU_FAM_STM32L0) || defined(CPU_FAM_STM32L1)