@@ -419,42 +419,6 @@ STATIC mp_obj_t machine_reset_cause(void) {
419419STATIC MP_DEFINE_CONST_FUN_OBJ_0 (machine_reset_cause_obj , machine_reset_cause );
420420#endif
421421
422- // To use compile-time constants we are restricted to 31-bit numbers (a small int,
423- // so it fits in a Micro Python object pointer). Thus, when extracting a constant
424- // from an object, we must clear the MSB.
425-
426- uintptr_t mod_machine_mem_get_read_addr (mp_obj_t addr_o , uint align ) {
427- uint32_t addr = mp_obj_get_int_truncated (addr_o );
428- if (MP_OBJ_IS_SMALL_INT (addr_o )) {
429- addr &= 0x7fffffff ;
430- }
431- /*
432- if (addr < 0x10000000) {
433- nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "cannot read from address %08x", addr));
434- }
435- */
436- if ((addr & (align - 1 )) != 0 ) {
437- nlr_raise (mp_obj_new_exception_msg_varg (& mp_type_ValueError , "address %08x is not aligned to %d bytes" , addr , align ));
438- }
439- return addr ;
440- }
441-
442- uintptr_t mod_machine_mem_get_write_addr (mp_obj_t addr_o , uint align ) {
443- uint32_t addr = mp_obj_get_int_truncated (addr_o );
444- if (MP_OBJ_IS_SMALL_INT (addr_o )) {
445- addr &= 0x7fffffff ;
446- }
447- if (addr < 0x10000000 ) {
448- // Everything below 0x10000000 is either ROM or aliased to something higher, so we don't
449- // lose anything by restricting writes to this area, and we gain some safety.
450- nlr_raise (mp_obj_new_exception_msg_varg (& mp_type_ValueError , "cannot write to address %08x" , addr ));
451- }
452- if ((addr & (align - 1 )) != 0 ) {
453- nlr_raise (mp_obj_new_exception_msg_varg (& mp_type_ValueError , "address %08x is not aligned to %d bytes" , addr , align ));
454- }
455- return addr ;
456- }
457-
458422STATIC const mp_map_elem_t machine_module_globals_table [] = {
459423 { MP_OBJ_NEW_QSTR (MP_QSTR___name__ ), MP_OBJ_NEW_QSTR (MP_QSTR_umachine ) },
460424 { MP_OBJ_NEW_QSTR (MP_QSTR_info ), (mp_obj_t )& machine_info_obj },
0 commit comments