From 6be0b0839beb799e6d8ca12c155783b1a1d7291a Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 27 Mar 2012 00:23:40 +0000 Subject: 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 --- nuttx/graphics/nxconsole/nxcon_register.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'nuttx/graphics/nxconsole/nxcon_register.c') 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); -- cgit v1.2.3