Skip to content

Commit

Permalink
teste2
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurcalabresi committed Nov 22, 2024
1 parent d996d41 commit 34a4a8d
Show file tree
Hide file tree
Showing 2,186 changed files with 896,658 additions and 116 deletions.
25 changes: 2 additions & 23 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,8 @@
"ms-vscode.cpptools-themes",
"ms-vscode.vscode-serial-monitor",
"twxs.cmake",
"wokwi.wokwi-vscode",
"seunlanlege.action-buttons"
]
},
"settings":{
"cmake.statusbar.advanced": {
"cpack": {"statusBarVisibility": "hidden"},
"debug": {
"statusBarVisibility": "hidden",
"inheritDefault": "hidden"
},
"launch": {
"visibility": "visible"
},
"build": {
"visibility": "hidden"
},
"buildTarget": {
"statusBarVisibility": "hidden",
"visibility": "hidden"
}

}
"wokwi.wokwi-vscode"
]
}
}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
- uses: actions/checkout@v4
- uses: insper-embarcados/actions-cppcheck@v1
with:
c_file: main/main.c
c_file: pico-edge/main.cpp
5 changes: 3 additions & 2 deletions .github/workflows/embedded-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: insper-embarcados/actions-embedded-check@v1
- uses: insper-embarcados/actions-embedded-check@v2
with:
c_file: main/main.c
c_file: pico-edge/main.cpp
rtos: true
6 changes: 1 addition & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@
"configFiles": ["interface/cmsis-dap.cfg", "target/rp2040.cfg"],
"svdFile": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd",
"runToEntryPoint": "main",
"openOCDLaunchCommands": [
"adapter speed 5000"
],
// Work around for stopping at main on restart
"postRestartCommands": [
"break main",
"continue"
],

]
}
]
}
59 changes: 18 additions & 41 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,23 @@
// These settings tweaks to the cmake plugin will ensure
// that you debug using cortex-debug instead of trying to launch
// a Pico binary on the host

"cmake.statusbar.advanced": {
"debug": {
"visibility": "hidden"
},
"launch": {
"visibility": "hidden"
},
"build": {
"visibility": "hidden"
},
"buildTarget": {
"visibility": "hidden"
}
},
"cmake.buildBeforeRun": true,
"cmake.configureOnOpen": true,
"cmake.ctest.allowParallelJobs": true,
"cmake.parallelJobs": 8,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",


// actions task buttons
"actionButtons": {
"defaultColor": "#ff0034", // Can also use string color names.
"loadNpmCommands":false, // Disables automatic generation of actions for npm commands.
"reloadButton":"", // Custom reload button text or icon (default ↻). null value enables automatic reload on configuration change
"commands": [
{
"name": "$(rocket) ",
"color": "white",
"useVsCodeApi": true,
"command": "workbench.action.tasks.runTask",
"args": ["Flash"]
}
]
},

// CMake Tools Status Bar Configuration
"cmake.statusbar.advanced": {
"debug": {
"visibility": "hidden"
},
"launch": {
"visibility": "visible"
},
"build": {
"visibility": "hidden"
},
"buildTarget": {
"visibility": "hidden"
}
}


}

"files.associations": {
"gpio.h": "c"
}
}
97 changes: 75 additions & 22 deletions CMakeLists.txt
100644 → 100755
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)




11 changes: 11 additions & 0 deletions Fusion/CMakeLists.txt
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()
32 changes: 32 additions & 0 deletions Fusion/Fusion.h
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
Loading

0 comments on commit 34a4a8d

Please sign in to comment.