24
RabbitCore 2000
and start the program running with one keystroke, use
F9
, the run command. If the pro-
gram is not already compiled, the run command will compile it first.
•
Single-stepping. This is done with the
F8
key. The
F7
key can also be used for single-
stepping. If the
F7
key is used, then descent into subroutines will take place. With the
F8
key the subroutine is executed at full speed when the statement that calls it is
stepped over.
•
Setting break points. The
F2
key is used to turn on or turn off (toggle) a break point at
the cursor position if the program has already been compiled. You can set a break point
if the program is paused at a break point. You can also set a break point in a program
that is running at full speed. This will cause the program to break if the execution
thread hits your break point.
•
Watch expressions. A watch expression is a C expression that is evaluated on command
in the watch window. An expression is basically any type of C formula that can include
operators, variables and function calls, but not statements that require multiple lines
such as for or switch. You can have a list of watch expressions in the watch window. If
you are single-stepping, then they are all evaluated on each step. You can also com-
mand the watch expression to be evaluated by using the
<ctrl-U>
command. When a
watch expression is evaluated at a break point, it is evaluated as if the statement was at
the beginning of the function where you are single-stepping. If your program is running
you can also evaluate watch expressions with a
<ctrl-U>
if your program has a
run-
watch()
command that is frequently executed. In this case, only expressions involv-
ing global variables can be evaluated, and the expression is evaluated as if it were in a
separate function with no local variables.
4.3 Cooperative Multitasking
Cooperative multitasking is a convenient way to perform several different tasks at the
same time. An example would be to step a machine through a sequence of steps and at the
same time independently carry on a dialog with the operator via a human interface. Coop-
erative multitasking differs from another approach called preemptive multitasking.
Dynamic C supports both types of multitasking. In cooperative multitasking each separate
task voluntarily surrenders its compute time when it does not need to perform any more
activity immediately. In preemptive multitasking control is forcibly removed from the
task via an interrupt.
Dynamic C has language extensions to support multitasking. The major C constructs are
called costatements, cofunctions, and slicing. These are described more completely in the
Dynamic C (Rabbit Version) User’s Manual. The example below, sample program
FLASHLEDS2.C
, uses costatements. A costatement is a way to perform a sequence of
operations that involve pauses or waits for some external event to take place. A complete
description of costatements is in the Dynamic C (Rabbit Version) User’s Manual. The
FLASHLEDS2.C
sample program has two independent tasks. The first task flashes LED
DS2 2.5 times a second. The second task flashes DS3 every 1.5 seconds.
Содержание RabbitCore 2000
Страница 1: ...RabbitCore 2000 C Programmable Core Module Getting Started 001004 C...
Страница 4: ...RabbitCore 2000...
Страница 7: ...Getting Started 1 1 INSTALLING DYNAMIC C...
Страница 24: ...18 RabbitCore 2000...
Страница 25: ...Getting Started 19 4 SAMPLE PROGRAMS...
Страница 33: ...Getting Started SCHEMATICS...
Страница 34: ......