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-26
- Revision:
- 8:1ca49cb18290
- Parent:
- 1:15ab74f0d0f1
- Child:
- 14:76a56d517103
File content as of revision 8:1ca49cb18290:
//RTOS関連 #include "FreeRTOS.h" #include "task.h" #include "queue.h" #include "led.h" #include "command.h" #include "userOperate.h" #include "Gyro.h" #include "uart.h" #include "globalFlags.h" //---------------------------------------------------------------- //タスク処理 //---------------------------------------------------------------- void task50Hz(void *pvParameters){ int8_t *pcTaskName; portTickType xLastWakeTime; Gyro gy; pcTaskName = (int8_t *) pvParameters; xLastWakeTime = xTaskGetTickCount(); while(1){ ledTggle(); if(!gDebugFlg){ userTest(); } //次の周期まで待つ sp.printf("%0.2f,%0.2f\r\n",gy.GetAngle(),gy.GetAngularRate()); if(gfSetYawRef){gy.SetYawRef();} 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(); }