Implement browser-based voice notes recording, standby flicking remembrance candle, and favorite memory pinning
This commit is contained in:
@@ -71,3 +71,54 @@ void Display_Memory_Photo(int memoryIndex) {
|
||||
snprintf(path, sizeof(path), "/photos/%s", g_memories[memoryIndex].photo);
|
||||
Display_Image_From_SD(path);
|
||||
}
|
||||
|
||||
void Draw_Candle_Body() {
|
||||
clearScreen();
|
||||
|
||||
// Draw candle body (ivory column): x from 76 to 96 (width 21), y from 175 to 250 (height 75)
|
||||
uint16_t body[21 * 75];
|
||||
for (int i = 0; i < 21 * 75; i++) body[i] = 0xF7BE; // Warm Ivory / light cream
|
||||
LCD_addWindow(76, 175, 96, 249, body);
|
||||
|
||||
// Draw candle wick: x = 86, y from 168 to 175
|
||||
uint16_t wick[1 * 8];
|
||||
for (int i = 0; i < 8; i++) wick[i] = 0x2104; // Dark gray
|
||||
LCD_addWindow(86, 168, 86, 175, wick);
|
||||
}
|
||||
|
||||
void Draw_Candle_Flicker() {
|
||||
static uint32_t lastFlickerTime = 0;
|
||||
static uint8_t flickerState = 0;
|
||||
uint32_t now = millis();
|
||||
if (now - lastFlickerTime < 180) return; // flicker every 180ms
|
||||
lastFlickerTime = now;
|
||||
flickerState = (flickerState + 1) % 4;
|
||||
|
||||
// Bounding box: width 31, height 43
|
||||
static uint16_t canvas[31 * 43];
|
||||
memset(canvas, 0, sizeof(canvas)); // fill black
|
||||
|
||||
int hOffset = (flickerState % 2 == 0) ? 0 : ((flickerState == 1) ? 1 : -1);
|
||||
int vHeight = 22 + (flickerState % 3); // flame height varies
|
||||
|
||||
for (int y = 0; y < 43; y++) {
|
||||
for (int x = 0; x < 31; x++) {
|
||||
int dx = abs(x - 15 - hOffset);
|
||||
int dy = 35 - y;
|
||||
|
||||
if (dy >= 0 && dy < vHeight) {
|
||||
int maxWidth = (dy < 8) ? (dy * 1.2) : (vHeight - dy) * 0.4;
|
||||
if (maxWidth < 1) maxWidth = 1;
|
||||
if (dx <= maxWidth) {
|
||||
if (dx <= maxWidth / 2 && dy < vHeight - 4) {
|
||||
canvas[y * 31 + x] = 0xFFE0; // Yellow
|
||||
} else {
|
||||
canvas[y * 31 + x] = 0xFD20; // Orange
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LCD_addWindow(71, 125, 101, 167, canvas);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user