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.

ccs中printf到console窗口问题

我使用ccs5.4 ,28335,使用printf打印时,只能打印出高16位。想打印32位数。。

  • 不知您的代码是怎样的.我附上之前测试的代码,您可以参考一下

    #include <stdint.h>
    #include <stdio.h>
    
    typedef int64_t S64;
    typedef int32_t S32;
    typedef int16_t S16;
    
    S32 OSDC__s32Time_Error;
    S16 OSDC__s16ProportionalGain, OSDC__s16LoopGain;
    S64 s64Time_Error, s64ProportionalGain, s64LoopGain;
    S64 s64PropComponent, OSDC__s64IntegratorState;
    S64 s64PropComponentTest, OSDC__s64IntegratorStateTest;
    
    void init()
    {
      OSDC__s32Time_Error = 0x24F235C2;
      OSDC__s16ProportionalGain = 0x5000;
      OSDC__s16LoopGain = 0x0028;
    }
    
    void TestFunction1(void)
    {
      s64Time_Error       = (S64)OSDC__s32Time_Error;
      s64ProportionalGain = (S64)OSDC__s16ProportionalGain;
      s64LoopGain         = (S64)OSDC__s16LoopGain;
    
      s64PropComponent          = s64Time_Error * s64ProportionalGain;
      OSDC__s64IntegratorState += s64Time_Error * s64LoopGain;
    }
    
    void TestFunction2(void)
    {
      S64 s64Time_Error__STACK;
      S64 s64ProportionalGain__STACK;
      S64 s64LoopGain__STACK;
    
      s64Time_Error__STACK       = (S64)OSDC__s32Time_Error;
      s64ProportionalGain__STACK = (S64)OSDC__s16ProportionalGain;
      s64LoopGain__STACK         = (S64)OSDC__s16LoopGain;
    
      s64PropComponentTest          = s64Time_Error__STACK * s64ProportionalGain__STACK;
      OSDC__s64IntegratorStateTest += s64Time_Error__STACK * s64LoopGain__STACK;
    }
    
    
    void main()
    {
       init();
    
       TestFunction1();
       puts("After TestFunction1");
       printf("s64PropComponent: 0x%llx, expected 0xB8BB0CCA000\n",
                  s64PropComponent);
       printf("OSDC__s64IntegratorState: 0x%llx, expected 0x5C5D86650\n",
                  OSDC__s64IntegratorState);
    
       TestFunction2();
       puts("After TestFunction2");
       printf("s64PropComponentTest: 0x%llx, expected 0xB8BB0CCA000\n",
                  s64PropComponentTest);
       printf("OSDC__s64IntegratorStateTest: 0x%llx, expected 0x5C5D86650\n",
                  OSDC__s64IntegratorStateTest);
    }