Added watch_disable_display

This commit is contained in:
David Volovskiy 2025-08-23 11:31:59 -04:00
parent 86fd87a326
commit 358ddeaea9
3 changed files with 18 additions and 4 deletions

View File

@ -260,6 +260,10 @@ void watch_enable_display(void) {
slcd_enable(); slcd_enable();
} }
void watch_disable_display(void) {
slcd_disable();
}
inline void watch_set_pixel(uint8_t com, uint8_t seg) { inline void watch_set_pixel(uint8_t com, uint8_t seg) {
slcd_set_segment(com, seg); slcd_set_segment(com, seg);
} }

View File

@ -98,6 +98,10 @@ typedef enum {
*/ */
void watch_enable_display(void); void watch_enable_display(void);
/** @brief Disables the Segment LCD display.
*/
void watch_disable_display(void);
/** @brief Sets a pixel. Use this to manually set a pixel with a given common and segment number. /** @brief Sets a pixel. Use this to manually set a pixel with a given common and segment number.
* See <a href="segmap.html">segmap.html</a>. * See <a href="segmap.html">segmap.html</a>.
* @param com the common pin, numbered from 0-2. * @param com the common pin, numbered from 0-2.

View File

@ -50,17 +50,23 @@ void watch_enable_display(void) {
_watch_update_indicator_segments(); _watch_update_indicator_segments();
#endif #endif
EM_ASM({
#if defined(FORCE_CUSTOM_LCD_TYPE) #if defined(FORCE_CUSTOM_LCD_TYPE)
document.getElementById("classic").style.display = "none"; EM_ASM({document.getElementById("custom").style.display = "";});
EM_ASM({document.getElementById("classic").style.display = "none";});
#else #else
document.getElementById("custom").style.display = "none"; EM_ASM({document.getElementById("custom").style.display = "none";});
EM_ASM({document.getElementById("classic").style.display = "";});
#endif #endif
});
watch_clear_display(); watch_clear_display();
} }
void watch_disable_display(void) {
watch_clear_display();
EM_ASM({document.getElementById("classic").style.display = "none";});
EM_ASM({document.getElementById("custom").style.display = "none";});
}
void watch_set_pixel(uint8_t com, uint8_t seg) { void watch_set_pixel(uint8_t com, uint8_t seg) {
EM_ASM({ EM_ASM({
document.querySelectorAll("[data-com='" + $0 + "'][data-seg='" + $1 + "']") document.querySelectorAll("[data-com='" + $0 + "'][data-seg='" + $1 + "']")