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.

例程keyfob中 是怎么开始进入到三轴加速器程序中的



在KeyFobApp_ProcessEvent 这个事件处理函数中 

if ( events & KFD_ACCEL_READ_EVT )

{

    bStatus_t status = Accel_GetParameter( ACCEL_ENABLER, &accelEnabler ); // accelEnabler = accelEnabled,而accelEnabled被#define为FALSE了 也就是0

    if (status == SUCCESS)

    {

        if ( accelEnabler ) // accelEnabler = 0

           { // Restart timer

              if ( ACCEL_READ_PERIOD )

                { osal_start_timerEx( keyfobapp_TaskID, KFD_ACCEL_READ_EVT, ACCEL_READ_PERIOD ); }

              // Read accelerometer data

                      accelRead();

           }

        else

        { // Stop the acceleromter

            osal_stop_timerEx( keyfobapp_TaskID, KFD_ACCEL_READ_EVT); } }

     else

      { //?? }

      return (events ^ KFD_ACCEL_READ_EVT);

}

经过很多查找之后 这个accelEnabler始终都是0啊 并被有函数来修改这个值啊 那这个if(accelEnabler)就永远不会执行 那么整个加速器的读值程序accelRead();就不会执行啊

请教各位 到底是哪里更改了这个值使得整个加速器的程序可以正常运行的 多谢各位了