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,6 +1,6 @@
|
|||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
||||||
format-float.c - Ruutine for converting a single-precision floating
|
formatfloat.c - Ruutine for converting a single-precision floating
|
||||||
point number into a string.
|
point number into a string.
|
||||||
|
|
||||||
The code in this funcion was inspired from Fred Bayer's pdouble.c.
|
The code in this funcion was inspired from Fred Bayer's pdouble.c.
|
||||||
@ -19,7 +19,7 @@
|
|||||||
#include "mpconfig.h"
|
#include "mpconfig.h"
|
||||||
|
|
||||||
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
|
#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.
|
// 1 sign bit, 8 exponent bits, and 23 mantissa bits.
|
||||||
// exponent values 0 and 255 are reserved, exponent can be 1 to 254.
|
// 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);
|
int format_float(float f, char *buf, size_t bufSize, char fmt, int prec, char sign);
|
||||||
|
|
||||||
|
|
@ -12,8 +12,9 @@
|
|||||||
#include "runtime0.h"
|
#include "runtime0.h"
|
||||||
|
|
||||||
#if MICROPY_ENABLE_FLOAT
|
#if MICROPY_ENABLE_FLOAT
|
||||||
|
|
||||||
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
|
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
|
||||||
#include "format-float.h"
|
#include "formatfloat.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mp_obj_t mp_obj_new_float(mp_float_t value);
|
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);
|
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 \
|
asmthumb.o \
|
||||||
emitnthumb.o \
|
emitnthumb.o \
|
||||||
emitinlinethumb.o \
|
emitinlinethumb.o \
|
||||||
format-float.o \
|
formatfloat.o \
|
||||||
parsenumbase.o \
|
parsenumbase.o \
|
||||||
parsenum.o \
|
parsenum.o \
|
||||||
runtime.o \
|
runtime.o \
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#define MICROPY_ENABLE_GC (1)
|
#define MICROPY_ENABLE_GC (1)
|
||||||
#define MICROPY_ENABLE_REPL_HELPERS (1)
|
#define MICROPY_ENABLE_REPL_HELPERS (1)
|
||||||
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
|
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
|
||||||
#define MICROPY_ENABLE_FLOAT (1)
|
|
||||||
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
|
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
|
||||||
#define MICROPY_PATH_MAX (128)
|
#define MICROPY_PATH_MAX (128)
|
||||||
/* Enable FatFS LFNs
|
/* Enable FatFS LFNs
|
||||||
|
@ -11,8 +11,9 @@
|
|||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "usart.h"
|
#include "usart.h"
|
||||||
#include "usb.h"
|
#include "usb.h"
|
||||||
|
|
||||||
#if MICROPY_ENABLE_FLOAT
|
#if MICROPY_ENABLE_FLOAT
|
||||||
#include "format-float.h"
|
#include "formatfloat.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PF_FLAG_LEFT_ADJUST (0x01)
|
#define PF_FLAG_LEFT_ADJUST (0x01)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user