mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-14 01:38:01 +08:00
Fix arduino-xiao build and add GA test
This commit is contained in:
parent
f498d69b7d
commit
8e46e05e1b
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@ -62,6 +62,11 @@ jobs:
|
||||
- run: make vc22
|
||||
- run: make mingw
|
||||
- run: make mingw++
|
||||
arduino-xiao:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: make arduino-xiao
|
||||
arm:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
17
Makefile
17
Makefile
@ -140,6 +140,21 @@ mingw: Makefile mongoose.h $(SRCS)
|
||||
$(DOCKER) mdashnet/mingw x86_64-w64-mingw32-gcc $(SRCS) -W -Wall -Werror -I. $(DEFS) -lwsock32 -o $@.exe
|
||||
$(DOCKER) mdashnet/mingw wine64 $@.exe
|
||||
|
||||
arduino: ENV = -v $(CWD)/arduino:/root
|
||||
arduino:
|
||||
curl -sL http://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz | unxz | tar -xf -
|
||||
mv arduino-* $@
|
||||
$(DOCKER) mdashnet/cc2 ./arduino/arduino --pref "boardsmanager.additional.urls=https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json" --save-prefs
|
||||
$(DOCKER) mdashnet/cc2 ./arduino/arduino --pref "compiler.warning_level=all" --save-prefs
|
||||
$(DOCKER) mdashnet/cc2 ./arduino/arduino --install-boards Seeeduino:samd
|
||||
|
||||
arduino-xiao: ENV = -v $(CWD)/arduino:/root
|
||||
arduino-xiao: arduino
|
||||
rm -rf tmp; mkdir tmp
|
||||
cp examples/arduino/w5500/w5500.ino tmp/tmp.ino
|
||||
cp mongoose.c mongoose.h examples/arduino/w5500/mongoose_custom.h tmp/
|
||||
$(DOCKER) mdashnet/cc2 ./arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 tmp/tmp.ino
|
||||
|
||||
mingw++: Makefile mongoose.h $(SRCS)
|
||||
$(DOCKER) mdashnet/mingw x86_64-w64-mingw32-g++ $(SRCS) -W -Wall -Werror -I. $(DEFS) -lwsock32 -o $@.exe
|
||||
|
||||
@ -163,5 +178,5 @@ mongoose.h: $(HDRS) Makefile
|
||||
(cat src/license.h; echo; echo '#ifndef MONGOOSE_H'; echo '#define MONGOOSE_H'; echo; cat src/version.h ; echo; echo '#ifdef __cplusplus'; echo 'extern "C" {'; echo '#endif'; cat src/arch.h src/arch_*.h src/net_*.h src/config.h src/str.h src/fmt.h src/log.h src/timer.h src/fs.h src/util.h src/url.h src/iobuf.h src/base64.h src/md5.h src/sha1.h src/event.h src/net.h src/http.h src/ssi.h src/tls.h src/tls_mbed.h src/tls_openssl.h src/ws.h src/sntp.h src/mqtt.h src/dns.h src/json.h src/rpc.h mip/mip.h mip/driver_*.h | sed -e '/keep/! s,#include ".*,,' -e 's,^#pragma once,,'; echo; echo '#ifdef __cplusplus'; echo '}'; echo '#endif'; echo '#endif // MONGOOSE_H')> $@
|
||||
|
||||
clean:
|
||||
rm -rf $(PROG) *.exe *.o *.dSYM *_test* ut fuzzer *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb slow-unit* _CL_* infer-out data.txt crash-* test/packed_fs.c pack
|
||||
rm -rf $(PROG) *.exe *.o *.dSYM *_test* ut fuzzer *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb slow-unit* _CL_* infer-out data.txt crash-* test/packed_fs.c pack arduino tmp
|
||||
@for X in $(EXAMPLES); do $(MAKE) -C $$X clean; done
|
||||
|
@ -4,9 +4,11 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#define MG_ARCH MG_ARCH_CUSTOM
|
||||
#define MG_ENABLE_SOCKET 0
|
||||
#define MG_ENABLE_MIP 1
|
||||
#define mkdir(a, b) (-1)
|
||||
//#define MG_ENABLE_LOG 0
|
||||
|
@ -22,12 +22,10 @@ void setup() {
|
||||
delay(3000);
|
||||
MG_INFO(("Starting TCP/IP stack..."));
|
||||
|
||||
struct mip_if mif = {
|
||||
.mac = {0, 0, 1, 2, 3, 5},
|
||||
.use_dhcp = true,
|
||||
.driver = &mip_driver_w5500,
|
||||
.driver_data = &spi,
|
||||
};
|
||||
struct mip_if mif = {.mac = {0, 0, 1, 2, 3, 5}};
|
||||
mif.use_dhcp = true;
|
||||
mif.driver = &mip_driver_w5500;
|
||||
mif.driver_data = &spi;
|
||||
mip_init(&mgr, &mif);
|
||||
|
||||
// Start a 5 sec timer, print status message periodically
|
||||
|
Loading…
x
Reference in New Issue
Block a user