diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-05-26 09:28:57 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-05-26 09:28:57 -0600 |
commit | 5e23e42a0d5f7256bb284bdd8ffbe7b52eef0cef (patch) | |
tree | a3c05dfc1cb9ece8d2559fdef6c029380f851153 /nuttx/configs/pcblogic-pic32mx/src | |
parent | f7102cb478678502cd7b6a3ff60e27025f52281e (diff) | |
download | px4-nuttx-5e23e42a0d5f7256bb284bdd8ffbe7b52eef0cef.tar.gz px4-nuttx-5e23e42a0d5f7256bb284bdd8ffbe7b52eef0cef.tar.bz2 px4-nuttx-5e23e42a0d5f7256bb284bdd8ffbe7b52eef0cef.zip |
Extentions SCLD test; SCLD CODEC and LCD1602 driver bug fixes
Diffstat (limited to 'nuttx/configs/pcblogic-pic32mx/src')
-rw-r--r-- | nuttx/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/nuttx/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c b/nuttx/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c index 7740048a0..50697c587 100644 --- a/nuttx/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c +++ b/nuttx/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c @@ -73,6 +73,7 @@ #include <stdbool.h> #include <string.h> #include <semaphore.h> +#include <ctype.h> #include <poll.h> #include <errno.h> #include <debug.h> @@ -122,7 +123,6 @@ /* LCD **********************************************************************/ - #define LCD_NROWS 2 #define LCD_NCOLUMNS 16 #define LCD_NCHARS (LCD_NROWS * LCD_NCOLUMNS) @@ -225,8 +225,9 @@ static struct lcd1602_2 g_lcd1602; static void lcd_dumpstate(FAR const char *msg) { uint8_t buffer[LCD_NCOLUMNS]; - uint8_t row; - uint8_t column; + uint8_t ch; + int row; + int column; lcdvdbg("%s:\n", msg); lcdvdbg(" currow: %d curcol: %d\n", @@ -234,10 +235,11 @@ static void lcd_dumpstate(FAR const char *msg) for (row = 0, column = 0; row < LCD_NROWS; ) { - buffer[column] = lcd_readch(row, column); + ch = lcd_readch(row, column); + buffer[column] = isprint(ch) ? ch : '.'; if (++column >= LCD_NCOLUMNS) { - lcdvdbg(" %c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n", + lcdvdbg(" [%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c]\n", buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], buffer[5], buffer[6], buffer[7], buffer[8], buffer[9], buffer[10], buffer[11], @@ -551,9 +553,9 @@ static void lcd_action(enum slcdcode_e code, uint8_t count) { /* Don't permit movement past the bottom of the SLCD */ - if (g_lcd1602.curcol < (LCD_NCOLUMNS - 1)) + if (g_lcd1602.currow < (LCD_NCOLUMNS - 1)) { - g_lcd1602.curcol++; + g_lcd1602.currow++; } } break; |