Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add common math types and cleanup printf includes #44

Merged
merged 2 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .cproject
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@
<listOptionValue builtIn="false" value="TEST_MODE"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.2062664197" 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="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/third_party/canlib}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/third_party/printf}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/drivers}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/application}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Core/Inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Drivers/STM32H7xx_HAL_Driver/Inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Drivers/STM32H7xx_HAL_Driver/Inc/Legacy}&quot;"/>
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
- `src/drivers/`: custom peripheral driver modules
- `src/application/`: high-level application logic modules
- `src/third_party/`: third-party libraries
- `src/common/`: shared resources specific to this project
- Everything else is autogenerated by STM32CubeIDE with few modifications
34 changes: 34 additions & 0 deletions src/common/math/math.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Math types and utils used in the processor project
*/
#ifndef COMMON_MATH_H
#define COMMON_MATH_H

/**
* 3D vector.
*/
typedef union {
float array[3];

struct {
float x;
float y;
float z;
} component;
} vector3d_t;

/**
* Quaternion.
*/
typedef union {
float array[4];

struct {
float w;
float x;
float y;
float z;
} element;
} quaternion_t;
celery6 marked this conversation as resolved.
Show resolved Hide resolved

#endif // COMMON_MATH_H
2 changes: 1 addition & 1 deletion src/third_party/printf/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include "printf_config.h"
#endif

#include <third_party/printf/printf.h>
#include <printf.h>

#include "stm32h7xx_hal.h"

Expand Down
Loading