Extentions SCLD test; SCLD CODEC and LCD1602 driver bug fixes

This commit is contained in:
Gregory Nutt
2013-05-26 09:28:57 -06:00
parent 3cbb22038a
commit 777e0c5da0
5 changed files with 50 additions and 15 deletions
+35 -1
View File
@@ -52,6 +52,21 @@
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose
* debug must also be enabled.
*/
#ifndef CONFIG_DEBUG
# undef CONFIG_DEBUG_VERBOSE
# undef CONFIG_DEBUG_LCD
#endif
#ifndef CONFIG_DEBUG_VERBOSE
# undef CONFIG_DEBUG_LCD
#endif
/* Indices, counts, helper macros ******************************************/
#define NDX_ESC 0
#define NDX_BRACKET 1
@@ -74,6 +89,16 @@
#define IS_CODE(a) (((a) >= CODE_MIN) && ((a) <= CODE_MAX))
#define CODE_RETURN(a) (enum slcdcode_e)((a) - 'A')
/* Debug ********************************************************************/
#ifdef CONFIG_DEBUG_LCD
# define lcddbg dbg
# define lcdvdbg vdbg
#else
# define lcddbg(x...)
# define lcdvdbg(x...)
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
@@ -239,6 +264,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
* return the following characters later.
*/
lcddbg("Parsing failed: ESC followed by %02x\n", ch);
return slcd_reget(state, pch, parg);
}
@@ -269,6 +295,8 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
if (code < (int)FIRST_SLCDCODE || code > (int)LAST_SLCDCODE)
{
lcddbg("Parsing failed: ESC-L followed by %02x\n", ch);
/* Not a special command code.. put the character in the reget
* buffer.
*/
@@ -310,6 +338,9 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
* following characters later.
*/
lcddbg("Parsing failed: ESC-L-%c followed by %02x\n",
state->buf[NDX_COUNTH], ch);
return slcd_reget(state, pch, parg);
}
@@ -342,7 +373,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
*/
code = CODE_RETURN(ch);
count = slcd_nibble(state->buf[NDX_COUNTH]) << 4;
count = slcd_nibble(state->buf[NDX_COUNTH]) << 4 |
slcd_nibble(state->buf[NDX_COUNTL]);
/* Verify the special CLCD action code */
@@ -353,6 +384,9 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
* of the characters later.
*/
lcddbg("Parsing failed: ESC-L-%c-%c followed by %02x, count=%d\n",
state->buf[NDX_COUNTH], state->buf[NDX_COUNTL], ch, count);
return slcd_reget(state, pch, parg);
}
}