66 */
77#include " Flash/FlashTests/Flash_Test.hpp"
88
9- #define PI 3.1415
10- #define E 2.7183
9+ #define NUMERIC_PI 3.1415
10+ #define NUMERIC_E 2.7183
1111#define SQUARE_ROOT_OF_TWO 1.4142
1212
1313namespace FlashTest {
@@ -43,7 +43,7 @@ namespace FlashTest{
4343 uint8_t float_byte_array[4 ];
4444 uint32_t addr = FLASH_SECTOR4_START_ADDRESS;
4545
46- float_2_bytes (float_byte_array, PI );
46+ float_2_bytes (float_byte_array, NUMERIC_PI );
4747 return Flash::write ((uint32_t *)float_byte_array, addr,(uint32_t ) 1 );
4848 }
4949
@@ -54,7 +54,7 @@ namespace FlashTest{
5454
5555 float result = bytes_2_float (float_byte_array);
5656
57- return result * 10000 == PI * 10000 ;
57+ return result * 10000 == NUMERIC_PI * 10000 ;
5858 }
5959
6060 bool test3_writing_multiple_float (){
@@ -63,22 +63,22 @@ namespace FlashTest{
6363 uint32_t offset1 = 0x04 ;
6464 uint32_t offset2 = 0x20 ;
6565
66- float_2_bytes (float_byte_array, PI );
66+ float_2_bytes (float_byte_array, NUMERIC_PI );
6767 Flash::write ((uint32_t *)float_byte_array, addr,(uint32_t ) 1 );
6868
69- float_2_bytes (float_byte_array, E );
69+ float_2_bytes (float_byte_array, NUMERIC_E );
7070 Flash::write ((uint32_t *)float_byte_array, addr + offset1,(uint32_t ) 1 );
7171
7272 float_2_bytes (float_byte_array, SQUARE_ROOT_OF_TWO);
7373 Flash::write ((uint32_t *)float_byte_array, addr + offset2,(uint32_t ) 1 );
7474
7575 Flash::read (addr, (uint32_t *)float_byte_array, 1 );
7676 float first_result = bytes_2_float (float_byte_array);
77- bool first_write = first_result * 10000 == PI * 10000 ;
77+ bool first_write = first_result * 10000 == NUMERIC_PI * 10000 ;
7878
7979 Flash::read (addr + offset1, (uint32_t *)float_byte_array, 1 );
8080 float second_result = bytes_2_float (float_byte_array);
81- bool second_write = second_result * 100000 == E * 100000 ;
81+ bool second_write = second_result * 100000 == NUMERIC_E * 100000 ;
8282
8383 Flash::read (addr + offset2, (uint32_t *)float_byte_array, 1 );
8484 float third_result = bytes_2_float (float_byte_array);
0 commit comments