示例#1
0
void assertFail(char *exp, char *file, int line)
{
  storeAssertSnapshotData(file, line);

  ledClearAll();
  ledSet(ERR_LED1, 1);
  ledSet(ERR_LED2, 1);
  while (1);
}
void assertFail(char *exp, char *file, int line)
{
  portDISABLE_INTERRUPTS();
  storeAssertSnapshotData(file, line);
  DEBUG_PRINT("Assert failed %s:%d\n", file, line);

  motorsSetRatio(MOTOR_M1, 0);
  motorsSetRatio(MOTOR_M2, 0);
  motorsSetRatio(MOTOR_M3, 0);
  motorsSetRatio(MOTOR_M4, 0);

  ledClearAll();
  ledSet(ERR_LED1, 1);
  ledSet(ERR_LED2, 1);

  while (1);
}
bool ledTest(void)
{
  ledSet(LED_GREEN_L, 1);
  ledSet(LED_GREEN_R, 1);
  ledSet(LED_RED_L, 0);
  ledSet(LED_RED_R, 0);
  vTaskDelay(M2T(250));
  ledSet(LED_GREEN_L, 0);
  ledSet(LED_GREEN_R, 0);
  ledSet(LED_RED_L, 1);
  ledSet(LED_RED_R, 1);
  vTaskDelay(M2T(250));

  // LED test end
  ledClearAll();
  ledSet(LED_BLUE_L, 1);

  return isInit;
}