Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
318f63c8
Commit
318f63c8
authored
Apr 05, 2018
by
Damien George
Browse files
leon: Use leon_printf instead of mp_printf for manager tasks.
parent
c6f62710
Changes
12
Hide whitespace changes
Inline
Side-by-side
leon-ex-manager/Makefile
View file @
318f63c8
...
...
@@ -41,6 +41,7 @@ LIBS += -lm
SRC_C
=
\
main.c
\
lib/libc/string0.c
\
$(LEON_COMMON)
/leonprintf.c
\
$(LEON_COMMON)
/mputil.c
\
$(LEON_COMMON)
/mpvmmanage.c
\
$(LEON_COMMON)
/mphalport.c
\
...
...
leon-ex-manager/main.c
View file @
318f63c8
...
...
@@ -91,7 +91,7 @@ rtems_task Init(rtems_task_argument ignored) {
// MicroPython manager task
#include
"py/mpstate.h"
#include
"
py/mp
print.h"
#include
"
leon-common/leon
print
f
.h"
#include
"mpvmmanage.h"
// include the precompiled bytecode (generated by external tools)
...
...
@@ -102,7 +102,7 @@ static mp_state_ctx_t mp_state_ctx[MICROPY_RTEMS_NUM_TASKS];
static
byte
mp_heap
[
MICROPY_RTEMS_NUM_TASKS
*
MICROPY_RTEMS_HEAP_SIZE
];
rtems_task
mp_manager_task
(
rtems_task_argument
ignored
)
{
mp
_printf
(
&
mp_plat_print
,
"
\n
MicroPython manager task started
\n
"
);
leon
_printf
(
"
\n
MicroPython manager task started
\n
"
);
rtems_name
task_name
[
MICROPY_RTEMS_NUM_TASKS
];
rtems_id
task_id
[
MICROPY_RTEMS_NUM_TASKS
];
...
...
@@ -131,12 +131,12 @@ rtems_task mp_manager_task(rtems_task_argument ignored) {
// pause the script
mp_vm_manager_pause
(
&
mp_state_ctx
[
0
],
10000
,
&
line
);
mp
_printf
(
&
mp_plat_print
,
"Manager got line %u
\n
"
,
(
uint
)
line
);
leon
_printf
(
"Manager got line %u
\n
"
,
(
uint
)
line
);
// step through the script
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
mp_vm_manager_step
(
&
mp_state_ctx
[
0
],
10000
,
&
line
);
mp
_printf
(
&
mp_plat_print
,
"Manager got line %u
\n
"
,
(
uint
)
line
);
leon
_printf
(
"Manager got line %u
\n
"
,
(
uint
)
line
);
}
// resume the script
...
...
leon-ex-minimal/Makefile
View file @
318f63c8
...
...
@@ -41,6 +41,7 @@ LIBS += -lm
SRC_C
=
\
main.c
\
lib/libc/string0.c
\
$(LEON_COMMON)
/leonprintf.c
\
$(LEON_COMMON)
/mputil.c
\
$(LEON_COMMON)
/mphalport.c
\
$(LEON_COMMON)
/modtime.c
\
...
...
leon-ex-minimal/main.c
View file @
318f63c8
...
...
@@ -86,15 +86,15 @@ rtems_task Init(rtems_task_argument ignored) {
/******************************************************************************/
// MicroPython manager task
#include
"
py/mp
print.h"
#include
"
leon-common/leon
print
f
.h"
// this function is used as a hook to set a breakpoint to terminate emu
void
emu_terminate
(
void
)
{
mp
_printf
(
&
mp_plat_print
,
"emu_terminate
\n
"
);
leon
_printf
(
"emu_terminate
\n
"
);
}
rtems_task
mp_manager_task
(
rtems_task_argument
ignored
)
{
mp
_printf
(
&
mp_plat_print
,
"
\n
MicroPython manager task started
\n
"
);
leon
_printf
(
"
\n
MicroPython manager task started
\n
"
);
rtems_name
task_name
[
MICROPY_RTEMS_NUM_TASKS
];
rtems_id
task_id
[
MICROPY_RTEMS_NUM_TASKS
];
...
...
leon-ex-pystone/Makefile
View file @
318f63c8
...
...
@@ -43,6 +43,7 @@ LIBS += -lm
SRC_C
=
\
main.c
\
lib/libc/string0.c
\
$(LEON_COMMON)
/leonprintf.c
\
$(LEON_COMMON)
/mputil.c
\
$(LEON_COMMON)
/mphalport.c
\
$(LEON_COMMON)
/modtime.c
\
...
...
leon-ex-pystone/main.c
View file @
318f63c8
...
...
@@ -82,15 +82,15 @@ rtems_task Init(rtems_task_argument ignored) {
/******************************************************************************/
// MicroPython manager task
#include
"
py/mp
print.h"
#include
"
leon-common/leon
print
f
.h"
// this function is used as a hook to set a breakpoint to terminate emu
void
emu_terminate
(
void
)
{
mp
_printf
(
&
mp_plat_print
,
"emu_terminate
\n
"
);
leon
_printf
(
"emu_terminate
\n
"
);
}
rtems_task
mp_manager_task
(
rtems_task_argument
ignored
)
{
mp
_printf
(
&
mp_plat_print
,
"
\n
MicroPython manager task started
\n
"
);
leon
_printf
(
"
\n
MicroPython manager task started
\n
"
);
rtems_name
task_name
[
MICROPY_RTEMS_NUM_TASKS
];
rtems_id
task_id
[
MICROPY_RTEMS_NUM_TASKS
];
...
...
leon-ex-tasks/Makefile
View file @
318f63c8
...
...
@@ -41,6 +41,7 @@ LIBS += -lm
SRC_C
=
\
main.c
\
lib/libc/string0.c
\
$(LEON_COMMON)
/leonprintf.c
\
$(LEON_COMMON)
/mputil.c
\
$(LEON_COMMON)
/mphalport.c
\
$(LEON_COMMON)
/modtime.c
\
...
...
leon-ex-tasks/main.c
View file @
318f63c8
...
...
@@ -85,10 +85,10 @@ rtems_task Init(rtems_task_argument ignored) {
/******************************************************************************/
// MicroPython manager task
#include
"
py/mp
print.h"
#include
"
leon-common/leon
print
f
.h"
rtems_task
mp_manager_task
(
rtems_task_argument
ignored
)
{
mp
_printf
(
&
mp_plat_print
,
"
\n
MicroPython manager task started
\n
"
);
leon
_printf
(
"
\n
MicroPython manager task started
\n
"
);
rtems_name
task_name
[
MICROPY_RTEMS_NUM_TASKS
];
rtems_id
task_id
[
MICROPY_RTEMS_NUM_TASKS
];
...
...
leon-for-tests/Makefile
View file @
318f63c8
...
...
@@ -48,6 +48,7 @@ SRC_C = \
lib/libc/strcmp.c
\
lib/libc/strlen.c
\
lib/libc/strncmp.c
\
$(LEON_COMMON)
/leonprintf.c
\
$(LEON_COMMON)
/nearbyint.c
\
$(LEON_COMMON)
/mputil.c
\
$(LEON_COMMON)
/mphalport.c
\
...
...
leon-for-tests/main.c
View file @
318f63c8
...
...
@@ -97,16 +97,16 @@ rtems_task Init(rtems_task_argument ignored) {
#define MPY_MEM_BASE (0x40200000)
#define MPY_MEM_STRIDE (0x00010000)
#include
"py/mpprint.h"
#include
"py/mphal.h"
#include
"leon-common/leonprintf.h"
// this function is used as a hook to set a breakpoint to terminate emu
void
emu_terminate
(
void
)
{
mp
_printf
(
&
mp_plat_print
,
"emu_terminate
\n
"
);
leon
_printf
(
"emu_terminate
\n
"
);
}
rtems_task
mp_manager_task
(
rtems_task_argument
ignored
)
{
mp
_printf
(
&
mp_plat_print
,
"
\n
MicroPython manager task started
\n
"
);
leon
_printf
(
"
\n
MicroPython manager task started
\n
"
);
// detect the number of tasks needed by looking for valid scripts
int
num_tasks
=
0
;
...
...
@@ -120,7 +120,7 @@ rtems_task mp_manager_task(rtems_task_argument ignored) {
break
;
}
}
mp
_printf
(
&
mp_plat_print
,
"Detected %u scripts
\n
"
,
num_tasks
);
leon
_printf
(
"Detected %u scripts
\n
"
,
num_tasks
);
// we must use hexlified output so it isn't modified by the UART
mp_hal_stdout_enable_hexlify
();
...
...
@@ -137,12 +137,12 @@ rtems_task mp_manager_task(rtems_task_argument ignored) {
MICROPY_RTEMS_TASK_ATTRIBUTES
,
&
task_id
[
i
]
);
if
(
status
!=
RTEMS_SUCCESSFUL
)
{
mp
_printf
(
&
mp_plat_print
,
"Error creating task #%u: %u
\n
"
,
i
,
status
);
leon
_printf
(
"Error creating task #%u: %u
\n
"
,
i
,
status
);
emu_terminate
();
}
status
=
rtems_task_start
(
task_id
[
i
],
mp_worker_task
,
i
);
if
(
status
!=
RTEMS_SUCCESSFUL
)
{
mp
_printf
(
&
mp_plat_print
,
"Error starting task #%u: %u
\n
"
,
i
,
status
);
leon
_printf
(
"Error starting task #%u: %u
\n
"
,
i
,
status
);
emu_terminate
();
}
}
...
...
leon-spacebel/Makefile
View file @
318f63c8
...
...
@@ -48,6 +48,7 @@ SRC_C = \
lib/libc/strcmp.c
\
lib/libc/strlen.c
\
lib/libc/strncmp.c
\
$(LEON_COMMON)
/leonprintf.c
\
$(LEON_COMMON)
/nearbyint.c
\
$(LEON_COMMON)
/mputil.c
\
$(LEON_COMMON)
/mphalport.c
\
...
...
leon-spacebel/main.c
View file @
318f63c8
...
...
@@ -97,16 +97,16 @@ rtems_task Init(rtems_task_argument ignored) {
#define MPY_MEM_BASE (0x40200000)
#define MPY_MEM_STRIDE (0x00010000)
#include
"py/mpprint.h"
#include
"py/mphal.h"
#include
"leon-common/leonprintf.h"
// this function is used as a hook to set a breakpoint to terminate emu
void
emu_terminate
(
void
)
{
mp
_printf
(
&
mp_plat_print
,
"emu_terminate
\n
"
);
leon
_printf
(
"emu_terminate
\n
"
);
}
rtems_task
mp_manager_task
(
rtems_task_argument
ignored
)
{
mp
_printf
(
&
mp_plat_print
,
"
\n
MicroPython manager task started
\n
"
);
leon
_printf
(
"
\n
MicroPython manager task started
\n
"
);
// detect the number of tasks needed by looking for valid scripts
int
num_tasks
=
0
;
...
...
@@ -120,7 +120,7 @@ rtems_task mp_manager_task(rtems_task_argument ignored) {
break
;
}
}
mp
_printf
(
&
mp_plat_print
,
"Detected %u scripts
\n
"
,
num_tasks
);
leon
_printf
(
"Detected %u scripts
\n
"
,
num_tasks
);
// we must use hexlified output so it isn't modified by the UART
mp_hal_stdout_enable_hexlify
();
...
...
@@ -137,12 +137,12 @@ rtems_task mp_manager_task(rtems_task_argument ignored) {
MICROPY_RTEMS_TASK_ATTRIBUTES
,
&
task_id
[
i
]
);
if
(
status
!=
RTEMS_SUCCESSFUL
)
{
mp
_printf
(
&
mp_plat_print
,
"Error creating task #%u: %u
\n
"
,
i
,
status
);
leon
_printf
(
"Error creating task #%u: %u
\n
"
,
i
,
status
);
emu_terminate
();
}
status
=
rtems_task_start
(
task_id
[
i
],
mp_worker_task
,
i
);
if
(
status
!=
RTEMS_SUCCESSFUL
)
{
mp
_printf
(
&
mp_plat_print
,
"Error starting task #%u: %u
\n
"
,
i
,
status
);
leon
_printf
(
"Error starting task #%u: %u
\n
"
,
i
,
status
);
emu_terminate
();
}
}
...
...
Write
Preview
Supports
Markdown
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