From ec472cd554dc01e7494715b4bae15e1451bd8006 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Thu, 9 Nov 2023 17:26:00 +0100 Subject: [PATCH] ci(example): update BareMinimun.ino Signed-off-by: Frederic Pillon --- CI/build/examples/BareMinimum/BareMinimum.ino | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/CI/build/examples/BareMinimum/BareMinimum.ino b/CI/build/examples/BareMinimum/BareMinimum.ino index ac299b56f9..404d98c22c 100644 --- a/CI/build/examples/BareMinimum/BareMinimum.ino +++ b/CI/build/examples/BareMinimum/BareMinimum.ino @@ -19,26 +19,25 @@ /* ---------------------------------------------------------------------- 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 ------------------------------------------------------------------- */ @@ -46,11 +45,11 @@ 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 @@ -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 @@ -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 @@ -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(); @@ -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; } }