Rev 10 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 10 | Rev 11 | ||
|---|---|---|---|
| Line -... | Line 1... | ||
| - | 1 | ||
| - | 2 | #include <cstring> |
|
| 1 | #include "libOLED/displayclass.H" |
3 | #include "libOLED/displayclass.H" |
| 2 | 4 | ||
| 3 | void display_t::printString(font_t &font, char const *string, uint16_t length, |
5 | void display_t::printString(font_t &font, char const *string, uint16_t length, |
| 4 | colour_t colour) |
6 | colour_t colour) |
| 5 | { |
7 | { |
| 6 | setPixelMode(colour); |
8 | setPixelMode(colour); |
| - | 9 | if(length==0) |
|
| - | 10 | length=strlen(string); |
|
| 7 | uint16_t const xSpacing = font.width() + 1; |
11 | uint16_t const xSpacing = font.width() + 1; |
| 8 | for (uint16_t yt = 0; yt < font.height(); yt++) // iterate down scan lines |
12 | for (uint16_t yt = 0; yt < font.height(); yt++) // iterate down scan lines |
| 9 | { |
13 | { |
| 10 | uint16_t ys = m_cursor_y + yt; |
14 | uint16_t ys = m_cursor_y + yt; |
| 11 | for (uint16_t xt = 0; xt < length; xt++) |
15 | for (uint16_t xt = 0; xt < length; xt++) |