Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/Continuous-Integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- CI/**
- '!CI/build/arduino-cli.py'
- '!CI/build/platformio-builder.py'
- '!CI/build/examples/**'
- tools/**
- '!tools/platformio-build.py'
pull_request:
Expand All @@ -20,6 +21,7 @@ on:
- CI/**
- '!CI/build/arduino-cli.py'
- '!CI/build/platformio-builder.py'
- '!CI/build/examples/**'
- tools/**
- '!tools/platformio-build.py'
jobs:
Expand Down
54 changes: 53 additions & 1 deletion CI/build/examples/BareMinimum/BareMinimum.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,36 @@
#include <SoftwareSerial.h>
#include <Wire.h>

#include <CMSIS_DSP.h>
/* ----------------------------------------------------------------------
Defines each of the tests performed
------------------------------------------------------------------- */
#define MAX_BLOCKSIZE 2
#define DELTA (0.0001f)
/* ----------------------------------------------------------------------
Test input data for Floating point sin_cos example for 32-blockSize
Generated by the MATLAB randn() function
------------------------------------------------------------------- */
const float32_t testInput_f32[MAX_BLOCKSIZE] =
{
-1.244916875853235400, -4.793533929171324800
};
const float32_t testRefOutput_f32 = 1.000000000;
/* ----------------------------------------------------------------------
Declare Global variables
------------------------------------------------------------------- */
uint32_t blockSize = 2;
float32_t testOutput;
float32_t cosOutput;
float32_t sinOutput;
float32_t cosSquareOutput;
float32_t sinSquareOutput;
/* ----------------------------------------------------------------------
Max magnitude FFT Bin test
------------------------------------------------------------------- */
arm_status status;
/* CMSIS_DSP */

#ifndef USER_BTN
#define USER_BTN 2
#endif
Expand Down Expand Up @@ -103,6 +133,28 @@ void setup() {
Wire.endTransmission();
Wire.requestFrom(2, 1);
Wire.end();

// CMSIS DSP
float32_t diff;
for (uint32_t i = 0; i < blockSize; i++) {
cosOutput = arm_cos_f32(testInput_f32[i]);
sinOutput = arm_sin_f32(testInput_f32[i]);
arm_mult_f32(&cosOutput, &cosOutput, &cosSquareOutput, 1);
arm_mult_f32(&sinOutput, &sinOutput, &sinSquareOutput, 1);
arm_add_f32(&cosSquareOutput, &sinSquareOutput, &testOutput, 1);
/* absolute value of difference between ref and test */
diff = fabsf(testRefOutput_f32 - testOutput);
/* Comparison of sin_cos value with reference */
status = (diff > DELTA) ? ARM_MATH_TEST_FAILURE : ARM_MATH_SUCCESS;
if ( status == ARM_MATH_TEST_FAILURE) {
break;
}
}
if (status != ARM_MATH_SUCCESS) {
Serial.printf("FAILURE\n");
} else {
Serial.printf("SUCCESS\n");
}
}

void loop() {
Expand All @@ -120,4 +172,4 @@ void receiveEvent(int) {
// this function is registered as an event, see setup()
void requestEvent() {
Wire.write("x");
}
}
1 change: 1 addition & 0 deletions libraries/CMSIS_DSP/src/BayesFunctions/BayesFunctions.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../Source/BayesFunctions/BayesFunctions.c"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../Source/DistanceFunctions/DistanceFunctions.c"
1 change: 1 addition & 0 deletions libraries/CMSIS_DSP/src/SVMFunctions/SVMFunctions.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../Source/SVMFunctions/SVMFunctions.c"
4 changes: 2 additions & 2 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ compiler.ar.extra_flags=
compiler.elf2bin.extra_flags=
compiler.elf2hex.extra_flags=

compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-5.5.1.path}/CMSIS/Core/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Source/Templates/gcc/" "-I{runtime.tools.CMSIS-5.5.1.path}/CMSIS/DSP/Include"
compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.5.1.path}/CMSIS/DSP/Lib/GCC/" -l{build.cmsis_lib_gcc}
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-5.7.0.path}/CMSIS/Core/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Source/Templates/gcc/" "-I{runtime.tools.CMSIS-5.7.0.path}/CMSIS/DSP/Include" "-I{runtime.tools.CMSIS-5.7.0.path}/CMSIS/DSP/PrivateInclude"
compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.7.0.path}/CMSIS/DSP/Lib/GCC/" -l{build.cmsis_lib_gcc}

# USB Flags
# ---------
Expand Down