From ef8422eaa5273b9b0d2bf652650e24cefdd800c5 Mon Sep 17 00:00:00 2001 From: Yaroslav Svitlytskyi Date: Mon, 1 Apr 2024 13:58:47 +0200 Subject: [PATCH] fix: fixed bugs --- CMakeLists.txt | 8 +++----- Core/External/Proto/Buffer/Request/request_buffer.cpp | 2 +- Core/External/Proto/Buffer/Request/request_buffer.h | 4 ++-- Core/External/Proto/Buffer/Response/response_buffer.cpp | 9 ++------- Core/External/Proto/Buffer/Response/response_buffer.h | 4 ++-- Core/External/Tools/Sequence/sequence.h | 1 + Core/Inc/main.h | 2 +- Core/Src/main.cpp | 4 ++-- ThirdParty/{ => Inc}/Defines.h | 0 ThirdParty/{ => Inc}/Errors.h | 0 ThirdParty/{ => Inc}/FieldStringBytes.h | 0 ThirdParty/{ => Inc}/Fields.h | 0 ThirdParty/{ => Inc}/MessageInterface.h | 0 ThirdParty/{ => Inc}/MessageSizeCalculator.h | 0 ThirdParty/{ => Inc}/ReadBufferFixedSize.h | 0 ThirdParty/{ => Inc}/ReadBufferInterface.h | 0 ThirdParty/{ => Inc}/ReadBufferSection.h | 0 ThirdParty/{ => Inc}/RepeatedField.h | 0 ThirdParty/{ => Inc}/RepeatedFieldFixedSize.h | 0 ThirdParty/{ => Inc}/WireFormatter.h | 0 ThirdParty/{ => Inc}/WriteBufferFixedSize.h | 0 ThirdParty/{ => Inc}/WriteBufferInterface.h | 0 ThirdParty/{ => Src}/Fields.cpp | 0 ThirdParty/{ => Src}/MessageInterface.cpp | 0 ThirdParty/{ => Src}/ReadBufferSection.cpp | 0 25 files changed, 14 insertions(+), 20 deletions(-) rename ThirdParty/{ => Inc}/Defines.h (100%) rename ThirdParty/{ => Inc}/Errors.h (100%) rename ThirdParty/{ => Inc}/FieldStringBytes.h (100%) rename ThirdParty/{ => Inc}/Fields.h (100%) rename ThirdParty/{ => Inc}/MessageInterface.h (100%) rename ThirdParty/{ => Inc}/MessageSizeCalculator.h (100%) rename ThirdParty/{ => Inc}/ReadBufferFixedSize.h (100%) rename ThirdParty/{ => Inc}/ReadBufferInterface.h (100%) rename ThirdParty/{ => Inc}/ReadBufferSection.h (100%) rename ThirdParty/{ => Inc}/RepeatedField.h (100%) rename ThirdParty/{ => Inc}/RepeatedFieldFixedSize.h (100%) rename ThirdParty/{ => Inc}/WireFormatter.h (100%) rename ThirdParty/{ => Inc}/WriteBufferFixedSize.h (100%) rename ThirdParty/{ => Inc}/WriteBufferInterface.h (100%) rename ThirdParty/{ => Src}/Fields.cpp (100%) rename ThirdParty/{ => Src}/MessageInterface.cpp (100%) rename ThirdParty/{ => Src}/ReadBufferSection.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 65b79ec..58d246d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,15 +49,13 @@ else () add_compile_options(-Og -g) endif () -include_directories(Core/Inc Core/External/Sensor Core/External/Proto/Helper Core/External/Proto/Codec Core/External/Proto/Generated Core/External/Proto/Generated/Content Core/External/Proto/Buffer Core/External/Proto/Buffer/Request Core/External/Proto/Buffer/Response Core/External/Scheduler Core/External/Scheduler/Handler Core/External/State Core/External/Tools/Indicator Core/External/Tools/Sequence ThirdParty Drivers/STM32L4xx_HAL_Driver/Inc Drivers/STM32L4xx_HAL_Driver/Inc/Legacy Drivers/CMSIS/Device/ST/STM32L4xx/Include Drivers/CMSIS/Include) +include_directories(Core/Inc Core/External/Proto/Buffer Core/External/Proto/Buffer/Request Core/External/Proto/Buffer/Response Core/External/Sensor Core/External/Proto/Helper Core/External/Proto/Codec Core/External/Proto/Generated Core/External/Proto/Generated/Content Core/External/Scheduler Core/External/Scheduler/Handler Core/External/State Core/External/Tools/Indicator Core/External/Tools/Sequence ThirdParty/Inc Drivers/STM32L4xx_HAL_Driver/Inc Drivers/STM32L4xx_HAL_Driver/Inc/Legacy Drivers/CMSIS/Device/ST/STM32L4xx/Include Drivers/CMSIS/Include) add_definitions(-DDEBUG -DUSE_HAL_DRIVER -DSTM32L476xx) -file(GLOB_RECURSE SOURCES "ThirdParty/*.*" "Core/*.*" "Drivers/*.*") +file(GLOB_RECURSE SOURCES "Core/*.*" "Drivers/*.*" "ThirdParty/*.*") -set(LINKER_SCRIPT ${CMAKE_SOURCE_DIR}/STM32L476RGTX_FLASH.ld - Core/External/Scheduler/Handler/scheduler_handler.cpp - Core/External/Scheduler/Handler/scheduler_handler.h) +set(LINKER_SCRIPT ${CMAKE_SOURCE_DIR}/STM32L476RGTX_FLASH.ld) add_link_options(-Wl,-gc-sections,--print-memory-usage,-Map=${PROJECT_BINARY_DIR}/${PROJECT_NAME}.map) add_link_options(-mcpu=cortex-m4 -mthumb -mthumb-interwork) diff --git a/Core/External/Proto/Buffer/Request/request_buffer.cpp b/Core/External/Proto/Buffer/Request/request_buffer.cpp index 2eeafc3..8a79b37 100644 --- a/Core/External/Proto/Buffer/Request/request_buffer.cpp +++ b/Core/External/Proto/Buffer/Request/request_buffer.cpp @@ -1,7 +1,7 @@ #include "request_buffer.h" template -RequestBuffer::RequestBuffer() : index(0), size(0), bytes{0U} { +RequestBuffer::RequestBuffer() : index(0), size(0), bytes{0} { } template diff --git a/Core/External/Proto/Buffer/Request/request_buffer.h b/Core/External/Proto/Buffer/Request/request_buffer.h index 656019e..2c04c8c 100644 --- a/Core/External/Proto/Buffer/Request/request_buffer.h +++ b/Core/External/Proto/Buffer/Request/request_buffer.h @@ -1,10 +1,10 @@ #ifndef LIGHT_DETECTOR_REQUEST_BUFFER_H #define LIGHT_DETECTOR_REQUEST_BUFFER_H -#include - #include "ReadBufferInterface.h" +#include + /** * Represents request buffer implementation for protocol buffers serialization. * diff --git a/Core/External/Proto/Buffer/Response/response_buffer.cpp b/Core/External/Proto/Buffer/Response/response_buffer.cpp index b734511..797af36 100644 --- a/Core/External/Proto/Buffer/Response/response_buffer.cpp +++ b/Core/External/Proto/Buffer/Response/response_buffer.cpp @@ -1,10 +1,7 @@ -#ifndef _DEMO_WRITE_BUFFER_H_ -#define _DEMO_WRITE_BUFFER_H_ - #include "response_buffer.h" template -ResponseBuffer::ResponseBuffer() : bytes_used(0), bytes{0U} { +ResponseBuffer::ResponseBuffer() : bytes_used(0), bytes{0} { } template @@ -50,6 +47,4 @@ bool ResponseBuffer::push(const uint8_t *src, const uint32_t length bytes_used += length; } return result; -} - -#endif // _DEMO_WRITE_BUFFER_H_ +} \ No newline at end of file diff --git a/Core/External/Proto/Buffer/Response/response_buffer.h b/Core/External/Proto/Buffer/Response/response_buffer.h index 3acdfe9..c36b74e 100644 --- a/Core/External/Proto/Buffer/Response/response_buffer.h +++ b/Core/External/Proto/Buffer/Response/response_buffer.h @@ -1,7 +1,7 @@ #ifndef LIGHT_DETECTOR_RESPONSE_BUFFER_H #define LIGHT_DETECTOR_RESPONSE_BUFFER_H -#include +#include "WriteBufferInterface.h" #include #include @@ -16,7 +16,7 @@ class ResponseBuffer : public EmbeddedProto::WriteBufferInterface { public: ResponseBuffer(); - virtual ~ResponseBuffer() = default; + ~ResponseBuffer() override = default; /** * Retrieves raw buffer used for direct data injection. diff --git a/Core/External/Tools/Sequence/sequence.h b/Core/External/Tools/Sequence/sequence.h index e823038..8263a7e 100644 --- a/Core/External/Tools/Sequence/sequence.h +++ b/Core/External/Tools/Sequence/sequence.h @@ -3,6 +3,7 @@ #include #include +#include /** * Represents sequence wrapper implementation. diff --git a/Core/Inc/main.h b/Core/Inc/main.h index 45cd363..3b8bd07 100644 --- a/Core/Inc/main.h +++ b/Core/Inc/main.h @@ -22,7 +22,7 @@ #ifndef __MAIN_H #define __MAIN_H -#include "scheduler.h" +//#include "scheduler.h" #include "indicator.h" #include "tsl2591x.h" diff --git a/Core/Src/main.cpp b/Core/Src/main.cpp index 0ddb895..b23d617 100644 --- a/Core/Src/main.cpp +++ b/Core/Src/main.cpp @@ -53,7 +53,7 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { HAL_TIM_Base_Stop_IT(&htim16); if (htim == &htim16) { - Scheduler::handle_tick(); +// Scheduler::handle_tick(); } else { __NOP(); } @@ -68,7 +68,7 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { */ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { if (GPIO_Pin == GPIO_PIN_13) { - Scheduler::handle_status_check() +// Scheduler::handle_status_check(); } else { __NOP(); } diff --git a/ThirdParty/Defines.h b/ThirdParty/Inc/Defines.h similarity index 100% rename from ThirdParty/Defines.h rename to ThirdParty/Inc/Defines.h diff --git a/ThirdParty/Errors.h b/ThirdParty/Inc/Errors.h similarity index 100% rename from ThirdParty/Errors.h rename to ThirdParty/Inc/Errors.h diff --git a/ThirdParty/FieldStringBytes.h b/ThirdParty/Inc/FieldStringBytes.h similarity index 100% rename from ThirdParty/FieldStringBytes.h rename to ThirdParty/Inc/FieldStringBytes.h diff --git a/ThirdParty/Fields.h b/ThirdParty/Inc/Fields.h similarity index 100% rename from ThirdParty/Fields.h rename to ThirdParty/Inc/Fields.h diff --git a/ThirdParty/MessageInterface.h b/ThirdParty/Inc/MessageInterface.h similarity index 100% rename from ThirdParty/MessageInterface.h rename to ThirdParty/Inc/MessageInterface.h diff --git a/ThirdParty/MessageSizeCalculator.h b/ThirdParty/Inc/MessageSizeCalculator.h similarity index 100% rename from ThirdParty/MessageSizeCalculator.h rename to ThirdParty/Inc/MessageSizeCalculator.h diff --git a/ThirdParty/ReadBufferFixedSize.h b/ThirdParty/Inc/ReadBufferFixedSize.h similarity index 100% rename from ThirdParty/ReadBufferFixedSize.h rename to ThirdParty/Inc/ReadBufferFixedSize.h diff --git a/ThirdParty/ReadBufferInterface.h b/ThirdParty/Inc/ReadBufferInterface.h similarity index 100% rename from ThirdParty/ReadBufferInterface.h rename to ThirdParty/Inc/ReadBufferInterface.h diff --git a/ThirdParty/ReadBufferSection.h b/ThirdParty/Inc/ReadBufferSection.h similarity index 100% rename from ThirdParty/ReadBufferSection.h rename to ThirdParty/Inc/ReadBufferSection.h diff --git a/ThirdParty/RepeatedField.h b/ThirdParty/Inc/RepeatedField.h similarity index 100% rename from ThirdParty/RepeatedField.h rename to ThirdParty/Inc/RepeatedField.h diff --git a/ThirdParty/RepeatedFieldFixedSize.h b/ThirdParty/Inc/RepeatedFieldFixedSize.h similarity index 100% rename from ThirdParty/RepeatedFieldFixedSize.h rename to ThirdParty/Inc/RepeatedFieldFixedSize.h diff --git a/ThirdParty/WireFormatter.h b/ThirdParty/Inc/WireFormatter.h similarity index 100% rename from ThirdParty/WireFormatter.h rename to ThirdParty/Inc/WireFormatter.h diff --git a/ThirdParty/WriteBufferFixedSize.h b/ThirdParty/Inc/WriteBufferFixedSize.h similarity index 100% rename from ThirdParty/WriteBufferFixedSize.h rename to ThirdParty/Inc/WriteBufferFixedSize.h diff --git a/ThirdParty/WriteBufferInterface.h b/ThirdParty/Inc/WriteBufferInterface.h similarity index 100% rename from ThirdParty/WriteBufferInterface.h rename to ThirdParty/Inc/WriteBufferInterface.h diff --git a/ThirdParty/Fields.cpp b/ThirdParty/Src/Fields.cpp similarity index 100% rename from ThirdParty/Fields.cpp rename to ThirdParty/Src/Fields.cpp diff --git a/ThirdParty/MessageInterface.cpp b/ThirdParty/Src/MessageInterface.cpp similarity index 100% rename from ThirdParty/MessageInterface.cpp rename to ThirdParty/Src/MessageInterface.cpp diff --git a/ThirdParty/ReadBufferSection.cpp b/ThirdParty/Src/ReadBufferSection.cpp similarity index 100% rename from ThirdParty/ReadBufferSection.cpp rename to ThirdParty/Src/ReadBufferSection.cpp