This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好,
我通过IAR for ARM7.80.1配置CC1310 Launchpad开发板XDS110
运行CC1310的tirtos_cc13xx_cc26xx_2_21_00_06\examples\IAR\CC1310_LAUNCHXL\pwmled例程,
/*
* ======== pwmled.c ========
*/
/* XDCtools Header files */
#include <xdc/std.h>
#include <xdc/runtime/System.h>
/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
/* TI-RTOS Header files */
#include <ti/drivers/GPIO.h>
#include <ti/drivers/PWM.h>
/* Example/Board Header files */
#include "Board.h"
#define TASKSTACKSIZE 512
Task_Struct tsk0Struct;
UInt8 tsk0Stack[TASKSTACKSIZE];
Task_Handle task;
/*
* ======== pwmLEDFxn ========
* Task periodically increments the PWM duty for the on board LED.
*/
Void pwmLEDFxn(UArg arg0, UArg arg1)
{
PWM_Handle pwm1;
PWM_Params params;
uint16_t pwmPeriod = 3000; // Period and duty in microseconds
uint16_t duty = 0;
uint16_t dutyInc = 100;
PWM_Params_init(¶ms);
params.dutyUnits = PWM_DUTY_US;
params.dutyValue = 0;
params.periodUnits = PWM_PERIOD_US;
params.periodValue = pwmPeriod;
pwm1 = PWM_open(Board_PWM0, ¶ms);
if (pwm1 == NULL) {
System_abort("Board_PWM0 did not open");
}
PWM_start(pwm1);
/* Loop forever incrementing the PWM duty */
while (1) {
PWM_setDuty(pwm1, duty);
duty = (duty + dutyInc);
if (duty == pwmPeriod || (!duty)) {
dutyInc = - dutyInc;
}
Task_sleep((UInt) arg0);
}
}
/*
* ======== main ========
*/
int main(void)
{
Task_Params tskParams;
/* Call board init functions. */
Board_initGeneral();
Board_initGPIO();
Board_initPWM();
/* Construct LED Task thread */
Task_Params_init(&tskParams);
tskParams.stackSize = TASKSTACKSIZE;
tskParams.stack = &tsk0Stack;
tskParams.arg0 = 50;
Task_construct(&tsk0Struct, (Task_FuncPtr)pwmLEDFxn, &tskParams, NULL);
/* Obtain instance handle */
task = Task_handle(&tsk0Struct);
/* Turn on user LED */
GPIO_write(Board_LED1, Board_LED_ON);
System_printf("Starting the example\nSystem provider is set to SysMin. "
"Halt the target to view any SysMin contents in ROV.\n");
/* SysMin will only print to the console when you call flush or exit */
System_flush();
/* Start BIOS */
BIOS_start();
return (0);
}
编译后,进行调试,出现了
开发板上的红灯一直闪烁,更改程序里面的GPIO_write(Board_LED1, Board_LED_ON);开发板没有反应,还是一直闪烁红灯。
请问,这是怎么回事呢?是IAR配置环境的问题吗?应该怎么解决一下呢?
谢谢!