19
19
/* ----------------------------------------------------------------------
20
20
Defines each of the tests performed
21
21
------------------------------------------------------------------- */
22
- #define MAX_BLOCKSIZE 2
23
- #define DELTA (0 .0001f )
22
+ #define MAX_BLOCKSIZE 2
23
+ #define DELTA (0 .0001f )
24
24
/* ----------------------------------------------------------------------
25
25
Test input data for Floating point sin_cos example for 32-blockSize
26
26
Generated by the MATLAB randn() function
27
27
------------------------------------------------------------------- */
28
- const float32_t testInput_f32[MAX_BLOCKSIZE] =
29
- {
30
- -1.244916875853235400 , -4.793533929171324800
28
+ const float32_t testInput_f32[MAX_BLOCKSIZE] = {
29
+ -1.244916875853235400 , -4.793533929171324800
31
30
};
32
31
const float32_t testRefOutput_f32 = 1.000000000 ;
33
32
/* ----------------------------------------------------------------------
34
33
Declare Global variables
35
34
------------------------------------------------------------------- */
36
35
uint32_t blockSize = 2 ;
37
- float32_t testOutput;
38
- float32_t cosOutput;
39
- float32_t sinOutput;
40
- float32_t cosSquareOutput;
41
- float32_t sinSquareOutput;
36
+ float32_t testOutput;
37
+ float32_t cosOutput;
38
+ float32_t sinOutput;
39
+ float32_t cosSquareOutput;
40
+ float32_t sinSquareOutput;
42
41
/* ----------------------------------------------------------------------
43
42
Max magnitude FFT Bin test
44
43
------------------------------------------------------------------- */
45
44
arm_status status;
46
45
/* CMSIS_DSP */
47
46
48
47
#ifndef USER_BTN
49
- #define USER_BTN 2
48
+ #define USER_BTN 2
50
49
#endif
51
50
52
51
#ifndef LED_BUILTIN
53
- #define LED_BUILTIN 13
52
+ #define LED_BUILTIN 13
54
53
#endif
55
54
56
55
#ifndef PIN_SERIAL_RX
@@ -72,8 +71,7 @@ SoftwareSerial swSerial(10, 11);
72
71
73
72
void setup () {
74
73
// Serial HW & SW
75
- #if (!defined(USBD_USE_CDC) && !defined(DISABLE_GENERIC_SERIALUSB)) &&\
76
- (!defined (VIRTIOCON) && !defined (DISABLE_GENERIC_SERIALVIRTIO))
74
+ #if (!defined(USBD_USE_CDC) && !defined(DISABLE_GENERIC_SERIALUSB)) && (!defined(VIRTIOCON) && !defined(DISABLE_GENERIC_SERIALVIRTIO))
77
75
Serial.setRx (PIN_SERIAL_RX);
78
76
Serial.setTx (digitalPinToPinName (PIN_SERIAL_TX));
79
77
#endif
@@ -92,7 +90,7 @@ void setup() {
92
90
93
91
// EEPROM
94
92
byte value = EEPROM.read (0x01 );
95
- EEPROM.write (EEPROM.length ()- 1 , value);
93
+ EEPROM.write (EEPROM.length () - 1 , value);
96
94
97
95
#ifndef STM32MP1xx
98
96
// IWDG
@@ -111,13 +109,13 @@ void setup() {
111
109
#endif
112
110
113
111
// SPI
114
- SPISettings settings (SPI_SPEED_CLOCK_DEFAULT, MSBFIRST, SPI_MODE_0 );
112
+ SPISettings settings (SPI_SPEED_CLOCK_DEFAULT, MSBFIRST, SPI_MODE0 );
115
113
SPI.setMISO (PIN_SPI_MISO);
116
114
SPI.setMOSI (PIN_SPI_MOSI);
117
115
SPI.setSCLK (PIN_SPI_SCK);
118
116
SPI.setSSEL (digitalPinToPinName (PIN_SPI_SS));
119
- SPI.begin (PIN_SPI_SS );
120
- SPI.beginTransaction (1 , settings);
117
+ SPI.begin ();
118
+ SPI.beginTransaction (settings);
121
119
SPI.endTransaction ();
122
120
SPI.transfer (1 );
123
121
SPI.end ();
@@ -146,7 +144,7 @@ void setup() {
146
144
diff = fabsf (testRefOutput_f32 - testOutput);
147
145
/* Comparison of sin_cos value with reference */
148
146
status = (diff > DELTA) ? ARM_MATH_TEST_FAILURE : ARM_MATH_SUCCESS;
149
- if ( status == ARM_MATH_TEST_FAILURE) {
147
+ if (status == ARM_MATH_TEST_FAILURE) {
150
148
break ;
151
149
}
152
150
}
0 commit comments