clock.h
C source for A clock on a round ESP32 display, 29 lines. Raw file
#pragma once
#include <stdint.h>
#include "hud.h"
#ifdef __cplusplus
extern "C" {
#endif
#define CLOCK_FACES 7
int clock_init(void);
void clock_next_face(void);
const char *clock_face_name(void);
int clock_face_index(void);
const uint8_t *clock_background(void);
/*
* rgb is a single compose buffer that is background between frames.
* Static face art is prerendered into PSRAM (all faces if they fit).
* Digits bake onto a restore cache; analog hour/min sweep as per-frame tiles.
* Minute changes dirty only tiles that actually differ, not the whole disc.
*/
void clock_frame(uint8_t *rgb, hud_tiles_t dirty, int *full);
#ifdef __cplusplus
}
#endif