summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-09-25 10:41:47 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-09-25 10:41:47 -0600
commite5b660c8703aeb38b313f50c3218e64090793d21 (patch)
tree2d026962189e3d3862919af1b973fa310e81e669
parent4b2f435c8e191e11b496cf3162261edf6ec8c2f2 (diff)
downloadpx4-nuttx-e5b660c8703aeb38b313f50c3218e64090793d21.tar.gz
px4-nuttx-e5b660c8703aeb38b313f50c3218e64090793d21.tar.bz2
px4-nuttx-e5b660c8703aeb38b313f50c3218e64090793d21.zip
A few fixes for clean apps/examples/mtdrwb build
-rw-r--r--apps/examples/Make.defs4
-rw-r--r--apps/examples/mtdrwb/mtdrwb_main.c6
-rw-r--r--nuttx/drivers/mtd/mtd_rwbuffer.c2
3 files changed, 11 insertions, 1 deletions
diff --git a/apps/examples/Make.defs b/apps/examples/Make.defs
index 9e7c6d5b5..8a09a1ee1 100644
--- a/apps/examples/Make.defs
+++ b/apps/examples/Make.defs
@@ -130,6 +130,10 @@ ifeq ($(CONFIG_EXAMPLES_MTDPART),y)
CONFIGURED_APPS += examples/mtdpart
endif
+ifeq ($(CONFIG_EXAMPLES_MTDRWB),y)
+CONFIGURED_APPS += examples/mtdrwb
+endif
+
ifeq ($(CONFIG_EXAMPLES_NETPKT),y)
CONFIGURED_APPS += examples/netpkt
endif
diff --git a/apps/examples/mtdrwb/mtdrwb_main.c b/apps/examples/mtdrwb/mtdrwb_main.c
index 73b097303..2a71c05db 100644
--- a/apps/examples/mtdrwb/mtdrwb_main.c
+++ b/apps/examples/mtdrwb/mtdrwb_main.c
@@ -240,6 +240,12 @@ int mtdrwb_main(int argc, char *argv[])
message(" erasesize: %lu\n", (unsigned long)geo.erasesize);
message(" neraseblocks: %lu\n", (unsigned long)geo.neraseblocks);
+ blkpererase = geo.erasesize / geo.blocksize;
+ message(" blkpererase: %u\n", blkpererase);
+
+ nblocks = geo.neraseblocks * blkpererase;
+ message(" nblocks: %lu\n", (unsigned long)nblocks);
+
/* Allocate a buffer */
buffer = (FAR uint32_t *)malloc(geo.blocksize);
diff --git a/nuttx/drivers/mtd/mtd_rwbuffer.c b/nuttx/drivers/mtd/mtd_rwbuffer.c
index f97c00a71..0cb3701af 100644
--- a/nuttx/drivers/mtd/mtd_rwbuffer.c
+++ b/nuttx/drivers/mtd/mtd_rwbuffer.c
@@ -376,7 +376,7 @@ FAR struct mtd_dev_s *mtd_rwb_initialize(FAR struct mtd_dev_s *mtd)
*/
priv->spb = geo.erasesize / geo.blocksize;
- DEBUGASSERT((size_t)priv->spb * geo_blocksize = geo.erasesize);
+ DEBUGASSERT((size_t)priv->spb * geo.blocksize == geo.erasesize);
/* Values must be provided to rwb_initialize() */
/* Supported geometry */