• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ FRTOS1_vTaskDelay函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中FRTOS1_vTaskDelay函数的典型用法代码示例。如果您正苦于以下问题:C++ FRTOS1_vTaskDelay函数的具体用法?C++ FRTOS1_vTaskDelay怎么用?C++ FRTOS1_vTaskDelay使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了FRTOS1_vTaskDelay函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: portTASK_FUNCTION

static portTASK_FUNCTION(AppTask, pvParameters) {
  (void)pvParameters; /* not used */
  RTC1_TTIME time;
  RTC1_TDATE date;

  if (RTC1_GetRTCTimeDate(&time, &date)==ERR_OK) {
    TmDt1_SetDate((uint16_t)date.year+2000, date.month, date.day);
    TmDt1_SetTime(time.hour, time.min, time.sec, 0);
  } else {
    for(;;) {} /* error */
  }
  (void)NEO_ClearAllPixel();
  (void)NEO_TransferPixels();
#if HAS_CLOCK
  (void)NEOL_PixelTrail(0x00, 0x00, 0xFF, NEO_PIXEL_FIRST, NEO_PIXEL_LAST,  8, 25, 20);
  (void)NEOL_PixelTrail(0x00, 0xff, 0x00, NEO_PIXEL_FIRST, NEO_PIXEL_LAST,  16, 25, 15);
  (void)NEOL_PixelTrail(0x00, 0x50, 0xff, NEO_PIXEL_FIRST, NEO_PIXEL_LAST,  16, 25, 10);

  CLOCK_Init();
#endif
  for(;;) {
#if HAS_ELEVATOR
    Elevator();
    FRTOS1_vTaskDelay(1000/portTICK_RATE_MS);
#else
    CLOCK_Update();
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
#endif
  } /* for */
}
开发者ID:210221030,项目名称:mcuoneclipse,代码行数:30,代码来源:Application.c


示例2: portTASK_FUNCTION

static portTASK_FUNCTION(RNetTask, pvParameters) {
  uint32_t cntr;
  uint8_t msgCntr;

  (void)pvParameters; /* not used */
  if (RAPP_SetThisNodeAddr(RNWK_ADDR_BROADCAST)!=ERR_OK) { /* set a default address */
    for(;;); /* "ERR: Failed setting node address" */
  }
  cntr = 0; /* initialize LED counter */
  msgCntr = 0; /* initialize message counter */
  appState = RNETA_INITIAL; /* initialize state machine state */
  for(;;) {
    Process(); /* process state machine */
    cntr++;
    if (cntr==100) { /* with an RTOS 10 ms/100 Hz tick rate, this is every second */
      LED3_On(); /* blink blue LED for 20 ms */
      RAPP_SendPayloadDataBlock(&msgCntr, sizeof(msgCntr), RAPP_MSG_TYPE_PING, RNWK_ADDR_BROADCAST, RPHY_PACKET_FLAGS_NONE);
      msgCntr++;
      cntr = 0;
      FRTOS1_vTaskDelay(20/portTICK_RATE_MS);
      LED3_Off(); /* blink blue LED */
    }
    FRTOS1_vTaskDelay(10/portTICK_RATE_MS);
  } /* for */
}
开发者ID:c-kel,项目名称:Assorted,代码行数:25,代码来源:RNet_App.c


示例3: portTASK_FUNCTION

static portTASK_FUNCTION(TraceTask, pvParameters) {
  static unsigned char buf[128]; /* global buffer, to reduce stack size. We want to send things in one piece */

  (void)pvParameters;
  for(;;) {
    if (traceChannel==TRACE_TO_NONE) {
      FRTOS1_vTaskDelay(1000/portTICK_RATE_MS);
    } else if (traceChannel==TRACE_TO_SHELL) {
      buf[0] = '\0';
      UTIL1_strcat(buf, sizeof(buf), (unsigned char*)" => ");
      if (traceAccel) {
        int16_t x, y, z;

        ACCEL_GetValues(&x, &y, &z);
        UTIL1_strcat(buf, sizeof(buf), (unsigned char*)" X:");
        UTIL1_strcatNum16sFormatted(buf, sizeof(buf), x, ' ', 6);
        UTIL1_strcat(buf, sizeof(buf), (unsigned char*)"; Y:");
        UTIL1_strcatNum16sFormatted(buf, sizeof(buf), y, ' ', 6);
        UTIL1_strcat(buf, sizeof(buf), (unsigned char*)"; Z:");
        UTIL1_strcatNum16sFormatted(buf, sizeof(buf), z, ' ', 6);
        UTIL1_strcat(buf, sizeof(buf), (unsigned char*)"\r\n");
        CLS1_SendStr(&buf[0], CLS1_GetStdio()->stdOut);
        FRTOS1_vTaskDelay(100/portTICK_RATE_MS);
      }
      FRTOS1_vTaskDelay(25/portTICK_RATE_MS);
    }
  }
}
开发者ID:210221030,项目名称:mcuoneclipse,代码行数:28,代码来源:Trace.c


