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.
This commit is contained in:
parent
0a8458c353
commit
8bfec2b538
|
@ -1,25 +1,25 @@
|
|||
/***********************************************************************
|
||||
|
||||
format-float.c - Ruutine for converting a single-precision floating
|
||||
/***********************************************************************
|
||||
|
||||
formatfloat.c - Ruutine for converting a single-precision floating
|
||||
point number into a string.
|
||||
|
||||
|
||||
The code in this funcion was inspired from Fred Bayer's pdouble.c.
|
||||
Since pdouble.c was released as Public Domain, I'm releasing this
|
||||
code as public domain as well.
|
||||
|
||||
|
||||
The original code can be found in https://github.com/dhylands/format-float
|
||||
|
||||
|
||||
Dave Hylands
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "mpconfig.h"
|
||||
|
||||
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
|
||||
#include "format-float.h"
|
||||
#include "formatfloat.h"
|
||||
|
||||
// 1 sign bit, 8 exponent bits, and 23 mantissa bits.
|
||||
// exponent values 0 and 255 are reserved, exponent can be 1 to 254.
|
|
@ -1,3 +1 @@
|
|||
int format_float(float f, char *buf, size_t bufSize, char fmt, int prec, char sign);
|
||||
|
||||
|
|
@ -12,8 +12,9 @@
|
|||
#include "runtime0.h"
|
||||
|
||||
#if MICROPY_ENABLE_FLOAT
|
||||
|
||||
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
|
||||
#include "format-float.h"
|
||||
#include "formatfloat.h"
|
||||
#endif
|
||||
|
||||
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) {
|
|||
return mp_obj_new_float(lhs_val);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // MICROPY_ENABLE_FLOAT
|
||||
|
|
2
py/py.mk
2
py/py.mk
|
@ -32,7 +32,7 @@ PY_O_BASENAME = \
|
|||
asmthumb.o \
|
||||
emitnthumb.o \
|
||||
emitinlinethumb.o \
|
||||
format-float.o \
|
||||
formatfloat.o \
|
||||
parsenumbase.o \
|
||||
parsenum.o \
|
||||
runtime.o \
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#define MICROPY_ENABLE_GC (1)
|
||||
#define MICROPY_ENABLE_REPL_HELPERS (1)
|
||||
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
|
||||
#define MICROPY_ENABLE_FLOAT (1)
|
||||
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
|
||||
#define MICROPY_PATH_MAX (128)
|
||||
/* Enable FatFS LFNs
|
||||
|
|
|
@ -11,8 +11,9 @@
|
|||
#include "lcd.h"
|
||||
#include "usart.h"
|
||||
#include "usb.h"
|
||||
|
||||
#if MICROPY_ENABLE_FLOAT
|
||||
#include "format-float.h"
|
||||
#include "formatfloat.h"
|
||||
#endif
|
||||
|
||||
#define PF_FLAG_LEFT_ADJUST (0x01)
|
||||
|
|
Loading…
Reference in New Issue