@@ -114,20 +114,6 @@ class Sh8601 {
114
114
// Initialize display pins
115
115
display_drivers::init_pins (reset_pin_, dc_pin_, config.reset_value );
116
116
117
- uint8_t madctl = 0 ;
118
- if (swap_color_order_) {
119
- madctl |= LCD_CMD_BGR_BIT;
120
- }
121
- if (mirror_x_) {
122
- madctl |= LCD_CMD_MX_BIT;
123
- }
124
- if (mirror_y_) {
125
- madctl |= LCD_CMD_MY_BIT;
126
- }
127
- if (swap_xy_) {
128
- madctl |= LCD_CMD_MV_BIT;
129
- }
130
-
131
117
auto init_cmds = std::to_array<display_drivers::DisplayInitCmd<Command>>({
132
118
{Command::slpout, {}, 120 }, // sleep out
133
119
{Command::noron}, // normal mode
@@ -153,16 +139,16 @@ class Sh8601 {
153
139
*/
154
140
static void rotate (const DisplayRotation &rotation) {
155
141
uint8_t data = 0 ;
156
- if (swap_color_order_) {
142
+ if (swap_color_order_) { // cppcheck-suppress knownConditionTrueFalse
157
143
data |= LCD_CMD_BGR_BIT;
158
144
}
159
- if (mirror_x_) {
145
+ if (mirror_x_) { // cppcheck-suppress knownConditionTrueFalse
160
146
data |= LCD_CMD_MX_BIT;
161
147
}
162
- if (mirror_y_) {
148
+ if (mirror_y_) { // cppcheck-suppress knownConditionTrueFalse
163
149
data |= LCD_CMD_MY_BIT;
164
150
}
165
- if (swap_xy_) {
151
+ if (swap_xy_) { // cppcheck-suppress knownConditionTrueFalse
166
152
data |= LCD_CMD_MV_BIT;
167
153
}
168
154
@@ -171,7 +157,7 @@ class Sh8601 {
171
157
break ;
172
158
case DisplayRotation::PORTRAIT:
173
159
// flip the mx and mv bits (xor)
174
- if (mirror_portrait_) {
160
+ if (mirror_portrait_) { // cppcheck-suppress knownConditionTrueFalse
175
161
data ^= (LCD_CMD_MX_BIT | LCD_CMD_MV_BIT);
176
162
} else {
177
163
data ^= (LCD_CMD_MY_BIT | LCD_CMD_MV_BIT);
@@ -183,7 +169,7 @@ class Sh8601 {
183
169
break ;
184
170
case DisplayRotation::PORTRAIT_INVERTED:
185
171
// flip the my and mv bits (xor)
186
- if (mirror_portrait_) {
172
+ if (mirror_portrait_) { // cppcheck-suppress knownConditionTrueFalse
187
173
data ^= (LCD_CMD_MY_BIT | LCD_CMD_MV_BIT);
188
174
} else {
189
175
data ^= (LCD_CMD_MX_BIT | LCD_CMD_MV_BIT);
0 commit comments