mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 10:31:37 +08:00
mtd: fixed creation and erase of a single partition
This commit is contained in:
committed by
Lorenz Meier
parent
f3cd83e804
commit
778cbcb5cc
@@ -108,9 +108,8 @@ int mtd_main(int argc, char *argv[])
|
|||||||
if (!strcmp(argv[1], "start")) {
|
if (!strcmp(argv[1], "start")) {
|
||||||
|
|
||||||
/* start mapping according to user request */
|
/* start mapping according to user request */
|
||||||
if (argc > 3) {
|
if (argc >= 3) {
|
||||||
mtd_start(argv + 2, argc - 2);
|
mtd_start(argv + 2, argc - 2);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
mtd_start(partition_names_default, n_partitions_default);
|
mtd_start(partition_names_default, n_partitions_default);
|
||||||
}
|
}
|
||||||
@@ -123,10 +122,11 @@ int mtd_main(int argc, char *argv[])
|
|||||||
mtd_status();
|
mtd_status();
|
||||||
|
|
||||||
if (!strcmp(argv[1], "erase")) {
|
if (!strcmp(argv[1], "erase")) {
|
||||||
if (argc < 3) {
|
if (argc >= 3) {
|
||||||
errx(1, "usage: mtd erase <PARTITION_PATH..>");
|
mtd_erase(argv + 2, argc - 2);
|
||||||
|
} else {
|
||||||
|
mtd_erase(partition_names_default, n_partitions_default);
|
||||||
}
|
}
|
||||||
mtd_erase(argv + 2, argc - 2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user