Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
userTask.cpp
- Committer:
- takeru0x1103
- Date:
- 2018-11-24
- Revision:
- 1:15ab74f0d0f1
- Child:
- 8:1ca49cb18290
File content as of revision 1:15ab74f0d0f1:
//RTOS関連 #include "FreeRTOS.h" #include "task.h" #include "queue.h" #include "led.h" #include "command.h" #include "userOperate.h" //---------------------------------------------------------------- //タスク処理 //---------------------------------------------------------------- void task50Hz(void *pvParameters){ int8_t *pcTaskName; pcTaskName = (int8_t *) pvParameters; portTickType xLastWakeTime; xLastWakeTime = xTaskGetTickCount(); while(1){ ledTggle(); if(gDebugFlg){ userTest(); }else{ userIdleSet(); } //次の周期まで待つ vTaskDelayUntil(&xLastWakeTime, 20 / portTICK_RATE_MS ); } } //------------------------------------------------------------- //初期化 //------------------------------------------------------------- void taskInit(){ portBASE_TYPE TaskRtn; TaskRtn= xTaskCreate(task50Hz, (signed portCHAR *)"TaskB", 192, NULL, 1, NULL); // if(TaskRtn==pdTRUE){printf("task1 OK\r\n");} //カーネルの起動 vTaskStartScheduler(); }