From 9c3632b7559a59ef6b3e5837b2b6648947246b59 Mon Sep 17 00:00:00 2001 From: Edward Emelianov Date: Sat, 12 Feb 2022 01:44:51 +0300 Subject: [PATCH] remove trash --- F303-nolib/floatPrintf/main.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/F303-nolib/floatPrintf/main.c b/F303-nolib/floatPrintf/main.c index 3355ed5..950c179 100644 --- a/F303-nolib/floatPrintf/main.c +++ b/F303-nolib/floatPrintf/main.c @@ -20,41 +20,12 @@ #include "hardware.h" #include "usart.h" -//#include - volatile uint32_t Tms = 0; void sys_tick_handler(void){ ++Tms; } -# define IEEE_754_FLOAT_MANTISSA_BITS (23) -# define IEEE_754_FLOAT_EXPONENT_BITS (8) -# define IEEE_754_FLOAT_SIGN_BITS (1) -# if (IS_BIG_ENDIAN == 1) - typedef union { - float value; - struct { - __int8_t sign : IEEE_754_FLOAT_SIGN_BITS; - __int8_t exponent : IEEE_754_FLOAT_EXPONENT_BITS; - __uint32_t mantissa : IEEE_754_FLOAT_MANTISSA_BITS; - }; - } IEEE_754_float; -# else - typedef union { - float value; - struct { - __uint32_t mantissa : IEEE_754_FLOAT_MANTISSA_BITS; - __int8_t exponent : IEEE_754_FLOAT_EXPONENT_BITS; - __int8_t sign : IEEE_754_FLOAT_SIGN_BITS; - }; - } IEEE_754_float; -# endif - - -#define P(x) usart_putchar(x) -#define S(x) usart_send(x) - // be careful: if pow10 would be bigger you should change str[] size! static const float pwr10[] = {1., 10., 100., 1000., 10000.}; static const float rounds[] = {0.5, 0.05, 0.005, 0.0005, 0.00005}; @@ -132,14 +103,11 @@ int main(void){ float x = 0.519, more = 5.123; while(1){ if(Tms - ctr > 499){ - //usart_send("ping\n"); ctr = Tms; pin_toggle(GPIOB, 1 << 1 | 1 << 0); // toggle LED @ PB0 /**/ if((x += 0.519) > more){ - //usart_send("MORE!\n"); more += 5.123; - //__get_FPSCR(); } } if(bufovr){