The SLCD driver is now fully functional for Sure PIC32MX board
This commit is contained in:
parent
819e151ef5
commit
2dae842445
@ -85,7 +85,7 @@
|
|||||||
* apps/examples/usbstorage: Can now be built as two NSH "built-in" commands:
|
* apps/examples/usbstorage: Can now be built as two NSH "built-in" commands:
|
||||||
'msconn' will connect the USB mass storage device; 'msdis' will disconnect
|
'msconn' will connect the USB mass storage device; 'msdis' will disconnect
|
||||||
the USB storage device.
|
the USB storage device.
|
||||||
* apps/examples/nx*: All NX header files moved from nuttx/include/nuttx to
|
* apps/examples/nx*: All NX header files moved from nuttx/include/nuttx to
|
||||||
nuttx/include/nuttx/nx.
|
nuttx/include/nuttx/nx.
|
||||||
* apps/examples/usbstorage: Added instrumentation to monitor memory usage
|
* apps/examples/usbstorage: Added instrumentation to monitor memory usage
|
||||||
to check for memory leaks in the USB storage driver.
|
to check for memory leaks in the USB storage driver.
|
||||||
@ -116,7 +116,7 @@
|
|||||||
* apps/examples/lcdrw: Add a test to verify if you can or can or read
|
* apps/examples/lcdrw: Add a test to verify if you can or can or read
|
||||||
data from an LCD correctly.
|
data from an LCD correctly.
|
||||||
* apps/examples/usbterm: A USB terminal example.. more of a USB chat or
|
* apps/examples/usbterm: A USB terminal example.. more of a USB chat or
|
||||||
serial bridge: Data received on local console echoed via USB serial;
|
serial bridge: Data received on local console echoed via USB serial;
|
||||||
data received on USB serial is echoed on the local console.
|
data received on USB serial is echoed on the local console.
|
||||||
* apps/examples/touchscreen: Add a simple, generic test for any
|
* apps/examples/touchscreen: Add a simple, generic test for any
|
||||||
touschscreen driver.
|
touschscreen driver.
|
||||||
@ -301,7 +301,7 @@
|
|||||||
moved from apps/netutils/webserver/makefsdata to nuttx/tools/mkfsdata.pl
|
moved from apps/netutils/webserver/makefsdata to nuttx/tools/mkfsdata.pl
|
||||||
(Part of a larger change submitted by Max Holtzberg).
|
(Part of a larger change submitted by Max Holtzberg).
|
||||||
* apps/netutils/webserver, apps/examples/uip, and apps/include/netutils/httpd.h:
|
* apps/netutils/webserver, apps/examples/uip, and apps/include/netutils/httpd.h:
|
||||||
The "canned" version of the uIP web servers content that was at
|
The "canned" version of the uIP web servers content that was at
|
||||||
netutils/webserver/httpd_fsdata.c has been replaced with a dynamically
|
netutils/webserver/httpd_fsdata.c has been replaced with a dynamically
|
||||||
built configuration located at apps/examples/uip (Contributed by
|
built configuration located at apps/examples/uip (Contributed by
|
||||||
Max Holtzberg).
|
Max Holtzberg).
|
||||||
@ -564,3 +564,5 @@
|
|||||||
segment LCDs (2013-5-24).
|
segment LCDs (2013-5-24).
|
||||||
* apps/examples/slcd: Extend SLCD test to handle multi-line displays
|
* apps/examples/slcd: Extend SLCD test to handle multi-line displays
|
||||||
(2013-5-26).
|
(2013-5-26).
|
||||||
|
* apps/examples/slcd: This test now sets the SLCD brightness level to
|
||||||
|
the mid-point as part of its initialization (2013-5-27).
|
||||||
|
@ -279,6 +279,8 @@ int slcd_main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (!priv->initialized)
|
if (!priv->initialized)
|
||||||
{
|
{
|
||||||
|
unsigned long brightness;
|
||||||
|
|
||||||
/* Initialize the output stream */
|
/* Initialize the output stream */
|
||||||
|
|
||||||
memset(priv, 0, sizeof(struct slcd_test_s));
|
memset(priv, 0, sizeof(struct slcd_test_s));
|
||||||
@ -296,8 +298,11 @@ int slcd_main(int argc, char *argv[])
|
|||||||
goto errout_with_fd;
|
goto errout_with_fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Geometry rows: %d columns: %d nbars: %d\n",
|
printf("Attributes:\n");
|
||||||
|
printf(" rows: %d columns: %d nbars: %d\n",
|
||||||
priv->attr.nrows, priv->attr.ncolumns, priv->attr.nbars);
|
priv->attr.nrows, priv->attr.ncolumns, priv->attr.nbars);
|
||||||
|
printf(" max contrast: %d max brightness: %d\n",
|
||||||
|
priv->attr.maxcontrast, priv->attr.maxbrightness);
|
||||||
|
|
||||||
/* Home the cursor and clear the display */
|
/* Home the cursor and clear the display */
|
||||||
|
|
||||||
@ -305,6 +310,21 @@ int slcd_main(int argc, char *argv[])
|
|||||||
slcd_encode(SLCDCODE_CLEAR, 0, &priv->stream);
|
slcd_encode(SLCDCODE_CLEAR, 0, &priv->stream);
|
||||||
slcd_flush(&priv->stream);
|
slcd_flush(&priv->stream);
|
||||||
|
|
||||||
|
/* Set the brightness to the mid value */
|
||||||
|
|
||||||
|
brightness = ((unsigned long)priv->attr.maxbrightness + 1) >> 1;
|
||||||
|
printf("Set brightness to %ld\n", brightness);
|
||||||
|
|
||||||
|
ret = ioctl(fd, SLCDIOC_SETBRIGHTNESS, brightness);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
/* Report the ioctl failure, but do not error out. Some SLCDs
|
||||||
|
* do not support brightness settings.
|
||||||
|
*/
|
||||||
|
|
||||||
|
printf("ioctl(SLCDIOC_GETATTRIBUTES) failed: %d\n", errno);
|
||||||
|
}
|
||||||
|
|
||||||
priv->initialized = true;
|
priv->initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user