liuqian 发表于 2016-5-31 11:06:06

MCC生成的I2C代码,怪异的一个;

更新到最新的 MPLABX v3.30 和XC8 v1.37,CPU是PIC1825K80
用MCC生成I2C代码,在I2C_MasterTRBInsert函数中有

    // for interrupt based
    if (*pflag == I2C_MESSAGE_PENDING)
    {
      while(i2c_state != S_MASTER_IDLE);                        // 为什么会有;
      {                                                                                // 如果;是对的,这里用{},是故意要把人绕晕吗
            // force the task to run since we know that the queue has
            // something that needs to be sent
            PIR1bits.SSPIF = true;
      }
    }   // block until request is complete

板子没回来,还没法测
页: [1]
查看完整版本: MCC生成的I2C代码,怪异的一个;