-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d996d41
commit 34a4a8d
Showing
2,186 changed files
with
896,658 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,86 @@ | ||
cmake_minimum_required(VERSION 3.12) | ||
cmake_minimum_required(VERSION 3.13.1) | ||
|
||
set(PROJECT_FOLDER .) | ||
|
||
# Pull in SDK (must be before project) | ||
include(pico_sdk_import.cmake) | ||
|
||
include(pico_extras_import_optional.cmake) | ||
|
||
project(pico_emb C CXX ASM) | ||
set(CMAKE_C_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD 17) | ||
# Pull in FreeRTOS | ||
set(FREERTOS_KERNEL_PATH ${CMAKE_CURRENT_LIST_DIR}/freertos/FreeRTOS-Kernel) | ||
include(freertos/FreeRTOS_Kernel_import.cmake) | ||
|
||
|
||
|
||
if(PICO_SDK_VERSION_STRING VERSION_LESS "1.3.0") | ||
message( | ||
FATAL_ERROR | ||
"Raspberry Pi Pico SDK version 1.3.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}" | ||
) | ||
endif() | ||
|
||
# Initialize the SDK | ||
project(lab-ia C CXX ASM) | ||
set(CMAKE_C_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
pico_sdk_init() | ||
|
||
add_compile_options( | ||
-Wall -Wno-format # int != int32_t as far as the compiler is concerned because | ||
# gcc has int32_t as long int | ||
-Wno-unused-function # we have some for the docs that aren't called | ||
add_definitions(-DEIDSP_QUANTIZE_FILTERBANK=0 | ||
-DEI_CLASSIFIER_TFLITE_ENABLE_CMSIS_NN=0 | ||
-DARM_MATH_LOOPUNROLL | ||
) | ||
|
||
add_subdirectory(Fusion) | ||
add_subdirectory(mpu-data-forwarding) | ||
|
||
|
||
add_executable(pico-edge | ||
pico-edge/main.cpp | ||
edge-impulse-sdk/porting/ei_classifier_porting.h | ||
) | ||
|
||
include(${PROJECT_FOLDER}/edge-impulse-sdk/cmake/utils.cmake) | ||
|
||
target_link_libraries(pico-edge PRIVATE | ||
pico_stdlib | ||
FreeRTOS-Kernel | ||
FreeRTOS-Kernel-Heap4 | ||
hardware_i2c | ||
Fusion | ||
) | ||
|
||
|
||
target_include_directories(mpu-data-forwarding PRIVATE | ||
${PROJECT_FOLDER}/freertos | ||
${PROJECT_FOLDER} | ||
) | ||
|
||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU") | ||
add_compile_options(-Wno-maybe-uninitialized) | ||
endif() | ||
|
||
# Codes subdir: | ||
add_subdirectory(main) | ||
target_include_directories(pico-edge PRIVATE | ||
${PROJECT_FOLDER}/tflite-model | ||
${PROJECT_FOLDER}/model-parameters | ||
${PROJECT_FOLDER}/freertos | ||
${PROJECT_FOLDER} | ||
) | ||
|
||
|
||
|
||
# enable usb output, disable uart output | ||
pico_enable_stdio_usb(pico-edge 0) | ||
pico_enable_stdio_uart(pico-edge 1) | ||
pico_enable_stdio_usb(mpu-data-forwarding 0) | ||
pico_enable_stdio_uart(mpu-data-forwarding 1) | ||
|
||
RECURSIVE_FIND_FILE(SOURCE_FILES "${PROJECT_FOLDER}/edge-impulse-sdk" "*.cpp") | ||
RECURSIVE_FIND_FILE(MODEL_FILES "${PROJECT_FOLDER}/tflite-model" "*.cpp") | ||
RECURSIVE_FIND_FILE(CC_FILES "${PROJECT_FOLDER}/edge-impulse-sdk" "*.cc") | ||
RECURSIVE_FIND_FILE(C_FILES "${PROJECT_FOLDER}/edge-impulse-sdk" "*.c") | ||
|
||
list(APPEND SOURCE_FILES ${S_FILES}) | ||
list(APPEND SOURCE_FILES ${C_FILES}) | ||
list(APPEND SOURCE_FILES ${CC_FILES}) | ||
list(APPEND SOURCE_FILES ${MODEL_FILES}) | ||
|
||
# add all sources to the project | ||
target_sources(pico-edge PRIVATE ${SOURCE_FILES}) | ||
target_sources(mpu-data-forwarding PRIVATE ${SOURCE_FILES}) | ||
|
||
|
||
target_compile_options(pico-edge PRIVATE -Wall) | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
file(GLOB_RECURSE files "*.c") | ||
|
||
add_library(Fusion ${files}) | ||
|
||
target_include_directories(Fusion PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
) | ||
|
||
if(UNIX AND NOT APPLE) | ||
target_link_libraries(Fusion m) # link math library for Linux | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* @file Fusion.h | ||
* @author Seb Madgwick | ||
* @brief Main header file for the Fusion library. This is the only file that | ||
* needs to be included when using the library. | ||
*/ | ||
|
||
#ifndef FUSION_H | ||
#define FUSION_H | ||
|
||
//------------------------------------------------------------------------------ | ||
// Includes | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include "FusionAhrs.h" | ||
#include "FusionAxes.h" | ||
#include "FusionCalibration.h" | ||
#include "FusionCompass.h" | ||
#include "FusionConvention.h" | ||
#include "FusionMath.h" | ||
#include "FusionOffset.h" | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif | ||
//------------------------------------------------------------------------------ | ||
// End of file |
Oops, something went wrong.