Skip to content
Permalink
Browse files

const in args of tft

  • Loading branch information
jlbirccyn committed Feb 5, 2020
1 parent 7cc9ab3 commit dd3fe5ae5c8b83c30b9568e0f1edb6b774c77170
@@ -32,7 +32,7 @@ void tft::setup()
erase();
}

void tft::setTextCursor(unsigned int col, unsigned int line)
void tft::setTextCursor(const unsigned int col, const unsigned int line)
{
const unsigned x = (col % getTextWidth()) * FONT_WIDTH;
const unsigned y = ((line % getTextHeight())+1) * FONT_HEIGHT;
@@ -52,7 +52,7 @@ unsigned int tft::getTextHeight()
//we can use getTextBounds() to get the bounds
//of a text part. This is a simpler function for
//fixed-space fonts.
void tft::eraseText(unsigned int n)
void tft::eraseText(const unsigned int n)
{
int x = getCursorX();
int y = getCursorY();
@@ -16,11 +16,11 @@ class tft : public Adafruit_ST7735 {
/* init the hardware */
void setup();

/* set text cursor position
/* set text cursor position
* line 0 is at top
* col 0 is at left
* */
void setTextCursor(unsigned int col, unsigned int line);
void setTextCursor(const unsigned int col, const unsigned int line);

/* return the width of the LCD as a number of chars
*/
@@ -31,7 +31,7 @@ class tft : public Adafruit_ST7735 {
unsigned int getTextHeight();

/* erase n characters from current cursor position */
void eraseText(unsigned int n);
void eraseText(const unsigned int n);
};

extern tft Tft;

0 comments on commit dd3fe5a

Please sign in to comment.
You can’t perform that action at this time.