示例4: portTASK_FUNCTION

static portTASK_FUNCTION(Button, pvParameters) {
  CLS1_ConstStdIOType *io = CLS1_GetStdio();

  (void)pvParameters; /* parameter not used */
  for(;;) {
    /* check push button switch: turns on/off cooling immediately */
    if (SW2_GetVal()==0) { /* button pressed */
      FRTOS1_vTaskDelay(10/portTICK_RATE_MS); /* debounce */
      if (SW2_GetVal()==0) { /* still pressed */
        while(SW2_GetVal()==0) {
          /* wait until released */
          FRTOS1_vTaskDelay(10/portTICK_RATE_MS); /* debounce */
        }
        DisableScheduler(io);
        if (isPumpOn) { /* pump is on, toggle it */
          SetCooling(FALSE, io); /* turn cooling off */
          mySchedule.isSchedulerOn = TRUE; /* turn scheduler on again */
        } else {
          SetCooling(TRUE, io); /* turn cooling on */
        }
      }
    }
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
  } /* for */
}
开发者ID:210221030,项目名称:mcuoneclipse,代码行数:25,代码来源:Hoval.c


示例5: CheckButton

static void CheckButton(void) {
  uint32_t timeTicks; /* time in ticks */
  #define BUTTON_CNT_MS  100  /* iteration count for button */
  bool autoCalibrate = FALSE;

  if (SW1_GetVal()==0) { /* button pressed */
    /* short press (1 beep): start or stop line following if calibrated 
     * 1 s press   (2 beep): calibrate manually
     * 2 s press   (3 beep): calibrate with auto-move
     * 3 s press   (4 beep or more): clear path
     * */
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS); /* simple debounce */
    if (SW1_GetVal()==0) { /* still pressed */
      LEDG_On();
      timeTicks = 0;
      while(SW1_GetVal()==0 && timeTicks<=6000/BUTTON_CNT_MS) { 
        FRTOS1_vTaskDelay(BUTTON_CNT_MS/portTICK_RATE_MS);
        if ((timeTicks%(1000/BUTTON_CNT_MS))==0) {
#if PL_HAS_BUZZER
          BUZ_Beep(300, 200);
#endif
        }
        timeTicks++;
      } /* wait until released */
      autoCalibrate = FALSE;
      if (timeTicks<1000/BUTTON_CNT_MS) { /* less than 1 second */
        CLS1_SendStr((unsigned char*)"button press.\r\n", CLS1_GetStdio()->stdOut);
        StateMachine(TRUE); /* <1 s, short button press, according to state machine */
      } else if (timeTicks>=(1000/BUTTON_CNT_MS) && timeTicks<(2000/BUTTON_CNT_MS)) {
        CLS1_SendStr((unsigned char*)"calibrate.\r\n", CLS1_GetStdio()->stdOut);
        APP_StateStartCalibrate(); /* 1-2 s: start calibration by hand */
      } else if (timeTicks>=(2000/BUTTON_CNT_MS) && timeTicks<(3000/BUTTON_CNT_MS)) {
        CLS1_SendStr((unsigned char*)"auto calibrate.\r\n", CLS1_GetStdio()->stdOut);
        APP_StateStartCalibrate(); /* 2-3 s: start auto calibration */
        autoCalibrate = TRUE;
      } else if (timeTicks>=(3000/BUTTON_CNT_MS)) {
        CLS1_SendStr((unsigned char*)"delete solution.\r\n", CLS1_GetStdio()->stdOut);
        MAZE_ClearSolution();
      } 
      while (SW1_GetVal()==0) { /* wait until button is released */
        FRTOS1_vTaskDelay(BUTTON_CNT_MS/portTICK_RATE_MS);
      }
      if (autoCalibrate) {
        CLS1_SendStr((unsigned char*)"start auto-calibration...\r\n", CLS1_GetStdio()->stdOut);
        /* perform automatic calibration */
        WAIT1_WaitOSms(1500); /* wait some time */
        TURN_Turn(TURN_LEFT90);
        TURN_Turn(TURN_RIGHT90);
        TURN_Turn(TURN_RIGHT90);
        TURN_Turn(TURN_LEFT90);
        TURN_Turn(TURN_STOP);
        APP_StateStopCalibrate();
        CLS1_SendStr((unsigned char*)"auto-calibration finished.\r\n", CLS1_GetStdio()->stdOut);
      }
    }
  } /* if */
}
开发者ID:IsidreSole,项目名称:mcuoneclipse,代码行数:57,代码来源:Application.c


