Skip to content

Commit 28d9523

Browse files
committed
Reworking template methods to avoid cppcheck warnings
1 parent f78fb5c commit 28d9523

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+400
-400
lines changed

src/v2/lcd/base/display.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ template <class I> class NanoDisplayOps16: public NanoDisplayBase<I>
975975
* NanoCanvasOps provides operations for drawing in memory buffer.
976976
* Depending on BPP argument, this class can work with 1,8,16-bit canvas areas.
977977
*/
978-
template <class O, class I> class NanoDisplayOps: public O
978+
template <typename O, typename I> class NanoDisplayOps: public O
979979
{
980980
public:
981981
using O::O;

src/v2/lcd/il9163/lcd_il9163.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@
3030
void DisplayIL9163_128x128x16_SPI::begin()
3131
{
3232
m_spi.begin();
33-
DisplayIL9163_128x128x16::begin();
33+
DisplayIL9163_128x128x16::beginController();
3434
}
3535

3636
void DisplayIL9163_128x128x16_SPI::end()
3737
{
38-
DisplayIL9163_128x128x16::end();
38+
DisplayIL9163_128x128x16::endController();
3939
m_spi.end();
4040
}
4141
void DisplayIL9163_128x160x16_SPI::begin()
4242
{
4343
m_spi.begin();
44-
DisplayIL9163_128x160x16::begin();
44+
DisplayIL9163_128x160x16::beginController();
4545
}
4646

4747
void DisplayIL9163_128x160x16_SPI::end()
4848
{
49-
DisplayIL9163_128x160x16::end();
49+
DisplayIL9163_128x160x16::endController();
5050
m_spi.end();
5151
}

src/v2/lcd/il9163/lcd_il9163.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
/**
4141
* Class implements interface functions to IL9163 displays
4242
*/
43-
template <class I> class InterfaceIL9163: public I
43+
template <typename I> class InterfaceIL9163: public I
4444
{
4545
public:
4646
/**
@@ -117,7 +117,7 @@ template <class I> class InterfaceIL9163: public I
117117
/**
118118
* Class implements basic functions for 16-bit mode of IL9163-based displays
119119
*/
120-
template <class I> class DisplayIL9163x16: public NanoDisplayOps<NanoDisplayOps16<I>, I>
120+
template <typename I> class DisplayIL9163x16: public NanoDisplayOps<NanoDisplayOps16<I>, I>
121121
{
122122
public:
123123
/**
@@ -138,18 +138,18 @@ template <class I> class DisplayIL9163x16: public NanoDisplayOps<NanoDisplayOps1
138138
/**
139139
* Basic IL9163 initialization
140140
*/
141-
void begin() override;
141+
void beginDisplay();
142142

143143
/**
144144
* Basic IL9163 deinitialization
145145
*/
146-
void end() override;
146+
void endDisplay();
147147
};
148148

149149
/**
150150
* Class implements basic functions for 16-bit mode of IL9163-based displays
151151
*/
152-
template <class I> class DisplayIL9163_128x128x16: public DisplayIL9163x16<I>
152+
template <typename I> class DisplayIL9163_128x128x16: public DisplayIL9163x16<I>
153153
{
154154
public:
155155
/**
@@ -167,12 +167,12 @@ template <class I> class DisplayIL9163_128x128x16: public DisplayIL9163x16<I>
167167
/**
168168
* Basic IL9163 128x128x16 initialization
169169
*/
170-
void begin() override;
170+
void beginController();
171171

172172
/**
173173
* Basic IL9163 deinitialization
174174
*/
175-
void end() override;
175+
void endController();
176176
};
177177
/**
178178
* Class implements IL9163 128x128x16 lcd display in 16 bit mode over SPI
@@ -213,7 +213,7 @@ class DisplayIL9163_128x128x16_SPI: public DisplayIL9163_128x128x16<InterfaceIL9
213213
* Template class implements IL9163 128x128x16 lcd display in 16 bit mode over custom SPI implementation
214214
* (user-defined spi implementation). I - user custom spi class
215215
*/
216-
template <class I> class DisplayIL9163_128x128x16_CustomSPI: public DisplayIL9163_128x128x16<InterfaceIL9163<I>>
216+
template <typename I> class DisplayIL9163_128x128x16_CustomSPI: public DisplayIL9163_128x128x16<InterfaceIL9163<I>>
217217
{
218218
public:
219219
/**
@@ -237,15 +237,15 @@ template <class I> class DisplayIL9163_128x128x16_CustomSPI: public DisplayIL916
237237
void begin() override
238238
{
239239
m_spi.begin();
240-
DisplayIL9163_128x128x16<InterfaceIL9163<I>>::begin();
240+
DisplayIL9163_128x128x16<InterfaceIL9163<I>>::beginController();
241241
}
242242

243243
/**
244244
* Closes connection to display
245245
*/
246246
void end() override
247247
{
248-
DisplayIL9163_128x128x16<InterfaceIL9163<I>>::end();
248+
DisplayIL9163_128x128x16<InterfaceIL9163<I>>::endController();
249249
m_spi.end();
250250
}
251251

@@ -255,7 +255,7 @@ template <class I> class DisplayIL9163_128x128x16_CustomSPI: public DisplayIL916
255255
/**
256256
* Class implements basic functions for 16-bit mode of IL9163-based displays
257257
*/
258-
template <class I> class DisplayIL9163_128x160x16: public DisplayIL9163x16<I>
258+
template <typename I> class DisplayIL9163_128x160x16: public DisplayIL9163x16<I>
259259
{
260260
public:
261261
/**
@@ -273,12 +273,12 @@ template <class I> class DisplayIL9163_128x160x16: public DisplayIL9163x16<I>
273273
/**
274274
* Basic IL9163 128x160x16 initialization
275275
*/
276-
void begin() override;
276+
void beginController();
277277

278278
/**
279279
* Basic IL9163 deinitialization
280280
*/
281-
void end() override;
281+
void endController();
282282
};
283283
/**
284284
* Class implements IL9163 128x160x16 lcd display in 16 bit mode over SPI
@@ -319,7 +319,7 @@ class DisplayIL9163_128x160x16_SPI: public DisplayIL9163_128x160x16<InterfaceIL9
319319
* Template class implements IL9163 128x160x16 lcd display in 16 bit mode over custom SPI implementation
320320
* (user-defined spi implementation). I - user custom spi class
321321
*/
322-
template <class I> class DisplayIL9163_128x160x16_CustomSPI: public DisplayIL9163_128x160x16<InterfaceIL9163<I>>
322+
template <typename I> class DisplayIL9163_128x160x16_CustomSPI: public DisplayIL9163_128x160x16<InterfaceIL9163<I>>
323323
{
324324
public:
325325
/**
@@ -343,15 +343,15 @@ template <class I> class DisplayIL9163_128x160x16_CustomSPI: public DisplayIL916
343343
void begin() override
344344
{
345345
m_spi.begin();
346-
DisplayIL9163_128x160x16<InterfaceIL9163<I>>::begin();
346+
DisplayIL9163_128x160x16<InterfaceIL9163<I>>::beginController();
347347
}
348348

349349
/**
350350
* Closes connection to display
351351
*/
352352
void end() override
353353
{
354-
DisplayIL9163_128x160x16<InterfaceIL9163<I>>::end();
354+
DisplayIL9163_128x160x16<InterfaceIL9163<I>>::endController();
355355
m_spi.end();
356356
}
357357

src/v2/lcd/il9163/lcd_il9163.inl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ template <class I> void InterfaceIL9163<I>::setRotation(uint8_t rotation)
123123
// IL9163 basic 16-bit implementation
124124
////////////////////////////////////////////////////////////////////////////////
125125

126-
template <class I> void DisplayIL9163x16<I>::begin()
126+
template <class I> void DisplayIL9163x16<I>::beginDisplay()
127127
{
128128
}
129129

130-
template <class I> void DisplayIL9163x16<I>::end()
130+
template <class I> void DisplayIL9163x16<I>::endDisplay()
131131
{
132132
}
133133

@@ -167,7 +167,7 @@ static const PROGMEM uint8_t s_IL9163_lcd128x128x16_initData[] = {
167167
// IL9163 basic 16-bit implementation
168168
////////////////////////////////////////////////////////////////////////////////
169169

170-
template <class I> void DisplayIL9163_128x128x16<I>::begin()
170+
template <class I> void DisplayIL9163_128x128x16<I>::beginController()
171171
{
172172
ssd1306_resetController2(this->m_rstPin, 20);
173173
this->m_w = 128;
@@ -180,7 +180,7 @@ template <class I> void DisplayIL9163_128x128x16<I>::begin()
180180

181181
}
182182

183-
template <class I> void DisplayIL9163_128x128x16<I>::end()
183+
template <class I> void DisplayIL9163_128x128x16<I>::endController()
184184
{
185185
}
186186

@@ -205,7 +205,7 @@ static const PROGMEM uint8_t s_IL9163_lcd128x160x16_initData[] = {
205205
// IL9163 basic 16-bit implementation
206206
////////////////////////////////////////////////////////////////////////////////
207207

208-
template <class I> void DisplayIL9163_128x160x16<I>::begin()
208+
template <class I> void DisplayIL9163_128x160x16<I>::beginController()
209209
{
210210
ssd1306_resetController2(this->m_rstPin, 20);
211211
this->m_w = 128;
@@ -218,6 +218,6 @@ template <class I> void DisplayIL9163_128x160x16<I>::begin()
218218

219219
}
220220

221-
template <class I> void DisplayIL9163_128x160x16<I>::end()
221+
template <class I> void DisplayIL9163_128x160x16<I>::endController()
222222
{
223223
}

src/v2/lcd/ili9341/lcd_ili9341.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@
3030
void DisplayILI9341_240x320x16_SPI::begin()
3131
{
3232
m_spi.begin();
33-
DisplayILI9341_240x320x16::begin();
33+
DisplayILI9341_240x320x16::beginController();
3434
}
3535

3636
void DisplayILI9341_240x320x16_SPI::end()
3737
{
38-
DisplayILI9341_240x320x16::end();
38+
DisplayILI9341_240x320x16::endController();
3939
m_spi.end();
4040
}
4141
void DisplayILI9341_128x160x16_SPI::begin()
4242
{
4343
m_spi.begin();
44-
DisplayILI9341_128x160x16::begin();
44+
DisplayILI9341_128x160x16::beginController();
4545
}
4646

4747
void DisplayILI9341_128x160x16_SPI::end()
4848
{
49-
DisplayILI9341_128x160x16::end();
49+
DisplayILI9341_128x160x16::endController();
5050
m_spi.end();
5151
}

src/v2/lcd/ili9341/lcd_ili9341.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
/**
4141
* Class implements interface functions to ILI9341 displays
4242
*/
43-
template <class I> class InterfaceILI9341: public I
43+
template <typename I> class InterfaceILI9341: public I
4444
{
4545
public:
4646
/**
@@ -129,7 +129,7 @@ template <class I> class InterfaceILI9341: public I
129129
/**
130130
* Class implements basic functions for 16-bit mode of ILI9341-based displays
131131
*/
132-
template <class I> class DisplayILI9341x16: public NanoDisplayOps<NanoDisplayOps16<I>, I>
132+
template <typename I> class DisplayILI9341x16: public NanoDisplayOps<NanoDisplayOps16<I>, I>
133133
{
134134
public:
135135
/**
@@ -150,18 +150,18 @@ template <class I> class DisplayILI9341x16: public NanoDisplayOps<NanoDisplayOps
150150
/**
151151
* Basic ILI9341 initialization
152152
*/
153-
void begin() override;
153+
void beginDisplay();
154154

155155
/**
156156
* Basic ILI9341 deinitialization
157157
*/
158-
void end() override;
158+
void endDisplay();
159159
};
160160

161161
/**
162162
* Class implements basic functions for 16-bit mode of ILI9341-based displays
163163
*/
164-
template <class I> class DisplayILI9341_240x320x16: public DisplayILI9341x16<I>
164+
template <typename I> class DisplayILI9341_240x320x16: public DisplayILI9341x16<I>
165165
{
166166
public:
167167
/**
@@ -179,12 +179,12 @@ template <class I> class DisplayILI9341_240x320x16: public DisplayILI9341x16<I>
179179
/**
180180
* Basic ILI9341 240x320x16 initialization
181181
*/
182-
void begin() override;
182+
void beginController();
183183

184184
/**
185185
* Basic ILI9341 deinitialization
186186
*/
187-
void end() override;
187+
void endController();
188188
};
189189
/**
190190
* Class implements ILI9341 240x320x16 lcd display in 16 bit mode over SPI
@@ -225,7 +225,7 @@ class DisplayILI9341_240x320x16_SPI: public DisplayILI9341_240x320x16<InterfaceI
225225
* Template class implements ILI9341 240x320x16 lcd display in 16 bit mode over custom SPI implementation
226226
* (user-defined spi implementation). I - user custom spi class
227227
*/
228-
template <class I> class DisplayILI9341_240x320x16_CustomSPI: public DisplayILI9341_240x320x16<InterfaceILI9341<I>>
228+
template <typename I> class DisplayILI9341_240x320x16_CustomSPI: public DisplayILI9341_240x320x16<InterfaceILI9341<I>>
229229
{
230230
public:
231231
/**
@@ -249,15 +249,15 @@ template <class I> class DisplayILI9341_240x320x16_CustomSPI: public DisplayILI9
249249
void begin() override
250250
{
251251
m_spi.begin();
252-
DisplayILI9341_240x320x16<InterfaceILI9341<I>>::begin();
252+
DisplayILI9341_240x320x16<InterfaceILI9341<I>>::beginController();
253253
}
254254

255255
/**
256256
* Closes connection to display
257257
*/
258258
void end() override
259259
{
260-
DisplayILI9341_240x320x16<InterfaceILI9341<I>>::end();
260+
DisplayILI9341_240x320x16<InterfaceILI9341<I>>::endController();
261261
m_spi.end();
262262
}
263263

@@ -267,7 +267,7 @@ template <class I> class DisplayILI9341_240x320x16_CustomSPI: public DisplayILI9
267267
/**
268268
* Class implements basic functions for 16-bit mode of ILI9341-based displays
269269
*/
270-
template <class I> class DisplayILI9341_128x160x16: public DisplayILI9341x16<I>
270+
template <typename I> class DisplayILI9341_128x160x16: public DisplayILI9341x16<I>
271271
{
272272
public:
273273
/**
@@ -285,12 +285,12 @@ template <class I> class DisplayILI9341_128x160x16: public DisplayILI9341x16<I>
285285
/**
286286
* Basic ILI9341 128x160x16 initialization
287287
*/
288-
void begin() override;
288+
void beginController();
289289

290290
/**
291291
* Basic ILI9341 deinitialization
292292
*/
293-
void end() override;
293+
void endController();
294294
};
295295
/**
296296
* Class implements ILI9341 128x160x16 lcd display in 16 bit mode over SPI
@@ -331,7 +331,7 @@ class DisplayILI9341_128x160x16_SPI: public DisplayILI9341_128x160x16<InterfaceI
331331
* Template class implements ILI9341 128x160x16 lcd display in 16 bit mode over custom SPI implementation
332332
* (user-defined spi implementation). I - user custom spi class
333333
*/
334-
template <class I> class DisplayILI9341_128x160x16_CustomSPI: public DisplayILI9341_128x160x16<InterfaceILI9341<I>>
334+
template <typename I> class DisplayILI9341_128x160x16_CustomSPI: public DisplayILI9341_128x160x16<InterfaceILI9341<I>>
335335
{
336336
public:
337337
/**
@@ -355,15 +355,15 @@ template <class I> class DisplayILI9341_128x160x16_CustomSPI: public DisplayILI9
355355
void begin() override
356356
{
357357
m_spi.begin();
358-
DisplayILI9341_128x160x16<InterfaceILI9341<I>>::begin();
358+
DisplayILI9341_128x160x16<InterfaceILI9341<I>>::beginController();
359359
}
360360

361361
/**
362362
* Closes connection to display
363363
*/
364364
void end() override
365365
{
366-
DisplayILI9341_128x160x16<InterfaceILI9341<I>>::end();
366+
DisplayILI9341_128x160x16<InterfaceILI9341<I>>::endController();
367367
m_spi.end();
368368
}
369369

0 commit comments

Comments
 (0)