TDISP update

ugfx_release_2.6
Joel Bodenmann 2013-01-10 15:03:34 +01:00
parent d5e7afe756
commit 77a93bb43d
3 changed files with 11 additions and 8 deletions

View File

@ -32,13 +32,6 @@
#if GFX_USE_TDISP /*|| defined(__DOXYGEN__)*/
#ifndef TDISP_ROWS
#define TDISP_ROWS 16
#endif
#ifndef TDISP_COLUMNS
#define TDISP_COLUMNS 2
#endif
#include "tdisp_lld_board_example.h"
static void _writeData(uint8_t data) {

View File

@ -41,6 +41,13 @@
/* Include the low level driver information */
#include "tdisp/lld/tdisp_lld.h"
#ifndef TDISP_ROWS
#define TDISP_ROWS 2
#endif
#ifndef TDISP_COLUMNS
#define TDISP_COLUMNS 16
#endif
#ifndef TDISP_NEED_4BIT_MODE
#define TDISP_NEED_4BIT_MODE FALSE
#endif

View File

@ -50,6 +50,9 @@ void tdispHome(void) {
void tdispGotoXY(coord_t col, coord_t row) {
uint8_t row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
if(row >= TDISP_ROWS)
row = TDISP_ROWS - 1;
TDISP_LLD(write_cmd)(0x80 | (col + row_offsets[row]));
}
@ -60,7 +63,7 @@ void tdispDrawChar(char c) {
void tdispDrawString(char *s) {
char c;
while(c = s++)
while(c = *s++)
tdispDrawChar(c);
}