/*
* main.c
*
* Created on: 2018年8月10日
* Author: Limerrence
*/
#include "F28x_Project.h"
void main(void)
{
uint32_t delay;
InitSysCtrl();
// Set pin direction
EALLOW;
GpioCtrlRegs.GPADIR.bit.GPIO31 = 1;
EDIS;
GPIO_SetupPinOptions(34, GPIO_OUTPUT, GPIO_PUSHPULL);
GPIO_SetupPinMux(34, GPIO_MUX_CPU2, 0);
// turn off LED
GpioDataRegs.GPADAT.bit.GPIO31 = 1;
while(1)
{
// Turn on LED
GpioDataRegs.GPADAT.bit.GPIO31 = 0;
// Delay for a bit.
for(delay = 0; delay < 2000000; delay++)
{
}
// Turn off LED
GpioDataRegs.GPADAT.bit.GPIO31 = 1;
// Delay for a bit.
for(delay = 0; delay < 2000000; delay++)
{
}
}
}
到此CPU1的工程就建好了,接下来是CPU2的工程,和CPU1工程的建立是基本一样的
/*
* main.c
*
* Created on: 2018年8月10日
* Author: Limerrence
*/
#include "F28x_Project.h"
void main(void)
{
uint32_t delay;
// turn off LED
GpioDataRegs.GPBDAT.bit.GPIO34 = 1;
while(1)
{
// Turn on LED
GpioDataRegs.GPBDAT.bit.GPIO34 = 0;
// Delay for a bit.
for(delay = 0; delay < 2000000; delay++)
{
}
// Turn off LED
GpioDataRegs.GPBDAT.bit.GPIO34 = 1;
// Delay for a bit.
for(delay = 0; delay < 2000000; delay++)
{
}
}
}
最后添加完文件应该是这样的