Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
28631537
Commit
28631537
authored
10 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py: Add MICROPY_OBJ_BASE_ALIGNMENT to help with 16-bit ports.
parent
5351a481
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
py/mpconfig.h
+8
-0
8 additions, 0 deletions
py/mpconfig.h
py/obj.h
+1
-1
1 addition, 1 deletion
py/obj.h
with
9 additions
and
1 deletion
py/mpconfig.h
+
8
−
0
View file @
28631537
...
@@ -536,6 +536,14 @@ typedef double mp_float_t;
...
@@ -536,6 +536,14 @@ typedef double mp_float_t;
/*****************************************************************************/
/*****************************************************************************/
/* Miscellaneous settings */
/* 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.
// On embedded platforms, these will typically enable/disable irqs.
#ifndef MICROPY_BEGIN_ATOMIC_SECTION
#ifndef MICROPY_BEGIN_ATOMIC_SECTION
#define MICROPY_BEGIN_ATOMIC_SECTION() (0)
#define MICROPY_BEGIN_ATOMIC_SECTION() (0)
...
...
This diff is collapsed.
Click to expand it.
py/obj.h
+
1
−
1
View file @
28631537
...
@@ -46,7 +46,7 @@ typedef machine_const_ptr_t mp_const_obj_t;
...
@@ -46,7 +46,7 @@ typedef machine_const_ptr_t mp_const_obj_t;
struct
_mp_obj_type_t
;
struct
_mp_obj_type_t
;
struct
_mp_obj_base_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
;
typedef
struct
_mp_obj_base_t
mp_obj_base_t
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment