Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
circuitpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
circuitpython
Commits
e4be56a0
Commit
e4be56a0
authored
Mar 02, 2017
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qemu-arm: Enable machine module and associated tests.
parent
4f3c1b3f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
1 deletion
+53
-1
qemu-arm/Makefile
qemu-arm/Makefile
+2
-0
qemu-arm/modmachine.c
qemu-arm/modmachine.c
+47
-0
qemu-arm/mpconfigport.h
qemu-arm/mpconfigport.h
+4
-0
tools/tinytest-codegen.py
tools/tinytest-codegen.py
+0
-1
No files found.
qemu-arm/Makefile
View file @
e4be56a0
...
...
@@ -36,9 +36,11 @@ LDFLAGS= --specs=nano.specs --specs=rdimon.specs -Wl,--gc-sections -Wl,-Map=$(@:
SRC_C
=
\
main.c
\
modmachine.c
\
SRC_TEST_C
=
\
test_main.c
\
modmachine.c
\
LIB_SRC_C
=
$(
addprefix
lib/,
\
libm/math.c
\
...
...
qemu-arm/modmachine.c
0 → 100644
View file @
e4be56a0
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Damien P. George
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "extmod/machine_mem.h"
#include "extmod/machine_pinbase.h"
#include "extmod/machine_signal.h"
STATIC
const
mp_rom_map_elem_t
machine_module_globals_table
[]
=
{
{
MP_ROM_QSTR
(
MP_QSTR___name__
),
MP_ROM_QSTR
(
MP_QSTR_umachine
)
},
{
MP_ROM_QSTR
(
MP_QSTR_mem8
),
MP_ROM_PTR
(
&
machine_mem8_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_mem16
),
MP_ROM_PTR
(
&
machine_mem16_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_mem32
),
MP_ROM_PTR
(
&
machine_mem32_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_PinBase
),
MP_ROM_PTR
(
&
machine_pinbase_type
)
},
{
MP_ROM_QSTR
(
MP_QSTR_Signal
),
MP_ROM_PTR
(
&
machine_signal_type
)
},
};
STATIC
MP_DEFINE_CONST_DICT
(
machine_module_globals
,
machine_module_globals_table
);
const
mp_obj_module_t
mp_module_machine
=
{
.
base
=
{
&
mp_type_module
},
.
globals
=
(
mp_obj_dict_t
*
)
&
machine_module_globals
,
};
qemu-arm/mpconfigport.h
View file @
e4be56a0
...
...
@@ -33,6 +33,7 @@
#define MICROPY_PY_URE (1)
#define MICROPY_PY_UHEAPQ (1)
#define MICROPY_PY_UHASHLIB (1)
#define MICROPY_PY_MACHINE (1)
#define MICROPY_USE_INTERNAL_PRINTF (0)
// type definitions for the specific machine
...
...
@@ -57,5 +58,8 @@ typedef long mp_off_t;
#define MICROPY_PORT_BUILTINS \
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_ROM_QSTR(MP_QSTR_umachine), MP_ROM_PTR(&mp_module_machine) }, \
// We need to provide a declaration/definition of alloca()
#include <alloca.h>
tools/tinytest-codegen.py
View file @
e4be56a0
...
...
@@ -51,7 +51,6 @@ exclude_tests = (
'float/float2int_doubleprec.py'
,
# requires double precision floating point to work
'inlineasm/asmfpaddsub.py'
,
'inlineasm/asmfpcmp.py'
,
'inlineasm/asmfpldrstr.py'
,
'inlineasm/asmfpmuldiv.py'
,
'inlineasm/asmfpsqrt.py'
,
'extmod/ticks_diff.py'
,
'extmod/time_ms_us.py'
,
'extmod/uheapq_timeq.py'
,
'extmod/machine_pinbase.py'
,
'extmod/machine_pulse.py'
,
'extmod/vfs_fat_ramdisk.py'
,
'extmod/vfs_fat_fileio.py'
,
'extmod/vfs_fat_fsusermount.py'
,
'extmod/vfs_fat_oldproto.py'
,
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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