Revert backlight to active-high, implement Draw_Sunflower_Pattern boot screen for empty storage states
This commit is contained in:
@@ -122,3 +122,38 @@ void Draw_Candle_Flicker() {
|
|||||||
|
|
||||||
LCD_addWindow(71, 125, 101, 167, canvas);
|
LCD_addWindow(71, 125, 101, 167, canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Draw_Sunflower_Pattern() {
|
||||||
|
clearScreen();
|
||||||
|
|
||||||
|
// Fill the screen with a stylized sunflower:
|
||||||
|
// Center of screen is x=86, y=160.
|
||||||
|
uint16_t line[172];
|
||||||
|
|
||||||
|
for (int y = 0; y < 320; y++) {
|
||||||
|
for (int x = 0; x < 172; x++) {
|
||||||
|
int dx = x - 86;
|
||||||
|
int dy = y - 160;
|
||||||
|
int dist2 = dx*dx + dy*dy;
|
||||||
|
|
||||||
|
if (dist2 < 30*30) {
|
||||||
|
// Sunflower center (brown)
|
||||||
|
line[x] = 0x5140; // dark brown
|
||||||
|
} else if (dist2 < 65*65 && (abs(dx) < 15 || abs(dy) < 15 || abs(dx-dy) < 12 || abs(dx+dy) < 12)) {
|
||||||
|
// Golden petals
|
||||||
|
line[x] = 0xFDA0; // Golden orange/yellow
|
||||||
|
} else if (dist2 < 70*70 && (abs(dx) < 22 || abs(dy) < 22)) {
|
||||||
|
// Outer petals highlight
|
||||||
|
line[x] = 0xFFE0; // Yellow
|
||||||
|
} else {
|
||||||
|
// Charcoal background
|
||||||
|
line[x] = 0x18C3; // Very dark warm gray
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Swap bytes for ST7789 SPI big-endian transfer
|
||||||
|
for (int x = 0; x < 172; x++) {
|
||||||
|
line[x] = __builtin_bswap16(line[x]);
|
||||||
|
}
|
||||||
|
LCD_addWindow(0, y, 171, y, line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,3 +13,4 @@ void Display_Memory_Photo(int memoryIndex);
|
|||||||
// Standby Remembrance Candle Flicker animation
|
// Standby Remembrance Candle Flicker animation
|
||||||
void Draw_Candle_Body();
|
void Draw_Candle_Body();
|
||||||
void Draw_Candle_Flicker();
|
void Draw_Candle_Flicker();
|
||||||
|
void Draw_Sunflower_Pattern();
|
||||||
|
|||||||
@@ -208,15 +208,15 @@ void LCD_addWindow(uint16_t Xstart, uint16_t Ystart, uint16_t Xend, uint16_t Yen
|
|||||||
void Backlight_Init(void)
|
void Backlight_Init(void)
|
||||||
{
|
{
|
||||||
pinMode(EXAMPLE_PIN_NUM_BK_LIGHT, OUTPUT);
|
pinMode(EXAMPLE_PIN_NUM_BK_LIGHT, OUTPUT);
|
||||||
digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, LOW); // Set backlight to full brightness (LOW for active-low)
|
digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, HIGH); // Set backlight to full brightness (HIGH for active-high)
|
||||||
}
|
}
|
||||||
|
|
||||||
void Set_Backlight(uint8_t Light)
|
void Set_Backlight(uint8_t Light)
|
||||||
{
|
{
|
||||||
pinMode(EXAMPLE_PIN_NUM_BK_LIGHT, OUTPUT);
|
pinMode(EXAMPLE_PIN_NUM_BK_LIGHT, OUTPUT);
|
||||||
if (Light > 0) {
|
if (Light > 0) {
|
||||||
digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, LOW); // ON (active-low)
|
digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, HIGH); // ON (active-high)
|
||||||
} else {
|
} else {
|
||||||
digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, HIGH); // OFF
|
digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, LOW); // OFF
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ void setup() {
|
|||||||
if (g_memoryCount == 0) {
|
if (g_memoryCount == 0) {
|
||||||
printf("No memories found. Add some via the web app.\r\n");
|
printf("No memories found. Add some via the web app.\r\n");
|
||||||
g_standbyActive = true;
|
g_standbyActive = true;
|
||||||
Draw_Candle_Body();
|
Draw_Sunflower_Pattern();
|
||||||
} else {
|
} else {
|
||||||
int favoriteIndex = -1;
|
int favoriteIndex = -1;
|
||||||
if (g_favoriteMemoryId >= 0) {
|
if (g_favoriteMemoryId >= 0) {
|
||||||
@@ -238,7 +238,7 @@ void loop() {
|
|||||||
if (g_memoryCount == 0) {
|
if (g_memoryCount == 0) {
|
||||||
if (!g_standbyActive) {
|
if (!g_standbyActive) {
|
||||||
g_standbyActive = true;
|
g_standbyActive = true;
|
||||||
Draw_Candle_Body();
|
Draw_Sunflower_Pattern();
|
||||||
}
|
}
|
||||||
} else if (!g_standbyActive && !isAudioPlaying() && currentState == STATE_IDLE && !g_tributeActive) {
|
} else if (!g_standbyActive && !isAudioPlaying() && currentState == STATE_IDLE && !g_tributeActive) {
|
||||||
if (now - lastInteractionTime > STANDBY_TIMEOUT) {
|
if (now - lastInteractionTime > STANDBY_TIMEOUT) {
|
||||||
@@ -248,7 +248,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_standbyActive) {
|
if (g_standbyActive && g_memoryCount > 0) {
|
||||||
Draw_Candle_Flicker();
|
Draw_Candle_Flicker();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user