Software Interrupts
4-34
Figure 4-9.
Using SWI_or to Post an SWI.
If the program execution requires that multiple occurrences of the same event
must take place before an SWI is posted, SWI_dec should be used to post
the SWI as shown in Figure 4-10. By configuring the SWI mailbox to be equal
to the number of occurrences of the event before the SWI should be posted
and calling SWI_dec every time the event occurs, the SWI is posted only after
its mailbox reaches 0; that is, after the event has occurred a number of times
equal to the mailbox value.
Program configuration
SWI object myswi Function myswiFxn()
Program
execution
· Calls
SWI_or(&myswi, 0x1)
· myswi is posted
· myswiFxn() is executed
†
· Calls
SWI_or(&myswi, 0x2)
· myswi is posted
· myswiFxn() is executed
Mailbox
value
Value returned by
SWI_getmbox
0 ... 0 0
...
0 ... 0 1
0 ... 0 0
0 ... 1 0
0 ... 0 0
...
0 ... 0 1
...
0 ... 1 0
myswiFxn()
{
...
eventType = SWI_getmbox();
switch (eventType) {
case '0x1':
'run processing algorithm 1'
case '0x2':
'run processing algorithm 2'
case '0x4':
'run processing algorithm 3'
...
}
...
}
Summary of Contents for TMS320 Series
Page 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Page 16: ...xvi ...
Page 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Page 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Page 202: ...5 20 ...
Page 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Page 288: ...Index 10 Index ...