diff options
Diffstat (limited to 'stm32f091')
-rw-r--r-- | stm32f091/consts.h | 5 | ||||
-rw-r--r-- | stm32f091/esp8266.c | 2 | ||||
-rw-r--r-- | stm32f091/readme.md | 3 | ||||
-rw-r--r-- | stm32f091/util.h | 4 | ||||
-rw-r--r-- | stm32f091/wifi.def.h | 7 |
5 files changed, 10 insertions, 11 deletions
diff --git a/stm32f091/consts.h b/stm32f091/consts.h index 3d2ef5a..6d5b8d2 100644 --- a/stm32f091/consts.h +++ b/stm32f091/consts.h @@ -1,9 +1,10 @@ #pragma once -#include "wifi.h" +#include "../shared/wifi.h" +#include "util.h" -#define WS_SERVER_PORT "80" #define WS_SERVER_MAX_CHANNELS 4 +#define WS_SERVER_PORT_STR WS_MTS(WS_SERVER_PORT) #define WS_DMA_RX_BUFFER_SIZE 100 #define WS_DMA_TX_BUFFER_SIZE 1024 diff --git a/stm32f091/esp8266.c b/stm32f091/esp8266.c index 74ec347..8ff9547 100644 --- a/stm32f091/esp8266.c +++ b/stm32f091/esp8266.c @@ -77,7 +77,7 @@ void ws_esp8266_ap_client_mode() { void ws_esp8266_start_tcp_server() { ws_esp8266_send_seq("AT+CIPSERVER=0\r\n"); // stop tcp server (if running) ws_esp8266_send_seq("AT+CIPMUX=1\r\n"); // enable multiplexing (allow multiple connections) - ws_esp8266_send_seq("AT+CIPSERVER=1," WS_SERVER_PORT "\r\n"); // start tcp server + ws_esp8266_send_seq("AT+CIPSERVER=1," WS_SERVER_PORT_STR "\r\n"); // start tcp server } void ws_esp8266_set_mac() { diff --git a/stm32f091/readme.md b/stm32f091/readme.md index d2758b5..e6af60f 100644 --- a/stm32f091/readme.md +++ b/stm32f091/readme.md @@ -3,7 +3,8 @@ - uses make - make sure to initialize the git submodules - all warnings from source files in the lib/ subfolder are hidden -- copy wifi.def.h to wifi.h and edit the network credentials +- copy ../shared/wifi.def.h to ../shared/wifi.h and edit the network + credentials - the initialization code is broken in some way which means that a soft reset is required for the uart dma to work, either (a) press the reset button on the development board after plugging in, or (b) run `st-flash reset` after diff --git a/stm32f091/util.h b/stm32f091/util.h index 11bee6f..9c15f8b 100644 --- a/stm32f091/util.h +++ b/stm32f091/util.h @@ -8,6 +8,10 @@ #include "setup.h" #include "../shared/util.h" +// macro to string macro's +#define WS_MTS_EXPAND(x) #x +#define WS_MTS(x) WS_MTS_EXPAND(x) + #define WS_DBG_TTY_COLOR_BLK 0x0 #define WS_DBG_TTY_COLOR_RED 0x1 #define WS_DBG_TTY_COLOR_GRN 0x2 diff --git a/stm32f091/wifi.def.h b/stm32f091/wifi.def.h deleted file mode 100644 index 61e1706..0000000 --- a/stm32f091/wifi.def.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#define WS_ESP8266_WLAN_SSID "Test" -#define WS_ESP8266_WLAN_PASSWD "12345678" -// #define WS_ESP8266_WLAN_MAC "f2:9b:89:47:c4:f3" -// #define WS_ESP8266_WLAN_IP "192.168.2.69" - |