]> git.earman.xyz Git - sensor-watch.git/commitdiff
force a choice of display type at build time
authorJoey Castillo <joeycastillo@utexas.edu>
Sat, 17 May 2025 16:40:29 +0000 (12:40 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Sat, 17 May 2025 16:40:39 +0000 (12:40 -0400)
Makefile
gossamer

index 34fccb02f32ae4674c68507d2f711210f16bc885..7a2d3d53d213365aa79bd399fe4338b6ea066166 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,9 +8,8 @@ GOSSAMER_PATH=gossamer
 # - sensorwatch_red (also known as Sensor Watch Lite)
 # BOARD=sensorwatch_pro
 
-# Sensor Watch will detect the display, unless you are debugging over USB.
-# If you need to force a specific display, set this to the type you want, CLASSIC or CUSTOM
-FORCE_DISPLAY_TYPE=CLASSIC
+# Set this to the type of display in your watch: classic or custom. Commented out to force a choice when building.
+# DISPLAY=classic
 
 # End of user configurable options.
 
@@ -26,15 +25,20 @@ define n
 endef
 
 ifndef BOARD
-$(error Build failed: BOARD not defined. Use one of the four options below, depending on your hardware:$n$n    make BOARD=sensorwatch_red$n    make BOARD=sensorwatch_green$n    make BOARD=sensorwatch_blue$n    make BOARD=sensorwatch_pro$n$n)
+  $(error Build failed: BOARD not defined. Use one of the four options below, depending on your hardware:$n$n    make BOARD=sensorwatch_red DISPLAY=display_type$n    make BOARD=sensorwatch_blue DISPLAY=display_type$n    make BOARD=sensorwatch_pro DISPLAY=display_type$n$n)
 endif
 
-ifdef FORCE_DISPLAY_TYPE
-  ifeq ($(FORCE_DISPLAY_TYPE), CUSTOM)
+ifndef DISPLAY
+  $(error Build failed: DISPLAY not defined. Use one of the options below, depending on your hardware:$n$n    make BOARD=board_type DISPLAY=classic$n    make BOARD=board_type DISPLAY=custom$n$n)
+else
+  ifeq ($(DISPLAY), custom)
     DEFINES += -DFORCE_CUSTOM_LCD_TYPE
-  endif
-  ifeq ($(FORCE_DISPLAY_TYPE), CLASSIC)
+  else ifeq ($(DISPLAY), classic)
     DEFINES += -DFORCE_CLASSIC_LCD_TYPE
+  else ifeq ($(DISPLAY), autodetect)
+    $(warning WARNING: LCD autodetection is experimental and not reliable! We suggest specifying DISPLAY=classic or DISPLAY=custom for reliable operation.)
+  else
+    $(error Build failed: invalid DISPLAY type. Use one of the options below, depending on your hardware:$n$n    make BOARD=board_type DISPLAY=classic$n    make BOARD=board_type DISPLAY=custom$n$n)
   endif
 endif
 
index 2d79f337c7a6d928830ded91f5d998582f8ea58a..422b34606669523ab7fa44499f6f58f6cb5b49e9 160000 (submodule)
--- a/gossamer
+++ b/gossamer
@@ -1 +1 @@
-Subproject commit 2d79f337c7a6d928830ded91f5d998582f8ea58a
+Subproject commit 422b34606669523ab7fa44499f6f58f6cb5b49e9