summaryrefslogtreecommitdiff
path: root/nuttx/graphics/nxconsole/nxcon_register.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-03-27 00:23:40 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-03-27 00:23:40 +0000
commit6be0b0839beb799e6d8ca12c155783b1a1d7291a (patch)
treee602c744e9a2819717430ec6ee2141acafca7779 /nuttx/graphics/nxconsole/nxcon_register.c
parentd7eb0482722b4e001035feaef84327cc1ca822ad (diff)
downloadpx4-nuttx-6be0b0839beb799e6d8ca12c155783b1a1d7291a.tar.gz
px4-nuttx-6be0b0839beb799e6d8ca12c155783b1a1d7291a.tar.bz2
px4-nuttx-6be0b0839beb799e6d8ca12c155783b1a1d7291a.zip
NFS update + another NX console driver file
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4525 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/graphics/nxconsole/nxcon_register.c')
-rw-r--r--nuttx/graphics/nxconsole/nxcon_register.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/nuttx/graphics/nxconsole/nxcon_register.c b/nuttx/graphics/nxconsole/nxcon_register.c
index d85b5ffc3..7fd9310c8 100644
--- a/nuttx/graphics/nxconsole/nxcon_register.c
+++ b/nuttx/graphics/nxconsole/nxcon_register.c
@@ -98,6 +98,8 @@ FAR struct nxcon_state_s *
priv->minor = minor;
memcpy(&priv->wndo, wndo, sizeof( struct nxcon_window_s));
+ sem_init(&priv->exclsem, 0, 1);
+
/* Select the font */
priv->font = nxf_getfonthandle(wndo->fontid);
@@ -107,10 +109,32 @@ FAR struct nxcon_state_s *
goto errout;
}
+ FAR const struct nx_font_s *fontset;
+
+ /* Get information about the font set being used and save this in the
+ * state structure
+ */
+
+ fontset = nxf_getfontset(priv->font);
+ priv->fheight = fontset->mxheight;
+ priv->fwidth = fontset->mxwidth;
+ priv->spwidth = fontset->spwidth;
+
+ /* Set up the text caches */
+
+#ifdef CONFIG_NXCONSOLE_FONTCACHE
+ priv->maxchars = CONFIG_NXCONSOLE_BMCACHE;
+ priv->maxglyphs = CONFIG_NXCONSOLE_GLCACHE;
+#endif
+
+ /* Set the initial display position */
+
+ nxcon_home(priv);
+
/* Register the driver */
snprintf(devname, NX_DEVNAME_SIZE, NX_DEVNAME_FORMAT, minor);
- ret = register_driver(devname, &g_nxcondrvrops, 0666, priv);
+ ret = register_driver(devname, &g_nxcon_drvrops, 0666, priv);
if (ret < 0)
{
gdbg("Failed to register %s\n", devname);