From bfbcc309df5953811e772e121d9fbd47bdae7177 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Tue, 16 Feb 2021 10:37:09 +0100 Subject: [PATCH] add network abstraction layer --- cube/Makefile | 9 +++++++-- cube/User/Inc/networkAbstractionLayer.h | 9 +++++++++ cube/User/Src/main2.c | 7 +++++-- cube/User/Src/networkAbstractionLayer.c | 8 ++++++++ 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 cube/User/Inc/networkAbstractionLayer.h create mode 100644 cube/User/Src/networkAbstractionLayer.c diff --git a/cube/Makefile b/cube/Makefile index 48e001f..be3632e 100644 --- a/cube/Makefile +++ b/cube/Makefile @@ -15,7 +15,11 @@ # ------------------------------------------------ -NETWORK = LAN +# LAN = 1 +# WiFi = 2 +# GSM = 3 +NETWORK = 1 + ###################################### # target @@ -54,6 +58,7 @@ User/Src/sha256.c \ User/Src/show.c \ User/Src/utils.c \ User/Src/wizHelper.c \ +User/Src/networkAbstractionLayer.c \ hottislib/PontCoopScheduler.c \ Core/Src/main.c \ Core/Src/gpio.c \ @@ -153,7 +158,7 @@ C_INCLUDES = \ # compile gcc flags ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -Werror -fdata-sections -ffunction-sections -CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -DNETWORK="\"$(NETWORK)\"" -Wall -Werror -fdata-sections -ffunction-sections +CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -DNETWORK=$(NETWORK) -Wall -Werror -fdata-sections -ffunction-sections ifeq ($(DEBUG), 1) CFLAGS += -g -gdwarf-2 diff --git a/cube/User/Inc/networkAbstractionLayer.h b/cube/User/Inc/networkAbstractionLayer.h new file mode 100644 index 0000000..e11e821 --- /dev/null +++ b/cube/User/Inc/networkAbstractionLayer.h @@ -0,0 +1,9 @@ +#ifndef _NETWORK_ABSTRACTION_LAYER_H_ +#define _NETWORK_ABSTRACTION_LAYER_H_ + + + +void networkInit(); + + +#endif /* _NETWORK_ABSTRACTION_LAYER_H_ */ diff --git a/cube/User/Src/main2.c b/cube/User/Src/main2.c index 080d672..69b5cb2 100644 --- a/cube/User/Src/main2.c +++ b/cube/User/Src/main2.c @@ -13,11 +13,14 @@ #include #include #include -#include +#include #include #include + + + void my_setup_1() { schInit(); logInit(); @@ -37,7 +40,7 @@ void my_setup_2() { configInit(); - wizInit(); + networkInit(); counterInit(); diff --git a/cube/User/Src/networkAbstractionLayer.c b/cube/User/Src/networkAbstractionLayer.c new file mode 100644 index 0000000..42bbe01 --- /dev/null +++ b/cube/User/Src/networkAbstractionLayer.c @@ -0,0 +1,8 @@ +#include + +#include + + +void networkInit() { + wizInit(); +} \ No newline at end of file