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

@@ -372,7 +372,7 @@ STATIC machine_uint_t convert_obj_for_inline_asm(mp_obj_t obj) {
uint l;
return (machine_uint_t)mp_obj_str_get_data(obj, &l);
#if MICROPY_ENABLE_FLOAT
} else if (MP_OBJ_IS_TYPE(obj, &float_type)) {
} else if (MP_OBJ_IS_TYPE(obj, &mp_type_float)) {
// convert float to int (could also pass in float registers)
return (machine_int_t)mp_obj_float_get(obj);
#endif