diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-05-27 07:26:59 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-05-27 07:26:59 -0600 |
commit | bec3b36f727b4bccdf9900097ae8d76fb7faa1ab (patch) | |
tree | d437009bc570af3f132ee68cd68f002b2f76f4a2 /apps | |
parent | 168976579a7a81d31112283b23ff9fe7b7d25166 (diff) | |
download | px4-nuttx-bec3b36f727b4bccdf9900097ae8d76fb7faa1ab.tar.gz px4-nuttx-bec3b36f727b4bccdf9900097ae8d76fb7faa1ab.tar.bz2 px4-nuttx-bec3b36f727b4bccdf9900097ae8d76fb7faa1ab.zip |
Rename SLCD geometry tructure to attributes; Move MAX contrast to attributes. Add attribute and ioctl commands to get and set SLCD brightness
Diffstat (limited to 'apps')
-rw-r--r-- | apps/examples/slcd/slcd_main.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/apps/examples/slcd/slcd_main.c b/apps/examples/slcd/slcd_main.c index 604ac6c28..e7f0ff00f 100644 --- a/apps/examples/slcd/slcd_main.c +++ b/apps/examples/slcd/slcd_main.c @@ -71,11 +71,11 @@ struct slcd_test_s { - struct lib_outstream_s stream; /* Stream to use for all output */ - struct slcd_geometry_s geo; /* Size of the SLCD (rows x columns) */ - int fd; /* File descriptor or the open SLCD device */ - bool initialized; /* TRUE: Initialized */ - uint8_t currow; /* Next row to display */ + struct lib_outstream_s stream; /* Stream to use for all output */ + struct slcd_attributes_s attr; /* Size of the SLCD (rows x columns) */ + int fd; /* File descriptor or the open SLCD device */ + bool initialized; /* TRUE: Initialized */ + uint8_t currow; /* Next row to display */ /* The I/O buffer */ @@ -287,17 +287,17 @@ int slcd_main(int argc, char *argv[]) priv->stream.flush = slcd_flush; #endif - /* Get the geometry of the SCLD device */ + /* Get the attributes of the SCLD device */ - ret = ioctl(fd, SLCDIOC_GEOMETRY, (unsigned long)&priv->geo); + ret = ioctl(fd, SLCDIOC_GETATTRIBUTES, (unsigned long)&priv->attr); if (ret < 0) { - printf("ioctl(SLCDIOC_GEOMETRY) failed: %d\n", errno); + printf("ioctl(SLCDIOC_GETATTRIBUTES) failed: %d\n", errno); goto errout_with_fd; } printf("Geometry rows: %d columns: %d nbars: %d\n", - priv->geo.nrows, priv->geo.ncolumns, priv->geo.nbars); + priv->attr.nrows, priv->attr.ncolumns, priv->attr.nbars); /* Home the cursor and clear the display */ @@ -322,7 +322,7 @@ int slcd_main(int argc, char *argv[]) /* Increment to the next row, wrapping back to first if necessary. */ - if (++priv->currow >= priv->geo.nrows) + if (++priv->currow >= priv->attr.nrows) { priv->currow = 0; } |