From cdd9f303cfaf065cd06bc41fc15b7c660a0bb8da Mon Sep 17 00:00:00 2001 From: Ollrogge Date: Tue, 19 Oct 2021 09:40:21 +0200 Subject: [PATCH] cpu/native: extend flashpage API --- cpu/native/periph/flashpage.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cpu/native/periph/flashpage.c b/cpu/native/periph/flashpage.c index 1c5b879ea0..87bca15699 100644 --- a/cpu/native/periph/flashpage.c +++ b/cpu/native/periph/flashpage.c @@ -61,3 +61,13 @@ void flashpage_write(void *target_addr, const void *data, size_t len) _flash_write(target_addr, data, len); } + +unsigned flashpage_first_free(void) +{ + return flashpage_page(&_native_flash[0]); +} + +unsigned flashpage_last_free(void) +{ + return flashpage_page(&_native_flash[FLASHPAGE_SIZE * FLASHPAGE_NUMOF - 1]); +}