Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
28631537
Commit
28631537
authored
Feb 08, 2015
by
Damien George
Browse files
py: Add MICROPY_OBJ_BASE_ALIGNMENT to help with 16-bit ports.
parent
5351a481
Changes
2
Hide whitespace changes
Inline
Side-by-side
py/mpconfig.h
View file @
28631537
...
...
@@ -536,6 +536,14 @@ typedef double mp_float_t;
/*****************************************************************************/
/* Miscellaneous settings */
// All uPy objects in ROM must be aligned on at least a 4 byte boundary
// so that the small-int/qstr/pointer distinction can be made. For machines
// that don't do this (eg 16-bit CPU), define the following macro to something
// like __attribute__((aligned(4))).
#ifndef MICROPY_OBJ_BASE_ALIGNMENT
#define MICROPY_OBJ_BASE_ALIGNMENT
#endif
// On embedded platforms, these will typically enable/disable irqs.
#ifndef MICROPY_BEGIN_ATOMIC_SECTION
#define MICROPY_BEGIN_ATOMIC_SECTION() (0)
...
...
py/obj.h
View file @
28631537
...
...
@@ -46,7 +46,7 @@ typedef machine_const_ptr_t mp_const_obj_t;
struct
_mp_obj_type_t
;
struct
_mp_obj_base_t
{
const
struct
_mp_obj_type_t
*
type
;
const
struct
_mp_obj_type_t
*
type
MICROPY_OBJ_BASE_ALIGNMENT
;
};
typedef
struct
_mp_obj_base_t
mp_obj_base_t
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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