summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-04-20 17:29:10 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-04-20 17:29:10 -0600
commita8e43d6e4dfc6f2ae1da21776cf770c095dd282b (patch)
tree64cadbf132e22ed1f9737269ebf3dc655ca75653
parent60e400c82f6bf3479b0b2c36f3579c656f686ed0 (diff)
downloadnuttx-a8e43d6e4dfc6f2ae1da21776cf770c095dd282b.tar.gz
nuttx-a8e43d6e4dfc6f2ae1da21776cf770c095dd282b.tar.bz2
nuttx-a8e43d6e4dfc6f2ae1da21776cf770c095dd282b.zip
Yet more kconfg2html logic
-rw-r--r--nuttx/drivers/input/Kconfig2
-rw-r--r--nuttx/drivers/lcd/Kconfig20
-rw-r--r--nuttx/tools/kconfig2html.c65
3 files changed, 73 insertions, 14 deletions
diff --git a/nuttx/drivers/input/Kconfig b/nuttx/drivers/input/Kconfig
index aafb5007b..b57aab8a8 100644
--- a/nuttx/drivers/input/Kconfig
+++ b/nuttx/drivers/input/Kconfig
@@ -74,7 +74,7 @@ config ADS7843E_DEVMINOR
config ADS7843E_SPIMODE
int "SPI mode"
default 0
- range 0,3
+ range 0 3
---help---
Controls the SPI mode. The device should work in mode 0, but
sometimes you need to experiment.
diff --git a/nuttx/drivers/lcd/Kconfig b/nuttx/drivers/lcd/Kconfig
index 38c490deb..1dbee5113 100644
--- a/nuttx/drivers/lcd/Kconfig
+++ b/nuttx/drivers/lcd/Kconfig
@@ -48,7 +48,7 @@ if LCD_P14201
config P14201_NINTERFACES
int "Number of physical P14201 devices"
default 1
- range 1,1
+ range 1 1
---help---
Specifies the number of physical P14201
devices that will be supported.
@@ -56,7 +56,7 @@ config P14201_NINTERFACES
config P14201_SPIMODE
int "SPI mode"
default 2
- range 0,3
+ range 0 3
---help---
Controls the SPI mode
@@ -93,7 +93,7 @@ if LCD_NOKIA6100
config NOKIA6100_NINTERFACES
int "Number of physical NOKIA6100 devices"
default 1
- range 1,1
+ range 1 1
---help---
Specifies the number of physical Nokia
6100 devices that will be supported.
@@ -115,7 +115,7 @@ endchoice
config NOKIA6100_SPIMODE
int "SPI mode"
default 0
- range 0,3
+ range 0 3
---help---
Controls the SPI mode
@@ -141,42 +141,42 @@ config NOKIA6100_BPP
config NOKIA6100_INVERT
int "Display inversion"
default 1
- range 0,1
+ range 0 1
---help---
Display inversion, 0 or 1, Default: 1
config NOKIA6100_MY
int "Display row direction"
default 0
- range 0,1
+ range 0 1
---help---
Display row direction, 0 or 1, Default: 0
config NOKIA6100_MX
int "Display column direction"
default 1
- range 0,1
+ range 0 1
---help---
Display column direction, 0 or 1, Default: 1
config NOKIA6100_V
int "Display address direction"
default 0
- range 0,1
+ range 0 1
---help---
Display address direction, 0 or 1, Default: 0
config NOKIA6100_ML
int "Display scan direction"
default 0
- range 0,1
+ range 0 1
---help---
Display scan direction, 0 or 1, Default: 0
config NOKIA6100_RGBORD
int "Display RGB order"
default 0
- range 0,1
+ range 0 1
---help---
Display RGB order, 0 or 1, Default: 0
Required LCD driver settings:
diff --git a/nuttx/tools/kconfig2html.c b/nuttx/tools/kconfig2html.c
index 539e44ffe..532522c16 100644
--- a/nuttx/tools/kconfig2html.c
+++ b/nuttx/tools/kconfig2html.c
@@ -77,6 +77,7 @@ enum token_type_e
TOKEN_HEX,
TOKEN_STRING,
TOKEN_DEFAULT,
+ TOKEN_RANGE,
TOKEN_SELECT,
TOKEN_DEPENDS,
TOKEN_ON,
@@ -138,6 +139,8 @@ struct config_s
char *cname;
char *cdesc;
char *cdefault;
+ char *clower;
+ char *cupper;
char *cselect[MAX_SELECT];
int cnselect;
int cndependencies;
@@ -188,6 +191,7 @@ static struct reserved_s g_reserved[] =
{TOKEN_HEX, "hex"},
{TOKEN_STRING, "string"},
{TOKEN_DEFAULT, "default"},
+ {TOKEN_RANGE, "range"},
{TOKEN_SELECT, "select"},
{TOKEN_DEPENDS, "depends"},
{TOKEN_ON, "on"},
@@ -1006,6 +1010,24 @@ static inline char *process_config(FILE *stream, const char *configname,
}
break;
+ case TOKEN_RANGE:
+ {
+ char *value = strtok_r(NULL, " ,", &g_lasts);
+ if (value)
+ {
+ config.clower = strdup(value);
+
+ value = strtok_r(NULL, " ", &g_lasts);
+ if (value)
+ {
+ config.cupper = strdup(value);
+ }
+ }
+
+ token = NULL;
+ }
+ break;
+
case TOKEN_SELECT:
{
char *value;
@@ -1129,6 +1151,26 @@ static inline char *process_config(FILE *stream, const char *configname,
body(" <li><i>Default</i>: %s</li>\n", config.cdefault);
}
+ /* Print the range of values of the configuration variable */
+
+ if (config.clower || config.cupper)
+ {
+ body(" <li><i>Range</i>:\n");
+ if (config.clower)
+ {
+ body(" %s", config.clower);
+ }
+
+ body(" -", config.clower);
+
+ if (config.cupper)
+ {
+ body(" %s", config.cupper);
+ }
+
+ body("</li>\n");
+ }
+
/* Print the default value of the configuration variable auto-selected by this setting */
if (config.cnselect > 0)
@@ -1204,6 +1246,16 @@ static inline char *process_config(FILE *stream, const char *configname,
free(config.cdefault);
}
+ if (config.clower)
+ {
+ free(config.clower);
+ }
+
+ if (config.cupper)
+ {
+ free(config.cupper);
+ }
+
if (config.cnselect > 0)
{
for (i = 0; i < config.cnselect; i++)
@@ -1473,13 +1525,13 @@ static inline char *process_menu(FILE *stream, const char *kconfigdir)
/* Output menu information */
paranum = get_paranum();
- if (menuname)
+ if (menu.mname)
{
output("<li><a href=\"#menu_%d\">%s Menu: %s</a></li>\n",
- g_menu_number, paranum, menuname);
+ g_menu_number, paranum, menu.mname);
output("<ul>\n");
body("\n<h1><a name=\"menu_%d\">%s Menu: %s</a></h1>\n",
- g_menu_number, paranum, menuname);
+ g_menu_number, paranum, menu.mname);
}
else
{
@@ -1514,6 +1566,13 @@ static inline char *process_menu(FILE *stream, const char *kconfigdir)
pop_dependency();
}
+ /* Free any allocated memory */
+
+ if (menu.mname)
+ {
+ free(menu.mname);
+ }
+
/* Increment the nesting level */
incr_level();