Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ endfunction()
picowota_retrieve_variable(PICOWOTA_WIFI_SSID false)
picowota_retrieve_variable(PICOWOTA_WIFI_PASS true)
picowota_retrieve_variable(PICOWOTA_WIFI_AP false)
picowota_retrieve_variable(PICOWOTA_ENTRY_PIN false)

if ((NOT PICOWOTA_WIFI_SSID) OR (NOT PICOWOTA_WIFI_PASS))
message(FATAL_ERROR
Expand All @@ -107,6 +108,11 @@ if (PICOWOTA_WIFI_AP)
message("Building in WiFi AP mode.")
endif()

if (PICOWOTA_ENTRY_PIN)
target_compile_definitions(picowota PUBLIC PICOWOTA_ENTRY_PIN=${PICOWOTA_ENTRY_PIN})
message("Building with custom PICOWOTA_ENTRY_PIN.")
endif()

# Provide a helper to build a standalone target
function(picowota_build_standalone NAME)
get_target_property(PICOWOTA_SRC_DIR picowota SOURCE_DIR)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ as CMake variables:
PICOWOTA_WIFI_SSID # The WiFi network SSID
PICOWOTA_WIFI_PASS # The WiFi network password
PICOWOTA_WIFI_AP # Optional; 0 = connect to the network, 1 = create it
PICOWOTA_ENTRY_PIN # Optional; default use pin 15, you can change it
```

Then, you can either build just your standalone app binary (suitable for
Expand Down
4 changes: 4 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ struct event {
};
};

#ifndef PICOWOTA_ENTRY_PIN
#define BOOTLOADER_ENTRY_PIN 15
#else
#define BOOTLOADER_ENTRY_PIN PICOWOTA_ENTRY_PIN
#endif

#define TCP_PORT 4242

Expand Down