Skip to content

Commit

Permalink
fix: fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikRevich committed Apr 1, 2024
1 parent 874c39d commit ef8422e
Show file tree
Hide file tree
Showing 25 changed files with 14 additions and 20 deletions.
8 changes: 3 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Core/External/Proto/Buffer/Request/request_buffer.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "request_buffer.h"

template<uint32_t BUFFER_SIZE>
RequestBuffer<BUFFER_SIZE>::RequestBuffer() : index(0), size(0), bytes{0U} {
RequestBuffer<BUFFER_SIZE>::RequestBuffer() : index(0), size(0), bytes{0} {
}

template<uint32_t BUFFER_SIZE>
Expand Down
4 changes: 2 additions & 2 deletions Core/External/Proto/Buffer/Request/request_buffer.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef LIGHT_DETECTOR_REQUEST_BUFFER_H
#define LIGHT_DETECTOR_REQUEST_BUFFER_H

#include <stdio.h>

#include "ReadBufferInterface.h"

#include <cstdio>

/**
* Represents request buffer implementation for protocol buffers serialization.
*
Expand Down
9 changes: 2 additions & 7 deletions Core/External/Proto/Buffer/Response/response_buffer.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#ifndef _DEMO_WRITE_BUFFER_H_
#define _DEMO_WRITE_BUFFER_H_

#include "response_buffer.h"

template<uint32_t BUFFER_SIZE>
ResponseBuffer<BUFFER_SIZE>::ResponseBuffer() : bytes_used(0), bytes{0U} {
ResponseBuffer<BUFFER_SIZE>::ResponseBuffer() : bytes_used(0), bytes{0} {
}

template<uint32_t BUFFER_SIZE>
Expand Down Expand Up @@ -50,6 +47,4 @@ bool ResponseBuffer<BUFFER_SIZE>::push(const uint8_t *src, const uint32_t length
bytes_used += length;
}
return result;
}

#endif // _DEMO_WRITE_BUFFER_H_
}
4 changes: 2 additions & 2 deletions Core/External/Proto/Buffer/Response/response_buffer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef LIGHT_DETECTOR_RESPONSE_BUFFER_H
#define LIGHT_DETECTOR_RESPONSE_BUFFER_H

#include <WriteBufferInterface.h>
#include "WriteBufferInterface.h"

#include <cstdio>
#include <cstring>
Expand All @@ -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.
Expand Down
1 change: 1 addition & 0 deletions Core/External/Tools/Sequence/sequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <queue>
#include <functional>
#include <cstdlib>

/**
* Represents sequence wrapper implementation.
Expand Down
2 changes: 1 addition & 1 deletion Core/Inc/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef __MAIN_H
#define __MAIN_H

#include "scheduler.h"
//#include "scheduler.h"
#include "indicator.h"
#include "tsl2591x.h"

Expand Down
4 changes: 2 additions & 2 deletions Core/Src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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();
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ef8422e

Please sign in to comment.