Skip to content

Commit

Permalink
list-locales: fixed tool build for release
Browse files Browse the repository at this point in the history
  • Loading branch information
mfs12 committed Jun 24, 2021
1 parent 634aabe commit 3178642
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 18 deletions.
24 changes: 24 additions & 0 deletions Tools/list-locales/Hardware/UTFT.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Dummy header to avoid unnecessary includes
*/

#ifndef UTFT_h
#define UTFT_h

#include <cstdint>

typedef uint16_t Colour;

const Colour black = 0x0000;
const Colour white = 0xFFFF;

typedef const uint16_t *Palette;

namespace UTFT {
inline constexpr uint16_t fromRGB(uint8_t r, uint8_t g, uint8_t b)
{
return ((r & 248) << 8) | ((g & 252) << 3) | (b >> 3);
}
}

#endif
4 changes: 2 additions & 2 deletions Tools/list-locales/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ CPP_STD =

INCLUDE = -I./ -I../../src
OPTIMIZE =
#WARN = -W -Wall -Wstrict-prototypes -Wundef
WARN = -W -Wall -Wundef

CFLAGS = -std=$(C_STD) $(OPTIMIZE) $(WARN) $(INCLUDE) -g
CFLAGS = -std=$(C_STD) $(OPTIMIZE) $(WARN) -Wstrict-prototypes $(INCLUDE) -g
CPPFLAGS = $(OPTIMIZE) $(WARN) $(INCLUDE) -g
#CFLAGS += -DRBP_UPDATE_IMAGE_SMALL=1
LDFLAGS =
Expand Down
8 changes: 8 additions & 0 deletions Tools/list-locales/asf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Dummy header to avoid unnecessary includes
*/

#ifndef ASF_H
#define ASF_H

#endif // ASF_H
6 changes: 1 addition & 5 deletions Tools/list-locales/list-locales.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#include <iostream>
#include <string>

const size_t NumColourSchemes = 3;

enum class DisplayDimmerType : uint8_t
{
never = 0, // never dim the display
Expand All @@ -29,8 +27,6 @@ static int print_index(size_t index);

static int print_all(void)
{
const StringTable *orig = &LanguageTables[0];

for (size_t i = 1; i < ARRAY_SIZE(LanguageTables); i++) {
print_index(i);
}
Expand Down Expand Up @@ -199,7 +195,7 @@ int main(int argc, char *argv[])
<< "help - print this help" << std::endl
<< "LANGUAGES_NAMES - pass a list of languages names to print languages' translations" << std::endl;
} else {
for (size_t i = 1; i < argc; i++) {
for (ssize_t i = 1; i < argc; i++) {
print_lang(argv[i]);
}

Expand Down
11 changes: 0 additions & 11 deletions src/UI/Display.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ typedef const uint8_t * _ecv_array LcdFont;
// After that comes the icon data, 16 bits per pixel, one row at a time.
typedef const uint8_t * _ecv_array Icon;

// Unicode strings for special characters in our font
#define DECIMAL_POINT "\xC2\xB7" // Unicode middle-dot, code point B7
#define DEGREE_SYMBOL "\xC2\xB0" // Unicode degree-symbol, code point B0
#define THIN_SPACE "\xC2\x80" // Unicode control character, code point 0x80, we use it as thin space
#define LEFT_ARROW "\xC2\x81" // Unicode control character, code point 0x81, we use it as up arrow
#define UP_ARROW "\xC2\x82" // Unicode control character, code point 0x82, we use it as up arrow
#define RIGHT_ARROW "\xC2\x83" // Unicode control character, code point 0x83, we use it as down arrow
#define DOWN_ARROW "\xC2\x84" // Unicode control character, code point 0x84, we use it as down arrow
#define MORE_ARROW "\xC2\x85"
#define LESS_ARROW "\xC2\x86"

const uint8_t buttonGradStep = 12;
const PixelNumber AutoPlace = 0xFFFF;
constexpr float epsilon = 0.001f;
Expand Down
11 changes: 11 additions & 0 deletions src/UI/Strings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
#define Newline "\n"
#define DegreeSymbol "\u00B0"

// Unicode strings for special characters in our font
#define DECIMAL_POINT "\xC2\xB7" // Unicode middle-dot, code point B7
#define DEGREE_SYMBOL "\xC2\xB0" // Unicode degree-symbol, code point B0
#define THIN_SPACE "\xC2\x80" // Unicode control character, code point 0x80, we use it as thin space
#define LEFT_ARROW "\xC2\x81" // Unicode control character, code point 0x81, we use it as up arrow
#define UP_ARROW "\xC2\x82" // Unicode control character, code point 0x82, we use it as up arrow
#define RIGHT_ARROW "\xC2\x83" // Unicode control character, code point 0x83, we use it as down arrow
#define DOWN_ARROW "\xC2\x84" // Unicode control character, code point 0x84, we use it as down arrow
#define MORE_ARROW "\xC2\x85"
#define LESS_ARROW "\xC2\x86"

constexpr unsigned int NumStatusStrings = 14;

struct StringTable
Expand Down

0 comments on commit 3178642

Please sign in to comment.