Skip to content

Commit

Permalink
Fix: project structure (#7)
Browse files Browse the repository at this point in the history
* fix: project structure

* fix: fixed bugs
  • Loading branch information
YarikRevich authored Jun 8, 2024
1 parent 83dbd23 commit 7a3f99d
Show file tree
Hide file tree
Showing 32 changed files with 53 additions and 46 deletions.
75 changes: 38 additions & 37 deletions .cproject
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,27 @@
<listOptionValue builtIn="false" value="STM32L476xx"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1260508736" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="../Core/Inc"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Buffer"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Buffer/Request"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Buffer/Response"/>
<listOptionValue builtIn="false" value="../Core/External/Sensor"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Helper"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Codec"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Generated"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Generated/Content"/>
<listOptionValue builtIn="false" value="../Core/External/Scheduler"/>
<listOptionValue builtIn="false" value="../Core/External/Scheduler/Handler"/>
<listOptionValue builtIn="false" value="../Core/External/State"/>
<listOptionValue builtIn="false" value="../Core/External/Tools/Indicator"/>
<listOptionValue builtIn="false" value="../Core/External/Tools/Converter"/>
<listOptionValue builtIn="false" value="../Core/External/Tools/Mutex"/>
<listOptionValue builtIn="false" value="../Core/External/Tools/Sequence"/>
<listOptionValue builtIn="false" value="../ThirdParty/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../Drivers/STM32L4xx_HAL_Driver/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32L4xx/Include"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../Core/Inc"/>
<listOptionValue builtIn="false" value="../ThirdParty/Inc"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Buffer"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Buffer/Request"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Buffer/Response"/>
<listOptionValue builtIn="false" value="../External/Inc/Sensor"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Helper"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Codec"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Generated"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Generated/Content"/>
<listOptionValue builtIn="false" value="../External/Inc/Scheduler"/>
<listOptionValue builtIn="false" value="../External/Inc/Scheduler/Handler"/>
<listOptionValue builtIn="false" value="../External/Inc/State"/>
<listOptionValue builtIn="false" value="../External/Inc/Tools/Indicator"/>
<listOptionValue builtIn="false" value="../External/Inc/Tools/Converter"/>
<listOptionValue builtIn="false" value="../External/Inc/Tools/Mutex"/>
<listOptionValue builtIn="false" value="../External/Inc/Tools/Sequence"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1702390565" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
</tool>
Expand All @@ -79,27 +79,27 @@
<listOptionValue builtIn="false" value="STM32L476xx"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths.239766328" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="../Core/Inc"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Buffer"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Buffer/Request"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Buffer/Response"/>
<listOptionValue builtIn="false" value="../Core/External/Sensor"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Helper"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Codec"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Generated"/>
<listOptionValue builtIn="false" value="../Core/External/Proto/Generated/Content"/>
<listOptionValue builtIn="false" value="../Core/External/Scheduler"/>
<listOptionValue builtIn="false" value="../Core/External/State"/>
<listOptionValue builtIn="false" value="../Core/External/Scheduler/Handler"/>
<listOptionValue builtIn="false" value="../Core/External/Tools/Indicator"/>
<listOptionValue builtIn="false" value="../Core/External/Tools/Converter"/>
<listOptionValue builtIn="false" value="../Core/External/Tools/Mutex"/>
<listOptionValue builtIn="false" value="../Core/External/Tools/Sequence"/>
<listOptionValue builtIn="false" value="../ThirdParty/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../Drivers/STM32L4xx_HAL_Driver/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32L4xx/Include"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../Core/Inc"/>
<listOptionValue builtIn="false" value="../ThirdParty/Inc"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Buffer"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Buffer/Request"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Buffer/Response"/>
<listOptionValue builtIn="false" value="../External/Inc/Sensor"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Helper"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Codec"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Generated"/>
<listOptionValue builtIn="false" value="../External/Inc/Proto/Generated/Content"/>
<listOptionValue builtIn="false" value="../External/Inc/Scheduler"/>
<listOptionValue builtIn="false" value="../External/Inc/State"/>
<listOptionValue builtIn="false" value="../External/Inc/Scheduler/Handler"/>
<listOptionValue builtIn="false" value="../External/Inc/Tools/Indicator"/>
<listOptionValue builtIn="false" value="../External/Inc/Tools/Converter"/>
<listOptionValue builtIn="false" value="../External/Inc/Tools/Mutex"/>
<listOptionValue builtIn="false" value="../External/Inc/Tools/Sequence"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp.425825475" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp"/>
</tool>
Expand Down Expand Up @@ -129,9 +129,10 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="ThirdParty"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="External"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="ThirdParty"/>
</sourceEntries>
</configuration>
</storageModule>
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ else ()
add_compile_options(-Og -g)
endif ()

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/Converter Core/External/Tools/Mutex 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)
include_directories(Drivers/CMSIS/Include Drivers/STM32L4xx_HAL_Driver/Inc Drivers/STM32L4xx_HAL_Driver/Inc/Legacy Drivers/CMSIS/Device/ST/STM32L4xx/Include Core/Inc ThirdParty/Inc External/Inc/Proto/Buffer External/Inc/Proto/Buffer/Request External/Inc/Proto/Buffer/Response External/Inc/Sensor External/Inc/Proto/Helper External/Inc/Proto/Codec External/Inc/Proto/Generated External/Inc/Proto/Generated/Content External/Inc/Scheduler External/Inc/Scheduler/Handler External/Inc/State External/Inc/Tools/Indicator External/Inc/Tools/Converter External/Inc/Tools/Mutex External/Inc/Tools/Sequence)

