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
0347fbd2
Commit
0347fbd2
authored
Jan 29, 2014
by
Damien George
Browse files
Merge branch 'master' of github.com:iabdalkader/micropython
parents
08d07559
bfb01e9d
Changes
5
Hide whitespace changes
Inline
Side-by-side
stm/file.c
View file @
0347fbd2
...
...
@@ -3,7 +3,6 @@
#include
"misc.h"
#include
"mpconfig.h"
#include
"mpconfigport.h"
#include
"qstr.h"
#include
"obj.h"
#include
"file.h"
...
...
stm/gccollect.c
View file @
0347fbd2
...
...
@@ -13,10 +13,10 @@ void gc_helper_get_regs_and_clean_stack(machine_uint_t *regs, machine_uint_t hea
void
gc_collect
(
void
)
{
uint32_t
start
=
sys_tick_counter
;
gc_collect_start
();
gc_collect_root
((
void
**
)
&
_ram_start
,
(
(
uint32_t
)
&
_heap_start
-
(
uint32_t
)
&
_ram_start
)
/
4
);
gc_collect_root
((
void
**
)
&
_ram_start
,
(
&
_heap_start
-
&
_ram_start
)
/
4
);
machine_uint_t
regs
[
10
];
gc_helper_get_regs_and_clean_stack
(
regs
,
HEAP_END
);
gc_collect_root
((
void
**
)
HEAP_END
,
(
RAM_END
-
HEAP_END
)
/
4
);
// will trace regs since they now live in this function on the stack
gc_helper_get_regs_and_clean_stack
(
regs
,
(
machine_uint_t
)
&
_heap_end
);
gc_collect_root
((
void
**
)
&
_heap_end
,
(
&
_ram_end
-
&
_heap_end
)
/
4
);
// will trace regs since they now live in this function on the stack
gc_collect_end
();
uint32_t
ticks
=
sys_tick_counter
-
start
;
// TODO implement a function that does this properly
...
...
stm/gccollect.h
View file @
0347fbd2
#define HEAP_END (0x2001c000) // tunable
#define RAM_END (0x20020000) // fixed for chip
extern
uint32_t
_ram_start
;
extern
uint32_t
_heap_start
;
extern
uint32_t
_ram_end
;
extern
uint32_t
_heap_end
;
void
gc_collect
(
void
);
...
...
stm/main.c
View file @
0347fbd2
...
...
@@ -206,12 +206,14 @@ static mp_obj_t pyb_info(void) {
return
mp_const_none
;
}
#if MICROPY_HW_HAS_SDCARD
// SD card test
static
mp_obj_t
pyb_sd_test
(
void
)
{
extern
void
sdio_init
(
void
);
sdio_init
();
return
mp_const_none
;
}
#endif
static
void
SYSCLKConfig_STOP
(
void
)
{
/* After wake-up from STOP reconfigure the system clock */
...
...
@@ -594,7 +596,7 @@ int main(void) {
soft_reset:
// GC init
gc_init
(
&
_heap_start
,
(
void
*
)
HEAP_END
);
gc_init
(
&
_heap_start
,
&
_heap_end
);
// Micro Python init
qstr_init
();
...
...
stm/stm32f405.ld
View file @
0347fbd2
...
...
@@ -19,6 +19,9 @@ _minimum_heap_size = 16K;
/* top end of the stack */
_estack = ORIGIN(RAM) + LENGTH(RAM);
_ram_end = 0x20020000;
_heap_end = 0x2001c000;
/* define output sections */
SECTIONS
{
...
...
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