|
@@ -35,7 +35,6 @@ pico_sdk_init()
|
35
|
35
|
|
36
|
36
|
add_executable(picowota
|
37
|
37
|
main.c
|
38
|
|
- creds.c
|
39
|
38
|
tcp_comm.c
|
40
|
39
|
)
|
41
|
40
|
|
|
@@ -72,6 +71,27 @@ target_link_libraries(picowota
|
72
|
71
|
picowota_reboot
|
73
|
72
|
)
|
74
|
73
|
|
|
74
|
+if (DEFINED ENV{PICOWOTA_WIFI_SSID} AND (NOT PICOWOTA_WIFI_SSID))
|
|
75
|
+ set(PICOWOTA_WIFI_SSID $ENV{PICOWOTA_WIFI_SSID})
|
|
76
|
+ message("Using PICOWOTA_WIFI_SSID from environment ('${PICOWOTA_WIFI_SSID}')")
|
|
77
|
+endif ()
|
|
78
|
+
|
|
79
|
+if (DEFINED ENV{PICOWOTA_WIFI_PASS} AND (NOT PICOWOTA_WIFI_PASS))
|
|
80
|
+ set(PICOWOTA_WIFI_PASS $ENV{PICOWOTA_WIFI_PASS})
|
|
81
|
+ message("Using PICOWOTA_WIFI_PASS from environment (hidden)")
|
|
82
|
+endif ()
|
|
83
|
+
|
|
84
|
+if ((NOT PICOWOTA_WIFI_SSID) OR (NOT PICOWOTA_WIFI_PASS))
|
|
85
|
+ message(FATAL_ERROR
|
|
86
|
+ "WiFi SSID/Pass not set, please set PICOWOTA_WIFI_SSID/PICOWOTA_WIFI_PASS."
|
|
87
|
+ )
|
|
88
|
+endif ()
|
|
89
|
+
|
|
90
|
+# TODO: This causes a full rebuild if they change, configure_file might
|
|
91
|
+# be better.
|
|
92
|
+target_compile_definitions(picowota PUBLIC PICOWOTA_WIFI_SSID=${PICOWOTA_WIFI_SSID})
|
|
93
|
+target_compile_definitions(picowota PUBLIC PICOWOTA_WIFI_PASS=${PICOWOTA_WIFI_PASS})
|
|
94
|
+
|
75
|
95
|
# Provide a helper to build a standalone target
|
76
|
96
|
function(picowota_build_standalone NAME)
|
77
|
97
|
get_target_property(PICOWOTA_SRC_DIR picowota SOURCE_DIR)
|