[riot-notifications] [RIOT-OS/RIOT] mtd: Change API to return 0 on success (#13896)
notifications at github.com
Sat May 9 17:14:04 CEST 2020
> If a single write transaction goes beyond the current page, it will wrap around instead of writing to the next page.
Ah, yes. So there is actually no real hardware that can do random access read/writes anyway (except for the one emulated by `native`).
It would still be nice for hardware that can only do page-wise operations (e.g. not starting a read / write with given offset) to not lot the driver manage random access within the page. Instead, implementing random access on top once for all drivers in [`mtd.c`](https://github.com/RIOT-OS/RIOT/blob/master/drivers/mtd/mtd.c) could safe a lot of code duplication.
Maybe random access within a page could just be assumed to be supported unless a certian submodule of `mtd` is used. Drivers not supporting random access within a page have to depend on that submodule. That way code taking care of turning an `write(offset = 42, data = foo, size = bar)` into an `write(offset = 0, data = read(offset = 0, size = 42) + foo, size = 42 + bar)` would only be compiled if at least on driver needs this. And in addition it seems to make sense to have a flag in case both types of hardware is used, so that the work around is only used when really needed.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications