Skip to content

Commit

Permalink
const in args of tft
Browse files Browse the repository at this point in the history
  • Loading branch information
jlbirccyn committed Feb 5, 2020
1 parent 7cc9ab3 commit dd3fe5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions machines/cortex/armv7em/stm32f303/coroLabBoard/tft/tft.cpp
Expand Up @@ -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;
Expand All @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions machines/cortex/armv7em/stm32f303/coroLabBoard/tft/tft.h
Expand Up @@ -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
*/
Expand All @@ -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;
Expand Down

0 comments on commit dd3fe5a

Please sign in to comment.