Implement ROMable modules. Add math module.

mp_module_obj_t can now be put in ROM.

Configuration of float type is now similar to longint: can now choose
none, float or double as the implementation.

math module has basic math functions.  For STM port, these are not yet
implemented (they are just stub functions).
This commit is contained in:
Damien George
2014-03-08 15:24:39 +00:00
parent 8fd7d7e102
commit 0c36da0b59
21 changed files with 280 additions and 117 deletions

View File

@@ -1,5 +1,6 @@
// All the qstr definitions in this file are available as constants.
// That is, they are in ROM and you can reference them simple as MP_QSTR_xxxx.
// That is, they are in ROM and you can reference them simply as MP_QSTR_xxxx.
// TODO make it so we can use #defines here to select only those words that will be used
Q(__build_class__)
Q(__class__)
@@ -115,6 +116,32 @@ Q(iterator)
Q(module)
Q(slice)
Q(math)
Q(pi)
Q(sqrt)
Q(pow)
Q(exp)
Q(log)
Q(log2)
Q(log10)
Q(cosh)
Q(sinh)
Q(tanh)
Q(acosh)
Q(asinh)
Q(atanh)
Q(cos)
Q(sin)
Q(tan)
Q(acos)
Q(asin)
Q(atan)
Q(atan2)
Q(mem_total)
Q(mem_current)
Q(mem_peak)
Q(<module>)
Q(<lambda>)
Q(<listcomp>)