Skip to content

Commit

Permalink
ci(example): update BareMinimun.ino
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic Pillon <[email protected]>
  • Loading branch information
fpistm committed Nov 14, 2023
1 parent 392469a commit 0a926cf
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions CI/build/examples/BareMinimum/BareMinimum.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,37 @@
/* ----------------------------------------------------------------------
Defines each of the tests performed
------------------------------------------------------------------- */
#define MAX_BLOCKSIZE 2
#define DELTA (0.0001f)
#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 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;
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
#define USER_BTN 2
#endif

#ifndef LED_BUILTIN
#define LED_BUILTIN 13
#define LED_BUILTIN 13
#endif

#ifndef PIN_SERIAL_RX
Expand All @@ -72,8 +71,7 @@ SoftwareSerial swSerial(10, 11);

void setup() {
// Serial HW & SW
#if (!defined(USBD_USE_CDC) && !defined(DISABLE_GENERIC_SERIALUSB)) &&\
(!defined(VIRTIOCON) && !defined(DISABLE_GENERIC_SERIALVIRTIO))
#if (!defined(USBD_USE_CDC) && !defined(DISABLE_GENERIC_SERIALUSB)) && (!defined(VIRTIOCON) && !defined(DISABLE_GENERIC_SERIALVIRTIO))
Serial.setRx(PIN_SERIAL_RX);
Serial.setTx(digitalPinToPinName(PIN_SERIAL_TX));
#endif
Expand All @@ -92,7 +90,7 @@ void setup() {

// EEPROM
byte value = EEPROM.read(0x01);
EEPROM.write(EEPROM.length()-1, value);
EEPROM.write(EEPROM.length() - 1, value);

#ifndef STM32MP1xx
// IWDG
Expand All @@ -111,13 +109,13 @@ void setup() {
#endif

// SPI
SPISettings settings(SPI_SPEED_CLOCK_DEFAULT, MSBFIRST, SPI_MODE_0);
SPISettings settings(SPI_SPEED_CLOCK_DEFAULT, MSBFIRST, SPI_MODE0);
SPI.setMISO(PIN_SPI_MISO);
SPI.setMOSI(PIN_SPI_MOSI);
SPI.setSCLK(PIN_SPI_SCK);
SPI.setSSEL(digitalPinToPinName(PIN_SPI_SS));
SPI.begin(PIN_SPI_SS);
SPI.beginTransaction(1, settings);
SPI.begin();
SPI.beginTransaction(settings);
SPI.endTransaction();
SPI.transfer(1);
SPI.end();
Expand Down Expand Up @@ -146,7 +144,7 @@ void setup() {
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) {
if (status == ARM_MATH_TEST_FAILURE) {
break;
}
}
Expand Down

0 comments on commit 0a926cf

Please sign in to comment.