Skip to content

Commit 8bfec2b

Browse files
committed
Rename formatfloat file; remove MICROPY_ENABLE_FLOAT from mpconfigport.h.
MICROPY_ENABLE_FLOAT is automatically set in mpconfig.h if MICROPY_FLOAT_IMPL is set to a non-zero value.
1 parent 0a8458c commit 8bfec2b

6 files changed

Lines changed: 15 additions & 16 deletions

File tree

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
/***********************************************************************
2-
3-
format-float.c - Ruutine for converting a single-precision floating
1+
/***********************************************************************
2+
3+
formatfloat.c - Ruutine for converting a single-precision floating
44
point number into a string.
5-
5+
66
The code in this funcion was inspired from Fred Bayer's pdouble.c.
77
Since pdouble.c was released as Public Domain, I'm releasing this
88
code as public domain as well.
9-
9+
1010
The original code can be found in https://github.com/dhylands/format-float
11-
11+
1212
Dave Hylands
13-
13+
1414
***********************************************************************/
1515

16-
#include <stdint.h>
16+
#include <stdint.h>
1717
#include <stdlib.h>
1818

1919
#include "mpconfig.h"
2020

2121
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
22-
#include "format-float.h"
22+
#include "formatfloat.h"
2323

2424
// 1 sign bit, 8 exponent bits, and 23 mantissa bits.
2525
// exponent values 0 and 255 are reserved, exponent can be 1 to 254.
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
int format_float(float f, char *buf, size_t bufSize, char fmt, int prec, char sign);
2-
3-

py/objfloat.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
#include "runtime0.h"
1313

1414
#if MICROPY_ENABLE_FLOAT
15+
1516
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
16-
#include "format-float.h"
17+
#include "formatfloat.h"
1718
#endif
1819

1920
mp_obj_t mp_obj_new_float(mp_float_t value);
@@ -120,4 +121,4 @@ mp_obj_t mp_obj_float_binary_op(int op, mp_float_t lhs_val, mp_obj_t rhs_in) {
120121
return mp_obj_new_float(lhs_val);
121122
}
122123

123-
#endif
124+
#endif // MICROPY_ENABLE_FLOAT

py/py.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PY_O_BASENAME = \
3232
asmthumb.o \
3333
emitnthumb.o \
3434
emitinlinethumb.o \
35-
format-float.o \
35+
formatfloat.o \
3636
parsenumbase.o \
3737
parsenum.o \
3838
runtime.o \

stm/mpconfigport.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#define MICROPY_ENABLE_GC (1)
88
#define MICROPY_ENABLE_REPL_HELPERS (1)
99
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
10-
#define MICROPY_ENABLE_FLOAT (1)
1110
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
1211
#define MICROPY_PATH_MAX (128)
1312
/* Enable FatFS LFNs

stm/printf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
#include "lcd.h"
1212
#include "usart.h"
1313
#include "usb.h"
14+
1415
#if MICROPY_ENABLE_FLOAT
15-
#include "format-float.h"
16+
#include "formatfloat.h"
1617
#endif
1718

1819
#define PF_FLAG_LEFT_ADJUST (0x01)

0 commit comments

Comments
 (0)