新手问问题:
MCU:TMS320F28069
CCS:5.3
打开CCS中的一个SYS/BIOS例程,如何直接控制IO端口呢?另外, Log_info1("10 ticks. Tick Count = %d\n", tickCount); 的输入信息从哪个窗口查看呢:
代码如下:
#include "F2806x_Device.h"
Void main()
{
/*
* Print "Hello world" to a log buffer.
*/
Log_info0("Hello world\n");
//EALLOW;
GpioCtrlRegs.GPBMUX1.bit.GPIO34 = 0;
GpioCtrlRegs.GPBDIR.bit.GPIO34 = 1;
//EDIS;
/*
* Start BIOS.
* Begins task scheduling.
*/
BIOS_start(); /* does not return */
}
/*
* ======== myTickFxn ========
* Timer ISR function that posts a Swi to perform
* the non-realtime service functions.
*/
Void myTickFxn(UArg arg)
{
tickCount += 1; /* increment the counter */
/* every 10 timer interrupts post the semaphore */
if ((tickCount % 10) == 0)
{
Semaphore_post(mySem);
}
}
/*
* ======== myTaskFxn ========
* Task function that pends on a semaphore until 10 ticks have
* expired.
*/
Void myTaskFxn(Void)
{
/*
* Do this forever
*/
while (TRUE) {
/*
* Pend on "mySemaphore" until the timer ISR says
* its time to do something.
*/
Semaphore_pend(mySem, BIOS_WAIT_FOREVER);
GpioDataRegs.GPBTOGGLE.bit.GPIO34 = 1;
/*
* Print the current value of tickCount to a log buffer.
*/
Log_info1("10 ticks. Tick Count = %d\n", tickCount);
}
}