由于国庆节假期,帖子审批以及工程师回复将会有所延迟,敬请谅解

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.

LAUNCHXL-CC1352R1: sensor controller在application成功stop task之後, 無法重新start task

Part Number: LAUNCHXL-CC1352R1

SDK:simplelink_cc13xx_cc26xx_sdk_6_10_00_29

在application用scifStopTasksNbl指令可以成功的停止 sensor controller task.

但是成功停止後, 要再用application的scifStartTasksNbl指令重啟sensor controller task就會失敗.

請問這要如何解決?

---------------------------------------------------------------

/*
 *  ======== AccelProfile_enable ========
 */

bStatus_t AccelProfile_enable(void)
{
  bStatus_t status = SUCCESS;

  // Only enable if not already enabled
  if (!(scifGetActiveTaskIds() & (1 << SCIF_SPI_ACCELEROMETER_TASK_ID)))
  {
    // Start the "SPI Accelerometer" Sensor Controller task
    scifStartTasksNbl(1 << SCIF_SPI_ACCELEROMETER_TASK_ID);

    // Wait for sensor controller
    if (!(Semaphore_pend(Semaphore_handle(&semScReady), 500000 / Clock_tickPeriod)))
    {
      status = FAILURE;
    }
  }

  if (status == SUCCESS)
  {
      Log_info0("Sensor Controller Accelerometer enabled");
  }
  else
  {
     Log_error0("Sensor controller failed to enable");
  }

  return status;
}

/*
 *  ======== AccelProfile_disable ========
 */
bStatus_t AccelProfile_disable(void)
{
  bStatus_t status = SUCCESS;

  // Only disable if not already enabled
  if (scifGetActiveTaskIds() & (1 << SCIF_SPI_ACCELEROMETER_TASK_ID))
  {
    // Start the "SPI Accelerometer" Sensor Controller task
    scifStopTasksNbl(1 << SCIF_SPI_ACCELEROMETER_TASK_ID);

    // Wait for sensor controller
    if (!(Semaphore_pend(Semaphore_handle(&semScReady), 500000 / Clock_tickPeriod)))
    {
      status = FAILURE;
    }
  }

  if (status == SUCCESS)
  {
      Log_info0("Sensor Controller Accelerometer disabled");
  }
  else
  {
     Log_error0("Sensor controller failed to disable");
  }

  return status;
}