From 554d4df527c830038562c975e690f9f7d4038be2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 24 May 2013 12:00:15 -0600 Subject: Additional bug fixes and minor extensions to the STM32L-Disovery segment LCD support and to the apps/examples/slcd segment LCD test. --- apps/examples/slcd/slcd_main.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'apps/examples/slcd/slcd_main.c') diff --git a/apps/examples/slcd/slcd_main.c b/apps/examples/slcd/slcd_main.c index 1d93993fb..a5fb12d9f 100644 --- a/apps/examples/slcd/slcd_main.c +++ b/apps/examples/slcd/slcd_main.c @@ -243,8 +243,20 @@ static void slcd_puts(FAR struct lib_outstream_s *outstream, int slcd_main(int argc, char *argv[]) { FAR struct slcd_test_s *priv = &g_slcdtest; + FAR const char *str = g_slcdhello; int ret; + /* Parse the command line. For now, only a single optional string argument + * is supported. + */ + +#if defined(CONFIG_NSH_BUILTIN_APPS) + if (argc > 1) + { + str = argv[1]; + } +#endif + /* Initialize the output stream */ memset(priv, 0, sizeof(struct slcd_test_s)); @@ -273,8 +285,8 @@ int slcd_main(int argc, char *argv[]) goto errout_with_fd; } - printf("Geometry rows: %d columns: %d\n", - priv->geo.nrows, priv->geo.ncolumns); + printf("Geometry rows: %d columns: %d nbars: %d\n", + priv->geo.nrows, priv->geo.ncolumns, priv->geo.nbars); /* Home the cursor and clear the display */ @@ -283,8 +295,8 @@ int slcd_main(int argc, char *argv[]) /* Say hello */ - printf("Print [%s]\n", g_slcdhello); - slcd_puts(&priv->stream, g_slcdhello); + printf("Print [%s]\n", str); + slcd_puts(&priv->stream, str); slcd_flush(&priv->stream); /* Normal exit */ -- cgit v1.2.3