add_definitions(-DDEBUG -DUSE_HAL_DRIVER -DSTM32L476xx)

file(GLOB_RECURSE SOURCES "ThirdParty/*.*" "Core/*.*" "Drivers/*.*")
file(GLOB_RECURSE SOURCES "Core/*.*" "Drivers/*.*" "External/*.*" "ThirdParty/*.*")

set(LINKER_SCRIPT ${CMAKE_SOURCE_DIR}/STM32L476RGTX_FLASH.ld)

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.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class TSL2591X {
*
* @return read device id.
*/
static bool get_device_id();
static uint8_t get_device_id();

/**
* Resets light sensor to the default state, initializing device with default settings.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Mutex {
*
* @return retrieved state of the mutex.
*/
bool is_locked() const;
[[nodiscard]] bool is_locked() const;
private:
/**
* Represents current state of the mutex.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,6 @@ int SchedulerHandler::process_settings_bus_request_content_response(

return EXIT_FAILURE;
}


}

Indicator::toggle_action_success();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bool TSL2591X::is_available() {
return HAL_I2C_IsDeviceReady(&hi2c1, TSL2591X_ADDRESS, 1u, 10u) == HAL_OK;
}

bool TSL2591X::get_device_id() {
uint8_t TSL2591X::get_device_id() {
return read_byte(WHO_AM_I);
};

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void Sequence<T>::traverse_until_succeed(std::function<int(T)> callback) {

sequence.pop();
}
};
}

template <typename T>
void Sequence<T>::add(const T& src) {
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
plugin := $(or $(plugin), '')

.ONESHELL:

.PHONY: help
Expand Down Expand Up @@ -29,6 +31,12 @@ endif

.PHONY: generate
generate: ## Generate ProtocolBuffers files(used mainly for development)
ifeq ($(plugin), '')
@echo "Plugin is not set!"

@exit 1
endif

@protoc -I./Resources/Proto/Container --pyi_out=./Scripts/cli/src/proto Content/data.proto Content/info.proto Content/settings.proto request.proto response.proto
@protoc -I./Resources/Proto/Container --python_out=./Scripts/cli/src/proto Content/data.proto Content/info.proto Content/settings.proto request.proto response.proto
@protoc --plugin=/Volumes/Files/embedded/university/techno/project/deps/EmbeddedProto -I./Resources/Proto/Container --eams_out=./Core/External/Proto/Generated Content/data.proto Content/info.proto Content/settings.proto request.proto response.proto
@protoc --plugin=$(plugin) -I./Resources/Proto/Container --eams_out=./Core/External/Proto/Generated Content/data.proto Content/info.proto Content/settings.proto request.proto response.proto

0 comments on commit 7a3f99d

Please sign in to comment.