Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
81a06d2c
Commit
81a06d2c
authored
Oct 04, 2017
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/libm: Remove implementation of log2f, use MP_NEED_LOG2 instead.
parent
d8d4e4df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
10 deletions
+3
-10
lib/libm/math.c
lib/libm/math.c
+0
-10
ports/stm32/mpconfigport.h
ports/stm32/mpconfigport.h
+3
-0
No files found.
lib/libm/math.c
View file @
81a06d2c
...
...
@@ -48,16 +48,6 @@ float copysignf(float x, float y) {
}
#endif
// some compilers define log2f in terms of logf
#ifdef log2f
#undef log2f
#endif
// some compilers have _M_LN2 defined in math.h, some don't
#ifndef _M_LN2
#define _M_LN2 (0.69314718055994530942)
#endif
float
log2f
(
float
x
)
{
return
logf
(
x
)
/
(
float
)
_M_LN2
;
}
static
const
float
_M_LN10
=
2
.
30258509299404
;
// 0x40135d8e
float
log10f
(
float
x
)
{
return
logf
(
x
)
/
(
float
)
_M_LN10
;
}
...
...
ports/stm32/mpconfigport.h
View file @
81a06d2c
...
...
@@ -335,6 +335,9 @@ static inline mp_uint_t disable_irq(void) {
} while (0);
#endif
// We need an implementation of the log2 function which is not a macro
#define MP_NEED_LOG2 (1)
// There is no classical C heap in bare-metal ports, only Python
// garbage-collected heap. For completeness, emulate C heap via
// GC heap. Note that MicroPython core never uses malloc() and friends,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment