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.
Diff: userTask.cpp
- Revision:
- 1:15ab74f0d0f1
- Child:
- 8:1ca49cb18290
diff -r ecd925601fc6 -r 15ab74f0d0f1 userTask.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/userTask.cpp Sat Nov 24 11:35:48 2018 +0000
@@ -0,0 +1,46 @@
+//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();
+}
+
+