]> git.earman.xyz Git - sensor-watch.git/commitdiff
Added watch_disable_display
authorDavid Volovskiy <devolov@gmail.com>
Sat, 23 Aug 2025 15:31:59 +0000 (11:31 -0400)
committerDavid Volovskiy <devolov@gmail.com>
Sat, 23 Aug 2025 15:31:59 +0000 (11:31 -0400)
watch-library/hardware/watch/watch_slcd.c
watch-library/shared/watch/watch_slcd.h
watch-library/simulator/watch/watch_slcd.c

index db6b1942c5690a359f2a49952444c33b1a6d07c3..457962cb95a3394d2f23ef2d3f3a7a77944e908a 100644 (file)
@@ -260,6 +260,10 @@ void watch_enable_display(void) {
     slcd_enable();
 }
 
+void watch_disable_display(void) {
+    slcd_disable();
+}
+
 inline void watch_set_pixel(uint8_t com, uint8_t seg) {
     slcd_set_segment(com, seg);
 }
index b94b3f804e507321abd4b36fadb62ca3e997a2bb..43a4f849bd01053b67e1f00242e6f08c4ec92828 100644 (file)
@@ -98,6 +98,10 @@ typedef enum {
   */
 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.
   *        See <a href="segmap.html">segmap.html</a>.
   * @param com the common pin, numbered from 0-2.
index 34d8878c4f05c9613b86ba0b4acf81fc1ca2a8fa..1990e90c416898e6ef0e9bdeaa94eebf4f3c1c60 100644 (file)
@@ -50,17 +50,23 @@ void watch_enable_display(void) {
     _watch_update_indicator_segments();
 #endif
 
-    EM_ASM({
 #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
-        document.getElementById("custom").style.display = "none";
+    EM_ASM({document.getElementById("custom").style.display = "none";});
+    EM_ASM({document.getElementById("classic").style.display = "";});
 #endif
-    });
 
     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) {
     EM_ASM({
         document.querySelectorAll("[data-com='" + $0 + "'][data-seg='" + $1 + "']")