mirror of
https://github.com/apache/nuttx.git
synced 2026-09-27 18:58:27 +08:00
Extentions SCLD test; SCLD CODEC and LCD1602 driver bug fixes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user