[riot-notifications] [RIOT-OS/RIOT] tests/mtd_raw: add simple test for MTD (#15362)

Juergen Fitschen notifications at github.com
Tue Nov 3 22:08:41 CET 2020


@jue89 commented on this pull request.



> +    if (argc < 3) {
+        printf("usage: %s <dev> <sector> [count]\n", argv[0]);
+        return -1;
+    }

Just a very small improvement for UX: I'd move this check for all `cmd_*` methods above the `_get_dev()` call to make it easy for users to learn how the CLI is used.

Otherwise the CLI output looks something like this:
```
> help
help
Command              Description
---------------------------------------
info                 Print properties of the MTD device
power                Turn the MTD device on/off
read                 Read a region of memory on the MTD device
read_page            Read a region of memory on the MTD device (pagewise addressing)
write                Write a region of memory on the MTD device
write_page           Write a region of memory on the MTD device (pagewise addressing)
erase                Erase a region of memory on the MTD device
erase_sector         Erase a sector of memory on the MTD device
test                 Erase & write test data to the last two sectors
reboot               Reboot the node
version              Prints current RIOT_VERSION
pm                   interact with layered PM subsystem
> write
write
write: please specify the MTD device
> write 0
write 0
usage: write <dev> <addr> <data>
> write 0 0 hello
write 0 0 hello
> read
read
read: please specify the MTD device
> read 0
read 0
usage: read <dev> <addr> <len>
> read 0 0 5
read 0 0 5
00000000  68  61  6C  6C  6F
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15362#pullrequestreview-522875265
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201103/a797c458/attachment.htm>


More information about the notifications mailing list