summaryrefslogtreecommitdiff
path: root/nuttx/graphics
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-10-06 16:31:13 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-10-06 16:31:13 +0000
commit25130d72c303524ed50e54fddbdf0bd1096f4149 (patch)
tree85d225a0e7776640d85a168d9e1213edda0261d2 /nuttx/graphics
parentcd87146d9b80c85ad070dec888635c2ea6af0a9c (diff)
downloadpx4-nuttx-25130d72c303524ed50e54fddbdf0bd1096f4149.tar.gz
px4-nuttx-25130d72c303524ed50e54fddbdf0bd1096f4149.tar.bz2
px4-nuttx-25130d72c303524ed50e54fddbdf0bd1096f4149.zip
Add sim/nsh2 configuration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4026 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/graphics')
-rw-r--r--nuttx/graphics/nxbe/nxbe_colormap.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/nuttx/graphics/nxbe/nxbe_colormap.c b/nuttx/graphics/nxbe/nxbe_colormap.c
index f38c0d6ca..144317519 100644
--- a/nuttx/graphics/nxbe/nxbe_colormap.c
+++ b/nuttx/graphics/nxbe/nxbe_colormap.c
@@ -94,9 +94,12 @@ int nxbe_colormap(FAR NX_DRIVERTYPE *dev)
int ret;
int i, j, k;
- /* Allocate the color map tables */
+ /* Allocate the color map tables in one allocation:
+ *
+ * size = 3 colors x CONFIG_NX_COLORS each x 8-bits per color
+ */
- size = 3 * CONFIG_NX_NCOLORS * sizeof(uint16_t);
+ size = 3 * CONFIG_NX_NCOLORS * sizeof(uint8_t);
alloc = (uint8_t*)malloc(size);
if (alloc == NULL)
{
@@ -104,12 +107,14 @@ int nxbe_colormap(FAR NX_DRIVERTYPE *dev)
}
memset(alloc, 0xff, size);
+ /* Then get pointers to each color table */
+
red = alloc;
green = &alloc[CONFIG_NX_NCOLORS];
blue = &alloc[2*CONFIG_NX_NCOLORS];
/* Initialize the color map tables. 6*6*6 = 216, the rest
- * are (0xffff, 0xffff, 0xffff)
+ * are (0xff, 0xfff 0xff)
*/
ndx = 0;
@@ -131,6 +136,7 @@ int nxbe_colormap(FAR NX_DRIVERTYPE *dev)
/* Now configure the cmap structure */
+ cmap.first = 0;
cmap.len = CONFIG_NX_NCOLORS;
cmap.red = red;
cmap.green = green;