]> git.earman.xyz Git - sensor-watch.git/commitdiff
don't run LCD discovery if display is already running
authorJoey Castillo <joeycastillo@utexas.edu>
Sat, 15 Mar 2025 13:35:58 +0000 (09:35 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Sat, 15 Mar 2025 13:35:58 +0000 (09:35 -0400)
watch-library/hardware/watch/watch_slcd.c

index 0d124171e0ea2bfb707cb9898ac4d20a7e792d98..13df0babdafa3ca27fbc146b8d0c51b5363d9658 100644 (file)
@@ -128,6 +128,10 @@ watch_lcd_type_t watch_get_lcd_type(void) {
 }
 
 void watch_enable_display(void) {
+    // No need to do anything if the display is already enabled.
+    /// TODO: Wrap this in a gossamer call.
+    if (SLCD->CTRLA.bit.ENABLE) return;
+
     watch_discover_lcd_type();
 
     HAL_GPIO_SLCD0_pmuxen(HAL_GPIO_PMUX_B);