glcd: remove unnecessary defines; count arrays automatically; fix path to icons

Origin commit data
------------------
Branch: ni/coolstream
Commit: ba17126f8e
Author: vanhofen <vanhofen@gmx.de>
Date: 2020-06-23 (Tue, 23 Jun 2020)

Origin message was:
------------------
- glcd: remove unnecessary defines; count arrays automatically; fix path to icons

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2020-06-23 01:05:35 +02:00
parent 529b217443
commit f2174ab04a
6 changed files with 24 additions and 33 deletions

View File

@@ -47,7 +47,7 @@ enum digits
TIME_DOTS = 10
};
const char * const digit_name[LCD_NUMBER_OF_DIGITS] =
const char * const digit_name[] =
{
"time_zero",
"time_one",
@@ -61,22 +61,23 @@ const char * const digit_name[LCD_NUMBER_OF_DIGITS] =
"time_nine",
"time_dots"
};
#define LCD_NUMBER_OF_DIGITS (sizeof(digit_name)/sizeof(digit_name[0]))
#define NUMBER_OF_PATHS 2
const char * const digit_path[NUMBER_OF_PATHS] =
const char * const digit_path[] =
{
LCDDIR_VAR "/oled/clock/",
DATADIR "/oled/clock/"
ICONSDIR "/oled/clock/",
ICONSDIR_VAR "/oled/clock/"
};
#define NUMBER_OF_PATHS (sizeof(digit_path)/sizeof(digit_path[0]))
static std::string digit[LCD_NUMBER_OF_DIGITS] = {""};
void InitDigitalClock(void)
{
for (int i = 0; i < LCD_NUMBER_OF_DIGITS; i++)
for (unsigned int i = 0; i < LCD_NUMBER_OF_DIGITS; i++)
{
std::string digit_file;
for (int j = 0; j < NUMBER_OF_PATHS; j++)
for (unsigned int j = 0; j < NUMBER_OF_PATHS; j++)
{
std::string file_jpg = digit_path[j];
file_jpg += digit_name[i];