@@ -114,20 +114,6 @@ class Sh8601 {
114114 // Initialize display pins
115115 display_drivers::init_pins (reset_pin_, dc_pin_, config.reset_value );
116116
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-
131117 auto init_cmds = std::to_array<display_drivers::DisplayInitCmd<Command>>({
132118 {Command::slpout, {}, 120 }, // sleep out
133119 {Command::noron}, // normal mode
@@ -153,16 +139,16 @@ class Sh8601 {
153139 */
154140 static void rotate (const DisplayRotation &rotation) {
155141 uint8_t data = 0 ;
156- if (swap_color_order_) {
142+ if (swap_color_order_) { // cppcheck-suppress knownConditionTrueFalse
157143 data |= LCD_CMD_BGR_BIT;
158144 }
159- if (mirror_x_) {
145+ if (mirror_x_) { // cppcheck-suppress knownConditionTrueFalse
160146 data |= LCD_CMD_MX_BIT;
161147 }
162- if (mirror_y_) {
148+ if (mirror_y_) { // cppcheck-suppress knownConditionTrueFalse
163149 data |= LCD_CMD_MY_BIT;
164150 }
165- if (swap_xy_) {
151+ if (swap_xy_) { // cppcheck-suppress knownConditionTrueFalse
166152 data |= LCD_CMD_MV_BIT;
167153 }
168154
@@ -171,7 +157,7 @@ class Sh8601 {
171157 break ;
172158 case DisplayRotation::PORTRAIT:
173159 // flip the mx and mv bits (xor)
174- if (mirror_portrait_) {
160+ if (mirror_portrait_) { // cppcheck-suppress knownConditionTrueFalse
175161 data ^= (LCD_CMD_MX_BIT | LCD_CMD_MV_BIT);
176162 } else {
177163 data ^= (LCD_CMD_MY_BIT | LCD_CMD_MV_BIT);
@@ -183,7 +169,7 @@ class Sh8601 {
183169 break ;
184170 case DisplayRotation::PORTRAIT_INVERTED:
185171 // flip the my and mv bits (xor)
186- if (mirror_portrait_) {
172+ if (mirror_portrait_) { // cppcheck-suppress knownConditionTrueFalse
187173 data ^= (LCD_CMD_MY_BIT | LCD_CMD_MV_BIT);
188174 } else {
189175 data ^= (LCD_CMD_MX_BIT | LCD_CMD_MV_BIT);
0 commit comments