@@ -25,23 +25,11 @@ modm::MonochromeGraphicDisplayVertical<Width, Height>::drawHorizontalLine(glcd::
25
25
{
26
26
const int16_t y = start.y / 8 ;
27
27
28
- // TODO Implement draw / clear pixels for monochrome displays
29
- // if (draw mode)
30
- // {
31
28
const uint8_t byte = 1 << (start.y % 8 );
32
29
for (int_fast16_t x = start.x ; x < static_cast <int16_t >(start.x + length); ++x)
33
30
{
34
- if (x < Width) { this ->buffer [x][y ] |= byte; }
31
+ if (x < Width) { this ->buffer [y][x ] |= byte; }
35
32
}
36
- // } else
37
- // {
38
- // const uint8_t byte = ~(1 << (start.y % 8));
39
- // for (int_fast16_t x = start.x; x < static_cast<int16_t>(start.x + length);
40
- // ++x)
41
- // {
42
- // if (x < Width and y < Height) { this->buffer[x][y] &= byte; }
43
- // }
44
- // }
45
33
}
46
34
}
47
35
@@ -62,7 +50,7 @@ modm::MonochromeGraphicDisplayVertical<Width, Height>::drawVerticalLine(glcd::Po
62
50
{
63
51
if (y < Height / 8 )
64
52
{
65
- this ->buffer [start.x ][y ] |= byte;
53
+ this ->buffer [y][ start.x ] |= byte;
66
54
byte = 0xFF ;
67
55
}
68
56
y++;
@@ -71,7 +59,7 @@ modm::MonochromeGraphicDisplayVertical<Width, Height>::drawVerticalLine(glcd::Po
71
59
if (y < Height / 8 )
72
60
{
73
61
byte &= 0xFF >> (8 - end_y % 8 );
74
- this ->buffer [start.x ][y ] |= byte;
62
+ this ->buffer [y][ start.x ] |= byte;
75
63
}
76
64
}
77
65
}
@@ -97,7 +85,7 @@ modm::MonochromeGraphicDisplayVertical<Width, Height>::drawImageRaw(
97
85
98
86
if (x < Width and y < Height)
99
87
{
100
- this ->buffer [x][y ] = data[i + k * width];
88
+ this ->buffer [y][x ] = data[i + k * width];
101
89
}
102
90
}
103
91
}
@@ -112,14 +100,14 @@ template<int16_t Width, int16_t Height>
112
100
void
113
101
modm::MonochromeGraphicDisplayVertical<Width, Height>::setPixel(int16_t x, int16_t y)
114
102
{
115
- if (x < Width and y < Height) { this ->buffer [x][ y / 8 ] |= (1 << y % 8 ); }
103
+ if (x < Width and y < Height) { this ->buffer [y / 8 ][x ] |= (1 << y % 8 ); }
116
104
}
117
105
118
106
template <int16_t Width, int16_t Height>
119
107
void
120
108
modm::MonochromeGraphicDisplayVertical<Width, Height>::clearPixel(int16_t x, int16_t y)
121
109
{
122
- if (x < Width and y < Height) { this ->buffer [x][ y / 8 ] &= ~(1 << y % 8 ); }
110
+ if (x < Width and y < Height) { this ->buffer [y / 8 ][x ] &= ~(1 << y % 8 ); }
123
111
}
124
112
125
113
template <int16_t Width, int16_t Height>
@@ -128,7 +116,7 @@ modm::MonochromeGraphicDisplayVertical<Width, Height>::getPixel(int16_t x, int16
128
116
{
129
117
if (x < Width and y < Height)
130
118
{
131
- return (this ->buffer [x][ y / 8 ] & (1 << y % 8 ));
119
+ return (this ->buffer [y / 8 ][x ] & (1 << y % 8 ));
132
120
} else
133
121
{
134
122
return false ;
0 commit comments