From dbd509048e21d96169bccaaff1023c3fb442d89b Mon Sep 17 00:00:00 2001 From: Mateusz Lubecki Date: Sun, 24 Apr 2022 19:32:38 +0200 Subject: [PATCH] configuration moved to separate directory --- STM32L476_ParaMETEO/src/subdir.mk | 2 +- STM32L476_ParaMETEO/system/src/aprs/subdir.mk | 2 +- .../system/src/cmsis/stm32l4xx/subdir.mk | 4 +-- .../system/src/davis_vantage/subdir.mk | 2 +- STM32L476_ParaMETEO/system/src/diag/subdir.mk | 2 +- .../system/src/drivers/l4/subdir.mk | 2 +- .../system/src/drivers/subdir.mk | 2 +- .../system/src/modbus_rtu/subdir.mk | 2 +- .../system/src/stm32l4-hal-driver/subdir.mk | 2 +- .../system/src/umb_master/subdir.mk | 2 +- .../system/src/ve_direct_protocol/subdir.mk | 2 +- include/{ => etc}/pwr_save_configuration.h | 0 .../etc}/rtu_configuration.h | 0 include/etc/serial_config.h | 26 +++++++++++++++++++ include/main.h | 2 +- include/rte_rtu.h | 4 +-- src/packet_tx_handler.c | 2 +- src/pwr_save.c | 2 +- system/include/drivers/serial.h | 17 ++---------- system/include/modbus_rtu/rtu_pool_queue_t.h | 2 +- .../include/modbus_rtu/rtu_register_data_t.h | 2 +- system/src/modbus_rtu/rtu_getters.c | 2 +- system/src/modbus_rtu/rtu_serial_io.c | 3 ++- 23 files changed, 49 insertions(+), 37 deletions(-) rename include/{ => etc}/pwr_save_configuration.h (100%) rename {system/include/modbus_rtu => include/etc}/rtu_configuration.h (100%) create mode 100644 include/etc/serial_config.h diff --git a/STM32L476_ParaMETEO/src/subdir.mk b/STM32L476_ParaMETEO/src/subdir.mk index 7e404e5..63a9a5f 100644 --- a/STM32L476_ParaMETEO/src/subdir.mk +++ b/STM32L476_ParaMETEO/src/subdir.mk @@ -98,7 +98,7 @@ C_DEPS += \ src/%.o: ../src/%.c @echo 'Building file: $<' @echo 'Invoking: Cross ARM C Compiler' - arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" + arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/STM32L476_ParaMETEO/system/src/aprs/subdir.mk b/STM32L476_ParaMETEO/system/src/aprs/subdir.mk index 9571d57..2ba6ba3 100644 --- a/STM32L476_ParaMETEO/system/src/aprs/subdir.mk +++ b/STM32L476_ParaMETEO/system/src/aprs/subdir.mk @@ -44,7 +44,7 @@ C_DEPS += \ system/src/aprs/%.o: ../system/src/aprs/%.c @echo 'Building file: $<' @echo 'Invoking: Cross ARM C Compiler' - arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" + arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/STM32L476_ParaMETEO/system/src/cmsis/stm32l4xx/subdir.mk b/STM32L476_ParaMETEO/system/src/cmsis/stm32l4xx/subdir.mk index 5acd632..a7dba7d 100644 --- a/STM32L476_ParaMETEO/system/src/cmsis/stm32l4xx/subdir.mk +++ b/STM32L476_ParaMETEO/system/src/cmsis/stm32l4xx/subdir.mk @@ -27,14 +27,14 @@ C_DEPS += \ system/src/cmsis/stm32l4xx/%.o: ../system/src/cmsis/stm32l4xx/%.S @echo 'Building file: $<' @echo 'Invoking: Cross ARM GNU Assembler' - arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -x assembler-with-cpp -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -USTM32F10X_MD_VL -I"../include" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" + arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -x assembler-with-cpp -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -USTM32F10X_MD_VL -I"../include" -I"../include/etc" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' system/src/cmsis/stm32l4xx/%.o: ../system/src/cmsis/stm32l4xx/%.c @echo 'Building file: $<' @echo 'Invoking: Cross ARM C Compiler' - arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" + arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/STM32L476_ParaMETEO/system/src/davis_vantage/subdir.mk b/STM32L476_ParaMETEO/system/src/davis_vantage/subdir.mk index 3fcb45d..6918645 100644 --- a/STM32L476_ParaMETEO/system/src/davis_vantage/subdir.mk +++ b/STM32L476_ParaMETEO/system/src/davis_vantage/subdir.mk @@ -20,7 +20,7 @@ C_DEPS += \ system/src/davis_vantage/%.o: ../system/src/davis_vantage/%.c @echo 'Building file: $<' @echo 'Invoking: Cross ARM C Compiler' - arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" + arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/STM32L476_ParaMETEO/system/src/diag/subdir.mk b/STM32L476_ParaMETEO/system/src/diag/subdir.mk index 5f12f3c..6715875 100644 --- a/STM32L476_ParaMETEO/system/src/diag/subdir.mk +++ b/STM32L476_ParaMETEO/system/src/diag/subdir.mk @@ -20,7 +20,7 @@ C_DEPS += \ system/src/diag/%.o: ../system/src/diag/%.c @echo 'Building file: $<' @echo 'Invoking: Cross ARM C Compiler' - arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" + arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/STM32L476_ParaMETEO/system/src/drivers/l4/subdir.mk b/STM32L476_ParaMETEO/system/src/drivers/l4/subdir.mk index 742139f..1f42ab3 100644 --- a/STM32L476_ParaMETEO/system/src/drivers/l4/subdir.mk +++ b/STM32L476_ParaMETEO/system/src/drivers/l4/subdir.mk @@ -23,7 +23,7 @@ C_DEPS += \ system/src/drivers/l4/%.o: ../system/src/drivers/l4/%.c @echo 'Building file: $<' @echo 'Invoking: Cross ARM C Compiler' - arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" + arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/STM32L476_ParaMETEO/system/src/drivers/subdir.mk b/STM32L476_ParaMETEO/system/src/drivers/subdir.mk index 2a149c7..a27fd1a 100644 --- a/STM32L476_ParaMETEO/system/src/drivers/subdir.mk +++ b/STM32L476_ParaMETEO/system/src/drivers/subdir.mk @@ -29,7 +29,7 @@ C_DEPS += \ system/src/drivers/%.o: ../system/src/drivers/%.c @echo 'Building file: $<' @echo 'Invoking: Cross ARM C Compiler' - arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" + arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/STM32L476_ParaMETEO/system/src/modbus_rtu/subdir.mk b/STM32L476_ParaMETEO/system/src/modbus_rtu/subdir.mk index a2a772a..f31248c 100644 --- a/STM32L476_ParaMETEO/system/src/modbus_rtu/subdir.mk +++ b/STM32L476_ParaMETEO/system/src/modbus_rtu/subdir.mk @@ -26,7 +26,7 @@ C_DEPS += \ system/src/modbus_rtu/%.o: ../system/src/modbus_rtu/%.c @echo 'Building file: $<' @echo 'Invoking: Cross ARM C Compiler' - arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" + arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/STM32L476_ParaMETEO/system/src/stm32l4-hal-driver/subdir.mk b/STM32L476_ParaMETEO/system/src/stm32l4-hal-driver/subdir.mk index 89c32d4..908d4a5 100644 --- a/STM32L476_ParaMETEO/system/src/stm32l4-hal-driver/subdir.mk +++ b/STM32L476_ParaMETEO/system/src/stm32l4-hal-driver/subdir.mk @@ -329,7 +329,7 @@ C_DEPS += \ system/src/stm32l4-hal-driver/%.o: ../system/src/stm32l4-hal-driver/%.c @echo 'Building file: $<' @echo 'Invoking: Cross ARM C Compiler' - arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" + arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/STM32L476_ParaMETEO/system/src/umb_master/subdir.mk b/STM32L476_ParaMETEO/system/src/umb_master/subdir.mk index d08faa5..6b66f11 100644 --- a/STM32L476_ParaMETEO/system/src/umb_master/subdir.mk +++ b/STM32L476_ParaMETEO/system/src/umb_master/subdir.mk @@ -26,7 +26,7 @@ C_DEPS += \ system/src/umb_master/%.o: ../system/src/umb_master/%.c @echo 'Building file: $<' @echo 'Invoking: Cross ARM C Compiler' - arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" + arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/STM32L476_ParaMETEO/system/src/ve_direct_protocol/subdir.mk b/STM32L476_ParaMETEO/system/src/ve_direct_protocol/subdir.mk index 449e80d..f14e1dd 100644 --- a/STM32L476_ParaMETEO/system/src/ve_direct_protocol/subdir.mk +++ b/STM32L476_ParaMETEO/system/src/ve_direct_protocol/subdir.mk @@ -17,7 +17,7 @@ C_DEPS += \ system/src/ve_direct_protocol/%.o: ../system/src/ve_direct_protocol/%.c @echo 'Building file: $<' @echo 'Invoking: Cross ARM C Compiler' - arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" + arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DSTM32L471xx -DPARAMETEO -USTM32F10X_MD_VL -UPARATNC_HWREV_A -UPARATNC_HWREV_B -UPARATNC_HWREV_C -I"../include" -I"../include/etc" -I"../system/include/tiny-aes" -I"../system/include/aprs" -I"../system/include" -I"../system/include/cmsis/stm32l4xx" -I"../system/include/cmsis/stm32l4xx/device" -I"../system/include/stm32l4-hal-driver" -I"../system/include/stm32l4-hal-driver/Legacy" -std=gnu11 -Wunused-function -Wall -Wa,-adhlns="$@.lst" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/include/pwr_save_configuration.h b/include/etc/pwr_save_configuration.h similarity index 100% rename from include/pwr_save_configuration.h rename to include/etc/pwr_save_configuration.h diff --git a/system/include/modbus_rtu/rtu_configuration.h b/include/etc/rtu_configuration.h similarity index 100% rename from system/include/modbus_rtu/rtu_configuration.h rename to include/etc/rtu_configuration.h diff --git a/include/etc/serial_config.h b/include/etc/serial_config.h new file mode 100644 index 0000000..7b230a9 --- /dev/null +++ b/include/etc/serial_config.h @@ -0,0 +1,26 @@ +/* + * serial_config.h + * + * Created on: Apr 24, 2022 + * Author: mateusz + */ + +#ifndef SERIAL_CONFIG_H_ +#define SERIAL_CONFIG_H_ + +#define RX_BUFFER_1_LN 384 +#define TX_BUFFER_1_LN 384 + +#define RX_BUFFER_2_LN 96 +#define TX_BUFFER_2_LN 96 + +#define RX_BUFFER_3_LN 768 +#define TX_BUFFER_3_LN 768 + +#define SEPARATE_RX_BUFF +#define SEPARATE_TX_BUFF + +#define SRL_TX_DELAY_IN_MS 30 +#define SRL_DEFAULT_RX_TIMEOUT_IN_MS 1200 + +#endif /* SERIAL_CONFIG_H_ */ diff --git a/include/main.h b/include/main.h index bae43df..dcd8e40 100644 --- a/include/main.h +++ b/include/main.h @@ -8,7 +8,7 @@ #include "config_data.h" #define SW_VER "EA05" -#define SW_DATE "22042022" +#define SW_DATE "24042022" #define SYSTICK_TICKS_PER_SECONDS 100 #define SYSTICK_TICKS_PERIOD 10 diff --git a/include/rte_rtu.h b/include/rte_rtu.h index fccd388..f8bb5bb 100644 --- a/include/rte_rtu.h +++ b/include/rte_rtu.h @@ -9,14 +9,12 @@ #define RTE_RTU_H_ #include "station_config.h" +#include "../include/etc/rtu_configuration.h" -//#ifdef _MODBUS_RTU -#include "modbus_rtu/rtu_configuration.h" #include "modbus_rtu/rtu_register_data_t.h" #include "modbus_rtu/rtu_exception_t.h" #include "modbus_rtu/rtu_getters.h" #include "modbus_rtu/rtu_pool_queue_t.h" -//#endif #include diff --git a/src/packet_tx_handler.c b/src/packet_tx_handler.c index 983ec21..d4df444 100644 --- a/src/packet_tx_handler.c +++ b/src/packet_tx_handler.c @@ -15,7 +15,7 @@ #include "./umb_master/umb_master.h" -#include "./modbus_rtu/rtu_configuration.h" +#include "../include/etc/rtu_configuration.h" #ifdef STM32L471xx #include "aprsis.h" diff --git a/src/pwr_save.c b/src/pwr_save.c index 5a02d83..66ad623 100644 --- a/src/pwr_save.c +++ b/src/pwr_save.c @@ -37,7 +37,7 @@ #define ALL_STATES_BITMASK (0xFF << 2) -#define MINIMUM_SENSEFUL_VBATT_VOLTAGE 1234u +#define MINIMUM_SENSEFUL_VBATT_VOLTAGE 678u #if defined(STM32L471xx) diff --git a/system/include/drivers/serial.h b/system/include/drivers/serial.h index 6d7c6a2..31989cc 100644 --- a/system/include/drivers/serial.h +++ b/system/include/drivers/serial.h @@ -1,6 +1,8 @@ #ifndef __SERIAL_H #define __SERIAL_H +#include "../include/etc/serial_config.h" + #include "stdint.h" #ifdef STM32F10X_MD_VL #include @@ -11,21 +13,6 @@ #include #endif -#define RX_BUFFER_1_LN 384 -#define TX_BUFFER_1_LN 384 - -#define RX_BUFFER_2_LN 96 -#define TX_BUFFER_2_LN 96 - -#define RX_BUFFER_3_LN 768 -#define TX_BUFFER_3_LN 768 - -#define SEPARATE_RX_BUFF -#define SEPARATE_TX_BUFF - -#define SRL_TX_DELAY_IN_MS 30 -#define SRL_DEFAULT_RX_TIMEOUT_IN_MS 1200 - #define SRL_TIMEOUT_ENABLE 1 #define SRL_TIMEOUT_DISABLE 0 diff --git a/system/include/modbus_rtu/rtu_pool_queue_t.h b/system/include/modbus_rtu/rtu_pool_queue_t.h index 973c9a4..ba79f4e 100644 --- a/system/include/modbus_rtu/rtu_pool_queue_t.h +++ b/system/include/modbus_rtu/rtu_pool_queue_t.h @@ -10,7 +10,7 @@ #include -#include "modbus_rtu/rtu_configuration.h" +#include "../include/etc/rtu_configuration.h" /** * This type stores the queue of RTU functions to be queued diff --git a/system/include/modbus_rtu/rtu_register_data_t.h b/system/include/modbus_rtu/rtu_register_data_t.h index d32e62f..e4caa80 100644 --- a/system/include/modbus_rtu/rtu_register_data_t.h +++ b/system/include/modbus_rtu/rtu_register_data_t.h @@ -10,7 +10,7 @@ #include -#include "modbus_rtu/rtu_configuration.h" +#include "../include/etc/rtu_configuration.h" typedef struct rtu_register_data { diff --git a/system/src/modbus_rtu/rtu_getters.c b/system/src/modbus_rtu/rtu_getters.c index dca5333..d36bbf2 100644 --- a/system/src/modbus_rtu/rtu_getters.c +++ b/system/src/modbus_rtu/rtu_getters.c @@ -13,7 +13,7 @@ #include "modbus_rtu/rtu_return_values.h" #include "modbus_rtu/rtu_register_data_t.h" -#include "modbus_rtu/rtu_configuration.h" +#include "../include/etc/rtu_configuration.h" #include "rte_wx.h" #include "rte_rtu.h" diff --git a/system/src/modbus_rtu/rtu_serial_io.c b/system/src/modbus_rtu/rtu_serial_io.c index 543587d..b5c60ab 100644 --- a/system/src/modbus_rtu/rtu_serial_io.c +++ b/system/src/modbus_rtu/rtu_serial_io.c @@ -5,7 +5,8 @@ * Author: mateusz */ -#include "modbus_rtu/rtu_configuration.h" +#include "../include/etc/rtu_configuration.h" + #include "modbus_rtu/rtu_serial_io.h" #include "modbus_rtu/rtu_crc.h" #include "modbus_rtu/rtu_parser.h"