add usage of text

This commit is contained in:
2026-08-07 15:37:13 +02:00
parent eeb2aac75c
commit 95225a5811
4 changed files with 148 additions and 96 deletions
+3 -5
View File
@@ -42,7 +42,7 @@ draw::color_t interpolateColor(double value,
return stops.back().color;
}
#ifdef CONFIG_METRIC
draw::color_t get_altitude_color(uint32_t value) {
static constexpr std::array<color_stop, 11> stops = {{
#ifdef CONFIG_METRIC
@@ -57,8 +57,7 @@ draw::color_t get_altitude_color(uint32_t value) {
{6000, {40, 175, 215}},
{9000, {50, 110, 240}},
{12000, {140, 50, 220}}
#endif
#ifndef CONFIG_METRIC
#else
{0, {220, 90, 20}}, // Brown/Dark Orange
{500, {245, 115, 25}}, // Orange
{1000, {250, 150, 30}}, // Light Orange
@@ -74,7 +73,6 @@ draw::color_t get_altitude_color(uint32_t value) {
}};
return interpolateColor(value, stops);
}
#endif
enum letter_id {
LETTER_A,
@@ -171,7 +169,7 @@ void putchar(const char c, uint16_t x, uint16_t y, const draw::color_t color) {
y++;
}
}
void puts(const std::string &s, uint16_t x, uint16_t y, draw::color_t color) {
void puts(const std::string &s, const uint16_t x, const uint16_t y, const draw::color_t color) {
for (size_t i = 0; i < s.length(); i++) {
putchar(s[i], x+((FONT_WIDTH+CONFIG_CHARACTER_SPACING)*i), y, color);
}