examples/mtdpart/mtdpart_main.c: Appease nxstyle
This commit is contained in:
parent
20b0ebfd08
commit
2aa2e0d897
@ -55,6 +55,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Configuration ************************************************************/
|
/* Configuration ************************************************************/
|
||||||
|
|
||||||
/* Make sure that support for MTD partitions is enabled */
|
/* Make sure that support for MTD partitions is enabled */
|
||||||
|
|
||||||
#ifndef CONFIG_MTD_PARTITION
|
#ifndef CONFIG_MTD_PARTITION
|
||||||
@ -75,7 +76,9 @@
|
|||||||
# error "CONFIG_RAMMTD is required without CONFIG_EXAMPLES_MTDPART_ARCHINIT"
|
# error "CONFIG_RAMMTD is required without CONFIG_EXAMPLES_MTDPART_ARCHINIT"
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* This must exactly match the default configuration in drivers/mtd/rammtd.c */
|
/* This must exactly match the default configuration in
|
||||||
|
* drivers/mtd/rammtd.c
|
||||||
|
*/
|
||||||
|
|
||||||
# ifndef CONFIG_RAMMTD_ERASESIZE
|
# ifndef CONFIG_RAMMTD_ERASESIZE
|
||||||
# define CONFIG_RAMMTD_ERASESIZE 4096
|
# define CONFIG_RAMMTD_ERASESIZE 4096
|
||||||
@ -114,6 +117,7 @@ struct mtdpart_filedesc_s
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Pre-allocated simulated flash */
|
/* Pre-allocated simulated flash */
|
||||||
|
|
||||||
#ifndef CONFIG_EXAMPLES_MTDPART_ARCHINIT
|
#ifndef CONFIG_EXAMPLES_MTDPART_ARCHINIT
|
||||||
@ -208,7 +212,8 @@ int main(int argc, FAR char *argv[])
|
|||||||
|
|
||||||
/* Get the geometry of the FLASH device */
|
/* Get the geometry of the FLASH device */
|
||||||
|
|
||||||
ret = master->ioctl(master, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&geo));
|
ret = master->ioctl(master, MTDIOC_GEOMETRY,
|
||||||
|
(unsigned long)((uintptr_t)&geo));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
ferr("ERROR: mtd->ioctl failed: %d\n", ret);
|
ferr("ERROR: mtd->ioctl failed: %d\n", ret);
|
||||||
@ -226,7 +231,8 @@ int main(int argc, FAR char *argv[])
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
blkpererase = geo.erasesize / geo.blocksize;
|
blkpererase = geo.erasesize / geo.blocksize;
|
||||||
nblocks = (geo.neraseblocks / CONFIG_EXAMPLES_MTDPART_NPARTITIONS) * blkpererase;
|
nblocks = (geo.neraseblocks / CONFIG_EXAMPLES_MTDPART_NPARTITIONS) *
|
||||||
|
blkpererase;
|
||||||
partsize = nblocks * geo.blocksize;
|
partsize = nblocks * geo.blocksize;
|
||||||
|
|
||||||
printf(" No. partitions: %u\n", CONFIG_EXAMPLES_MTDPART_NPARTITIONS);
|
printf(" No. partitions: %u\n", CONFIG_EXAMPLES_MTDPART_NPARTITIONS);
|
||||||
@ -254,7 +260,9 @@ int main(int argc, FAR char *argv[])
|
|||||||
exit(4);
|
exit(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize to provide an FTL block driver on the MTD FLASH interface */
|
/* Initialize to provide an FTL block driver on the MTD FLASH
|
||||||
|
* interface
|
||||||
|
*/
|
||||||
|
|
||||||
snprintf(blockname, 32, "/dev/mtdblock%d", i);
|
snprintf(blockname, 32, "/dev/mtdblock%d", i);
|
||||||
snprintf(charname, 32, "/dev/mtd%d", i);
|
snprintf(charname, 32, "/dev/mtd%d", i);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user