示例6: portTASK_FUNCTION

static portTASK_FUNCTION(Fight_modus, pvParameters) {
#if PL_HAS_DRIVE
	  DRV_EnableDisable(FALSE);
	  DRV_EnableDisablePos(FALSE);
#endif
  fight_state = FIND_ENEMY;
  FRTOS1_vTaskDelay(100/TRG_TICKS_MS);
  for(;;) {
	  FRTOS1_vTaskDelay(10/TRG_TICKS_MS);
	  FightmodusV2();
  }
}
开发者ID:chregubr85,项目名称:42,代码行数:12,代码来源:RTOS.c


示例7: portTASK_FUNCTION

/** 
 * \brief FreeRTOS task
 */
static portTASK_FUNCTION(MyTask, pvParameters) {
  (void)pvParameters; /* parameter not used */
  for(;;) {
    LED1_Neg();
    FRTOS1_vTaskDelay(100/portTICK_RATE_MS);
    LED2_Neg();
    FRTOS1_vTaskDelay(100/portTICK_RATE_MS);
    LED3_Neg();
    FRTOS1_vTaskDelay(100/portTICK_RATE_MS);
    LED4_Neg();
    FRTOS1_vTaskDelay(100/portTICK_RATE_MS);
  } /* for */
}
开发者ID:210221030,项目名称:mcuoneclipse,代码行数:16,代码来源:RTOS.c


示例8: portTASK_FUNCTION

static portTASK_FUNCTION(SoundTask, pvParameters) {
  (void)pvParameters; /* avoid compiler warning */
  for(;;) {
    SOUND_SetFreqHz(freqSounder);
    SOUND_Enable();
    FRTOS1_vTaskDelay(80/portTICK_RATE_MS);
    SOUND_Disable();
    FRTOS1_vTaskDelay(80/portTICK_RATE_MS);
    SOUND_Enable();
    FRTOS1_vTaskDelay(80/portTICK_RATE_MS);
    SOUND_Disable();
    FRTOS1_vTaskSuspend(NULL); /* put itself to sleep */
  }
}
开发者ID:210221030,项目名称:mcuoneclipse,代码行数:14,代码来源:Application.c


示例9: portTASK_FUNCTION

static portTASK_FUNCTION(LineTask, pvParameters) {
  (void)pvParameters; /* not used */
  for(;;) {
    if (LF_stopIt) {
      ChangeState(STATE_STOP);
      LF_stopIt = FALSE;
    }
    StateMachine();
    if (LF_IsFollowing()) {
      FRTOS1_vTaskDelay(5/portTICK_RATE_MS);
    } else {
      FRTOS1_vTaskDelay(100/portTICK_RATE_MS);
    }
  }
}
开发者ID:210221030,项目名称:mcuoneclipse,代码行数:15,代码来源:LineFollow.c


示例10: PlayMIDI

static void PlayMIDI(void) {
  int instrument, note;

  VS1_MIDI_SetBank(0, 0);
  for(instrument=0; instrument<127; instrument++) {
    VS1_MIDI_SetInstrument(0, instrument);
    for(note=30; note<40; note++) {
      VS1_MIDI_NoteOn(0, note, 127);
      FRTOS1_vTaskDelay(200/portTICK_RATE_MS);
      VS1_MIDI_NoteOff(0, note, 127);
      FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
    }
    FRTOS1_vTaskDelay(100/portTICK_RATE_MS);
  }
}
开发者ID:ADeadCat,项目名称:mcuoneclipse,代码行数:15,代码来源:PongGame.c


示例11: AppTask

static void AppTask(void *pvParameters) {
  (void)pvParameters; /* parameter not used */
  for(;;) {
    LED1_Neg();
    FRTOS1_vTaskDelay(100/portTICK_RATE_MS);
  }
}
开发者ID:nitsu121,项目名称:mcuoneclipse,代码行数:7,代码来源:Application.c


