@@ -105,17 +105,17 @@ class Display : public LcdDriver {
105105#else
106106 printf (" ST7789 " );
107107#endif
108- printf (" (%u,%u)\n " , rows_, cols_);
108+ printf (" (%u,%u)\n " , static_cast < unsigned >( rows_), static_cast < unsigned >( cols_) );
109109 }
110110
111111 void Cls () { FillColour (kColorBackground ); }
112112
113- void SetCursorPos (const uint32_t nCol, const uint32_t row) {
113+ void SetCursorPos (uint32_t nCol, uint32_t row) {
114114 cursor_x_ = nCol * s_pFONT->kWidth ;
115115 cursor_y_ = row * s_pFONT->kHeight ;
116116 }
117117
118- void PutChar (const int c) {
118+ void PutChar (int c) {
119119 DrawChar (cursor_x_, cursor_y_, static_cast <char >(c), s_pFONT, kColorBackground , kColorForeground );
120120
121121 cursor_x_ += s_pFONT->kWidth ;
@@ -137,7 +137,7 @@ class Display : public LcdDriver {
137137 }
138138 }
139139
140- void ClearLine (const uint32_t nLine) {
140+ void ClearLine (uint32_t nLine) {
141141 if (__builtin_expect ((!(nLine <= rows_)), 0 )) {
142142 return ;
143143 }
@@ -151,7 +151,7 @@ class Display : public LcdDriver {
151151 SetCursorPos (0 , (nLine - 1U ));
152152 }
153153
154- void TextLine (const uint32_t nLine, const char * pText, const uint32_t nLength) {
154+ void TextLine (uint32_t nLine, const char * pText, const uint32_t nLength) {
155155 if (__builtin_expect ((!(nLine <= rows_)), 0 )) {
156156 return ;
157157 }
@@ -162,18 +162,18 @@ class Display : public LcdDriver {
162162
163163 void ClearEndOfLine () { clear_end_of_line_ = true ; }
164164
165- void Text (const char * pData , uint32_t nLength ) {
166- if (nLength > cols_) {
167- nLength = cols_;
165+ void Text (const char * data , uint32_t length ) {
166+ if (length > cols_) {
167+ length = cols_;
168168 }
169169
170- for (uint32_t i = 0 ; i < nLength ; i++) {
171- PutChar (pData [i]);
170+ for (uint32_t i = 0 ; i < length ; i++) {
171+ PutChar (data [i]);
172172 }
173173 }
174174
175- int Write (const uint32_t nLine , const char * pText ) {
176- const auto * p = pText ;
175+ int Write (uint32_t line , const char * text ) {
176+ const auto * p = text ;
177177 int nCount = 0 ;
178178
179179 const auto columns = static_cast <int >(cols_);
@@ -182,28 +182,28 @@ class Display : public LcdDriver {
182182 ++p;
183183 }
184184
185- TextLine (nLine, pText , static_cast <uint8_t >(nCount));
185+ TextLine (line, text , static_cast <uint8_t >(nCount));
186186
187187 return nCount;
188188 }
189189
190- int Printf (const uint8_t nLine , const char * format, ...) {
190+ int Printf (uint8_t line , const char * format, ...) {
191191 char buffer[32 ];
192192
193193 va_list arp;
194194
195195 va_start (arp, format);
196196
197- auto i = vsnprintf (buffer, sizeof (buffer) / sizeof (buffer[0 ]), format, arp);
197+ const auto kSize = vsnprintf (buffer, sizeof (buffer) / sizeof (buffer[0 ]), format, arp);
198198
199199 va_end (arp);
200200
201- TextLine (nLine , buffer, static_cast <uint16_t >(i ));
201+ TextLine (line , buffer, static_cast <uint16_t >(kSize ));
202202
203- return i ;
203+ return kSize ;
204204 }
205205
206- void TextStatus (const char * pText ) {
206+ void TextStatus (const char * text ) {
207207 SetCursorPos (0 , static_cast <uint8_t >(rows_ - 1 ));
208208
209209 for (uint32_t i = 0 ; i < (cols_ - 1 ); i++) {
@@ -212,7 +212,7 @@ class Display : public LcdDriver {
212212
213213 SetCursorPos (0 , static_cast <uint8_t >(rows_ - 1 ));
214214
215- Write (rows_, pText );
215+ Write (rows_, text );
216216 }
217217
218218 void TextStatus (const char * text, ansi::Colours::Colour colour) {
@@ -221,20 +221,20 @@ class Display : public LcdDriver {
221221 }
222222
223223 void Progress () {
224- static constexpr char SYMBOLS [] = {' /' , ' -' , ' \\ ' , ' |' };
224+ static constexpr char kSymbols [] = {' /' , ' -' , ' \\ ' , ' |' };
225225 static uint32_t nSymbolsIndex;
226226
227227 SetCursorPos (GetColumns () - 1U , GetRows () - 1U );
228- PutChar (SYMBOLS [nSymbolsIndex++]);
228+ PutChar (kSymbols [nSymbolsIndex++]);
229229
230- if (nSymbolsIndex >= sizeof (SYMBOLS )) {
230+ if (nSymbolsIndex >= sizeof (kSymbols )) {
231231 nSymbolsIndex = 0 ;
232232 }
233233 }
234234
235- void SetContrast (const uint8_t nContrast) { SetBackLight (nContrast); }
235+ void SetContrast (uint8_t nContrast) { SetBackLight (nContrast); }
236236
237- void SetSleep (const bool bSleep) {
237+ void SetSleep (bool bSleep) {
238238 is_sleep_ = bSleep;
239239
240240 EnableSleep (bSleep);
@@ -282,7 +282,6 @@ class Display : public LcdDriver {
282282 private:
283283 void SetSleepTimer (const bool bActive);
284284
285- private:
286285 uint32_t cols_;
287286 uint32_t rows_;
288287 uint32_t sleep_timeout_{1000U * 60U * display::Defaults::kSleepTimeout };
0 commit comments