TI中文支持网
TI专业的中文技术问题搜集分享网站

177-D subscript out of range

我在调试proj_LAB02B时想把GPIO6 设为pwm4a  报数组出界警告

{
HAL_Obj *obj = (HAL_Obj *) halHandle;
GPIO_setMode(obj->gpioHandle,GPIO_Number_6,GPIO_6_Mode_EPWM4A);

PWM_write_CmpA(obj->pwmHandle[3],1000);

}

我在 HAL_Obj已经改为 PWM_Handle    pwmHandle[4];

typedef struct _HAL_Obj_
{
ADC_Handle adcHandle; //!< the ADC handle

CLK_Handle clkHandle; //!< the clock handle
CPU_Handle cpuHandle; //!< the CPU handle

FLASH_Handle flashHandle; //!< the flash handle

GPIO_Handle gpioHandle; //!< the GPIO handle

OFFSET_Handle offsetHandle_I[3]; //!< the handles for the current offset estimators
OFFSET_Obj offset_I[3]; //!< the current offset objects

OFFSET_Handle offsetHandle_V[3]; //!< the handles for the voltage offset estimators
OFFSET_Obj offset_V[3]; //!< the voltage offset objects

OSC_Handle oscHandle; //!< the oscillator handle

PIE_Handle pieHandle; //<! the PIE handleX

PLL_Handle pllHandle; //!< the PLL handle

PWM_Handle pwmHandle[4]; //<! the PWM handles

PWMDAC_Handle pwmDacHandle[4]; //<! the PWMDAC handles

这是为什么?

Johnson Chen1:

貌似变量超出范围?你可以参考我在下面帖子里的另一种方法实现,

http://www.deyisupport.com/question_answer/microcontrollers/c2000/f/56/p/112106/306049.aspx#306049

我在调试proj_LAB02B时想把GPIO6 设为pwm4a  报数组出界警告

{
HAL_Obj *obj = (HAL_Obj *) halHandle;
GPIO_setMode(obj->gpioHandle,GPIO_Number_6,GPIO_6_Mode_EPWM4A);

PWM_write_CmpA(obj->pwmHandle[3],1000);

}

我在 HAL_Obj已经改为 PWM_Handle    pwmHandle[4];

typedef struct _HAL_Obj_
{
ADC_Handle adcHandle; //!< the ADC handle

CLK_Handle clkHandle; //!< the clock handle
CPU_Handle cpuHandle; //!< the CPU handle

FLASH_Handle flashHandle; //!< the flash handle

GPIO_Handle gpioHandle; //!< the GPIO handle

OFFSET_Handle offsetHandle_I[3]; //!< the handles for the current offset estimators
OFFSET_Obj offset_I[3]; //!< the current offset objects

OFFSET_Handle offsetHandle_V[3]; //!< the handles for the voltage offset estimators
OFFSET_Obj offset_V[3]; //!< the voltage offset objects

OSC_Handle oscHandle; //!< the oscillator handle

PIE_Handle pieHandle; //<! the PIE handleX

PLL_Handle pllHandle; //!< the PLL handle

PWM_Handle pwmHandle[4]; //<! the PWM handles

PWMDAC_Handle pwmDacHandle[4]; //<! the PWMDAC handles

这是为什么?

hang shang:

回复 Johnson Chen1:

你好,我想问一下把MSP430F146用的程序,放到f5529芯片中使用,需要更改什么地方?非常感谢

赞(0)
未经允许不得转载:TI中文支持网 » 177-D subscript out of range
分享到: 更多 (0)