Specifications

Reviewing the Source Code Changes
Analyzing Real-Time Behavior
6-5
6.3 Reviewing the Source Code Changes
Double-click on the volume.c file in the Project View to see the source code
in the right half of the Code Composer Studio window.
Since you copied the volume.c file from the c:\ti\c6000\tutorial\volume4\ folder
to your working folder, the source code now contains the following differences
from the source code used in the previous chapter:
Added the following to the list of included header files:
#include <rtdx.h>
Added the following to the declarations:
RTDX_CreateInputChannel(control_channel);
Void loadchange(Void);
Added the following call to the main function:
RTDX_enableInput(&control_channel);
The following function is called by the PRD object you created in section
6.2, page 6-3. This is where the processor is controlled.
/* ======== loadchange ========
* FUNCTION: Called from loadchange_PRD to
* periodically update load value.
* PARAMETERS: none.
* RETURN VALUE: none.
*/
Void loadchange()
{
static Int control = MINCONTROL;
/* Read new load control when host sends it */
if (!RTDX_channelBusy(&control_channel)) {
RTDX_readNB(&control_channel, &control,
sizeof(control));
if ((control < MINCONTROL) || (control > MAXCONTROL)) {
LOG_printf(&trace,"Control value out of range");
}
else {
processingLoad = control;
LOG_printf(&trace,"Load value = %d",processingLoad);
}
}
}