示例12: portTASK_FUNCTION

static portTASK_FUNCTION(ShellTask, pvParameters) {
#if PL_HAS_SD_CARD
  bool cardMounted = FALSE;
  static FAT1_FATFS fileSystemObject;
#endif
  unsigned char buf[48];

  (void)pvParameters; /* not used */
  buf[0] = '\0';
  (void)CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, CLS1_GetStdio(), CmdParserTable);
  for(;;) {
#if PL_HAS_SD_CARD
    (void)FAT1_CheckCardPresence(&cardMounted,
        0 /* volume */, &fileSystemObject, CLS1_GetStdio());
    if (cardMounted) {
      //SD_GreenLed_On();
      //SD_RedLed_Off();
    } else {
      //SD_GreenLed_Off();
      //SD_RedLed_On();
    }
#endif
    (void)CLS1_ReadAndParseWithCommandTable(buf, sizeof(buf), CLS1_GetStdio(), CmdParserTable);
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
    LEDG_Neg();
  }
}
开发者ID:dansog56,项目名称:mcuoneclipse,代码行数:27,代码来源:Shell.c


示例13: portTASK_FUNCTION

static portTASK_FUNCTION(RoboTask, pvParameters) {
  uint16_t cm;
  
  (void)pvParameters; /* not used */
  for(;;) {
    cm = MeasureCm();
    LEDR_Neg();
    if (runIt && cm != 0) {
      if (cm<10) { /* back up! */
        MOT_SetSpeedPercent(MOT_GetMotorA(), -40);
        MOT_SetSpeedPercent(MOT_GetMotorB(), -40);
      } else if (cm>=10 && cm<=15) {
        /* stand still */
        MOT_SetSpeedPercent(MOT_GetMotorA(), 0);
        MOT_SetSpeedPercent(MOT_GetMotorB(), 0);
      } else if (cm>15 && cm<=40) {
        MOT_SetSpeedPercent(MOT_GetMotorA(), 50);
        MOT_SetSpeedPercent(MOT_GetMotorB(), 50);
      } else if (cm>40 && cm<80) {
        MOT_SetSpeedPercent(MOT_GetMotorA(), 80);
        MOT_SetSpeedPercent(MOT_GetMotorB(), 80);
      } else { /* nothing in range */
        MOT_SetSpeedPercent(MOT_GetMotorA(), 0);
        MOT_SetSpeedPercent(MOT_GetMotorB(), 0);
      }
    }
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
  }
}
开发者ID:IsidreSole,项目名称:mcuoneclipse,代码行数:29,代码来源:Application.c


示例14: portTASK_FUNCTION

static portTASK_FUNCTION(Task4, pvParameters) {
  (void)pvParameters; /* parameter not used */
  for(;;) {
    LED4_Neg();
    FRTOS1_vTaskDelay(800/portTICK_RATE_MS);
  }
}
开发者ID:210221030,项目名称:mcuoneclipse,代码行数:7,代码来源:Application.c


示例15: portTASK_FUNCTION

static portTASK_FUNCTION(TaskRunner, pvParameters) {
  RUNNER_WindowDesc *ui = (RUNNER_WindowDesc*)pvParameters;
  char_t buf[I2C_RUNNER_I2C_MSG_SIZE];
  uint8_t cnt;
  bool errorCond;

  appWp = ui;
#if PL_APP_MODE_I2C_LCD
  I2C_ClearBuffers();
#endif
  ResetRunnerDisplayList();
  RUNNER_listLastRecords = TRUE; /* request getting runners */
  cnt = 0;
  for (;;) {
    I2C_SendCmd();
    errorCond = FALSE;
    while (I2C_GetRunnerMessage(buf, sizeof(buf))==ERR_OK) { /* message received, process as many and as fast as possible */
      if (ParseNewRunnerMsg(buf)!=ERR_OK) {
        errorCond = TRUE; /* flag error */
      }
    } /* while */
    DisplayRunners(ui);
    if (errorCond) {
      UI1_DrawFilledBox(&appWp->window, 120, 8, 5, 5, UI1_COLOR_RED);
    } else {
      UI1_DrawFilledBox(&appWp->window, 120, 8, 5, 5, UI1_COLOR_BLUE);
    }
    FRTOS1_vTaskDelay(100/portTICK_RATE_MS);
    cnt++;
    UI1_DrawFilledBox(&appWp->window, 110, 8, 5, 5, cnt<10?UI1_COLOR_BLUE:UI1_COLOR_GREEN);
    if (cnt==20) {
      cnt=0;
    }
  } /* for */
}
开发者ID:ADeadCat,项目名称:mcuoneclipse,代码行数:35,代码来源:Runner.c


