X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/a7be12a4e68fcaaa92f81a394bc316a592ec6270..2fb9f70df407a731f55952a7e70eea641ad275d9:/drivers/displays/tft/touchscreen.c diff --git a/drivers/displays/tft/touchscreen.c b/drivers/displays/tft/touchscreen.c index 90af15f..381976a 100644 --- a/drivers/displays/tft/touchscreen.c +++ b/drivers/displays/tft/touchscreen.c @@ -40,10 +40,10 @@ #include "core/adc/adc.h" #include "core/gpio/gpio.h" #include "core/systick/systick.h" -#include "drivers/eeprom/eeprom.h" +#include "drivers/storage/eeprom/eeprom.h" #include "drivers/displays/tft/lcd.h" #include "drivers/displays/tft/drawing.h" -#include "drivers/displays/tft/fonts/dejavusans9.h" +#include "drivers/displays/tft/controls/labelcentered.h" #define TS_LINE1 "Touch the center of" #define TS_LINE2 "the red circle using" @@ -170,7 +170,7 @@ uint32_t tsReadY(void) /**************************************************************************/ void tsCalibCenterText(char* text, uint16_t y, uint16_t color) { - drawString((lcdGetWidth() - drawGetStringWidth(&dejaVuSans9ptFontInfo, text)) / 2, y, color, &dejaVuSans9ptFontInfo, text); + labelcenteredRender(lcdGetWidth()/2, y, COLOR_WHITE, color, text, themeGetDefault()); } /**************************************************************************/ @@ -300,7 +300,6 @@ int getDisplayPoint( tsPoint_t * displayPtr, tsPoint_t * screenPtr, tsMatrix_t * } else { - // ToDo: Default values required or you can never read LCD position! // return TS_ERROR_NOTCALIBRATED; return -1; } @@ -414,20 +413,9 @@ tsTouchError_t tsRead(tsTouchData_t* data, uint8_t calibrating) tsPoint_t location, touch; touch.x = x1; touch.y = y1; - // Only calculate the relative LCD value if this isn't for calibration - if (!calibrating) - { - getDisplayPoint( &location, &touch, &_tsMatrix) ; - data->xlcd = location.x; - data->ylcd = location.y; - } - else - { - // Assign some false values, but only xraw and yraw are - // used for calibration - data->xlcd = 0; - data->ylcd = 0; - } + getDisplayPoint( &location, &touch, &_tsMatrix) ; + data->xlcd = location.x; + data->ylcd = location.y; data->valid = true; return TS_ERROR_NONE;