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.

TMS320F28388D: 函数传入形参时,传入错误

Part Number: TMS320F28388D

嗨,工程师你好:

在开发中,遇到一个问题,函数在传入形参时,传入错误,具体描述如下,帮忙分析一下,十分感谢

函数原型=================================================

#define CPUTIMER1_BASE            0x00000C08U

#define DEVICE_SYSCLK_FREQ          ((DEVICE_OSCSRC_FREQ * 32) / (2 * 2 * 1))

#define DEVICE_OSCSRC_FREQ          25000000U

configCPUTimer(CPUTIMER1_BASE, DEVICE_SYSCLK_FREQ, 1000000);

void configCPUTimer(uint32_t cpuTimer, float freq, float period)

{

    uint32_t temp;

 

    static uint32_t freq1 = 0;

    static uint32_t period1 = 0;

 

     freq1 = freq;

     period1 = period;

 

    temp = (uint32_t)(freq / 1000000 * period);

    CPUTimer_setPeriod(cpuTimer, temp); //配置周期

}

断点调试===========================================

问题===============================================

形参数据类型定义的是浮点型,传入的cpuTimer应为0x00000C08U,freq应为200000000,period应为1000000

但是通过观测变量数值,全部错误