示例16: portTASK_FUNCTION

static portTASK_FUNCTION(StateMachineTask, pvParameters) {
  (void)pvParameters; /* not used */
  for(;;) {
    StateMachine_Run();
    FRTOS1_vTaskDelay(10/portTICK_RATE_MS);
  }
}
开发者ID:fmario,项目名称:intro_sumo,代码行数:7,代码来源:StateMachine.c


示例17: portTASK_FUNCTION

static portTASK_FUNCTION(MainTask, pvParameters) {
	uint16_t msCnt;

	(void) pvParameters; /* parameter not used */
#if PL_HAS_ACCEL
  ACCEL_LowLevelInit();
#endif
	for (;;) {
		EVNT_HandleEvent(APP_EvntHandler);
#if PL_HAS_KEYS && !PL_HAS_KBI
		KEY_Scan(); /* poll keys */
#endif
		
		FRTOS1_vTaskDelay(20/portTICK_RATE_MS);
		msCnt += 20;
		if (msCnt > 280) {
			#if PL_HAS_ULTRASONIC
				(void)US_Measure_us(); /* Measure distance */

			#endif
			msCnt = 0;
			
	
		}
	}
}
开发者ID:tgwalker1,项目名称:TeamBrand,代码行数:26,代码来源:Application.c


示例18: I2C_StoreCmd

void I2C_StoreCmd(void) {
#if PL_HAS_UI
    unsigned char buf[32];
    uint8_t strSize;

#if PL_HAS_RUNNER
    buf[0] = '@';
    buf[1] = '\0';
    RUNNER_GetCmdString(buf, sizeof(buf));
#elif PL_HAS_SLIDER
    SLIDER_GetCmdString(buf, sizeof(buf));
#else
    buf[0] = '\0';
#endif
    if (buf[0]!='\0') {
      uint8_t cnt=3;

      while(cnt>0 && memDevice.u.data.cmdLength!=0) { /* poll cmdLength: this will be set to zero by the master if it is ok to place the string */
        FRTOS1_vTaskDelay(50/portTICK_RATE_MS); /* give master some time to clear the flasg */
        cnt--;
      }
      if (cnt==0) { /* timeout. Will loose that command. Not ideal, but simple :-) */
        return; /* get out here */
      }
      strSize = (uint8_t)(UTIL1_strlen(buf)+1); /* size of string including zero byte */
      if (strSize>sizeof(memDevice.u.data.cmd)) {
        strSize = sizeof(memDevice.u.data.cmd);
      }
      EnterCritical();
      memDevice.u.data.cmdLength = strSize;
      UTIL1_strcpy(memDevice.u.data.cmd, sizeof(memDevice.u.data.cmd), buf);
      ExitCritical();
    }
#endif /* PL_HAS_UI */
}
开发者ID:krlosburgos,项目名称:mcuoneclipse,代码行数:35,代码来源:I2C.c


示例19: portTASK_FUNCTION

static portTASK_FUNCTION(MainTask, pvParameters) {
  (void)pvParameters;
  for(;;) {
    LED1_Neg();
    FRTOS1_vTaskDelay(100/portTICK_RATE_MS);
  }
}
开发者ID:3ben1189,项目名称:mcuoneclipse,代码行数:7,代码来源:Application.c


示例20: GetConnection

void GetConnection(void) {
	typedef enum {
		GetCon1, Passed, Error
	} GetConState_Type;
	GetConState_Type GetConState = GetCon1;

	while (GetConState != Passed) {
		switch (GetConState) {

		case GetCon1:
			SendSim900("AT+GetConnection\r\n");

			if (CompareString(buffer, "ok", 2)) {	//are the same
				FRTOS1_xSemaphoreGive(SuccessLedMutex);
				GetConState = Passed;
			}
			break;

		default:
			GetConState = Error;
			break;

		}
		FRTOS1_vTaskDelay(
				GET_CONNECTION_STATEMACHINE_DELAY_MS/portTICK_PERIOD_MS);
	}
}
开发者ID:tghaefli,项目名称:stingray,代码行数:27,代码来源:SIM900.c



注:本文中的FRTOS1_vTaskDelay函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FRTOS1_xTaskCreate函数代码示例发布时间:2022-05-30
下一篇:
C++ FROM_UTF8函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap