diff --git a/src/atmega/Dockerfile b/firmware/atmega/Dockerfile similarity index 100% rename from src/atmega/Dockerfile rename to firmware/atmega/Dockerfile diff --git a/src/atmega/Makefile b/firmware/atmega/Makefile similarity index 71% rename from src/atmega/Makefile rename to firmware/atmega/Makefile index 7461fbe..af789b5 100644 --- a/src/atmega/Makefile +++ b/firmware/atmega/Makefile @@ -11,10 +11,11 @@ RM = rm -f BUILD_DIR = build OBJ_DIR = $(BUILD_DIR)/obj -SRCS_C = adc.c moisture.c main.c -OBJS = $(addprefix $(OBJ_DIR)/, $(SRCS_C:.c=.o)) +SRCS_C = source/adc.c source/moisture.c source/main.c -CFLAGS = -Wall -Os -DF_CPU=$(F_CPU) -mmcu=$(MCU) -I. +OBJS = $(addprefix $(OBJ_DIR)/, $(notdir $(SRCS_C:.c=.o))) + +CFLAGS = -Wall -Os -DF_CPU=$(F_CPU) -mmcu=$(MCU) -Iinclude LDFLAGS = -Wall -Os -mmcu=$(MCU) LIBS = -lm @@ -25,11 +26,12 @@ TARGET = $(BUILD_DIR)/$(EXEC).hex all: $(TARGET) $(shell mkdir -p $(OBJ_DIR)) +$(shell mkdir -p $(BUILD_DIR)) $(ELF_TARGET): $(OBJS) $(LD) $(LDFLAGS) $(OBJS) -o $@ $(LIBS) -$(OBJ_DIR)/%.o: %.c +$(OBJ_DIR)/%.o: source/%.c $(CC) $(CFLAGS) -c $< -o $@ $(TARGET): $(ELF_TARGET) diff --git a/src/atmega/build-atmega.sh b/firmware/atmega/build-atmega.sh similarity index 100% rename from src/atmega/build-atmega.sh rename to firmware/atmega/build-atmega.sh diff --git a/src/atmega/adc.h b/firmware/atmega/include/adc.h similarity index 100% rename from src/atmega/adc.h rename to firmware/atmega/include/adc.h diff --git a/src/atmega/config.h b/firmware/atmega/include/config.h similarity index 100% rename from src/atmega/config.h rename to firmware/atmega/include/config.h diff --git a/src/atmega/moisture.h b/firmware/atmega/include/moisture.h similarity index 100% rename from src/atmega/moisture.h rename to firmware/atmega/include/moisture.h diff --git a/src/atmega/adc.c b/firmware/atmega/source/adc.c similarity index 100% rename from src/atmega/adc.c rename to firmware/atmega/source/adc.c diff --git a/src/atmega/main.c b/firmware/atmega/source/main.c similarity index 90% rename from src/atmega/main.c rename to firmware/atmega/source/main.c index e6c4eb9..3d4ba9e 100644 --- a/src/atmega/main.c +++ b/firmware/atmega/source/main.c @@ -40,6 +40,8 @@ int main(void) { //TODO: send result to esp32 } + // readFromEsp() + // if esp tells to water plants: waterPlants() enterSleep(); } return 0; diff --git a/src/atmega/moisture.c b/firmware/atmega/source/moisture.c similarity index 100% rename from src/atmega/moisture.c rename to firmware/atmega/source/moisture.c