\doxysection{tk Namespace Reference} \hypertarget{namespacetk}{}\label{namespacetk}\index{tk@{tk}} \doxysubsubsection*{Namespaces} \begin{DoxyCompactItemize} \item namespace \doxymbox{\hyperlink{namespacetk_1_1detail}{detail}} \end{DoxyCompactItemize} \doxysubsubsection*{Classes} \begin{DoxyCompactItemize} \item class \doxymbox{\hyperlink{classtk_1_1_actor}{Actor}} \begin{DoxyCompactList}\small\item\em メッセージ駆動型タスク (アクター) の基底クラス \end{DoxyCompactList}\item class \doxymbox{\hyperlink{classtk_1_1_event_hub}{Event\+Hub}} \begin{DoxyCompactList}\small\item\em メッセージ型ごとの超軽量 Pub/\+\+Sub ディスパッチャ \end{DoxyCompactList}\item class \doxymbox{\hyperlink{classtk_1_1_lock_guard}{Lock\+Guard}} \begin{DoxyCompactList}\small\item\em ミューテックスのロックをスコープ単位で安全に管理する RAII クラス (std::\+lock\+\_\+guard 相当) \end{DoxyCompactList}\item struct \doxymbox{\hyperlink{structtk_1_1_message}{Message}} \begin{DoxyCompactList}\small\item\em デフォルトの軽量メッセージ構造体 \end{DoxyCompactList}\item class \doxymbox{\hyperlink{classtk_1_1_mutex}{Mutex}} \begin{DoxyCompactList}\small\item\em 所有権・優先度順ウェイクアップ・\+RAII 対応のミューテックス (排他ロック) \end{DoxyCompactList}\item class \doxymbox{\hyperlink{classtk_1_1_preempt_guard}{Preempt\+Guard}} \begin{DoxyCompactList}\small\item\em プリエンプション禁止をスコープ単位で安全に管理する RAII クラス \end{DoxyCompactList}\item class \doxymbox{\hyperlink{classtk_1_1_semaphore}{Semaphore}} \begin{DoxyCompactList}\small\item\em 計数セマフォ (Counting \doxylink{classtk_1_1_semaphore}{Semaphore}) / バイナリセマフォ \end{DoxyCompactList}\item struct \doxymbox{\hyperlink{structtk_1_1_task_handle}{Task\+Handle}} \begin{DoxyCompactList}\small\item\em タスクの識別ハンドル \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsubsection*{Typedefs} \begin{DoxyCompactItemize} \item using \doxymbox{\hyperlink{namespacetk_a8908cf1e54cdc4e14ac3003126722cfc}{Task\+Fn}} = void (\texorpdfstring{$\ast$}{*})(void\texorpdfstring{$\ast$}{*} arg) \item using \doxymbox{\hyperlink{namespacetk_add371a241ec6c1695ef4e67935317edd}{task\+\_\+mask\+\_\+t}} = uint32\+\_\+t \item using \doxymbox{\hyperlink{namespacetk_ab1f2fa3d79e99f13610bd330a0df928b}{Binary\+Semaphore}} = \doxymbox{\hyperlink{classtk_1_1_semaphore}{Semaphore}} \begin{DoxyCompactList}\small\item\em バイナリセマフォ (初期値1, 最大1) の型エイリアス \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsubsection*{Enumerations} \begin{DoxyCompactItemize} \item enum \doxymbox{\hyperlink{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50e}{Prio}} : uint32\+\_\+t \{ \doxymbox{\hyperlink{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50eabbefd771d1fb2ac0708c1bd5371e5a75}{PRIO\+\_\+\+REALTIME}} = 1 , \doxymbox{\hyperlink{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50ea614240a3a3fc1094c6daa0fdca92ba37}{PRIO\+\_\+\+HIGH}} = 5 , \doxymbox{\hyperlink{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50ea0e6779023b97999c2cef66ba1d4d1fca}{PRIO\+\_\+\+NORMAL}} = 9 , \doxymbox{\hyperlink{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50eacf084edcfe985b77c205a37c3bd60519}{PRIO\+\_\+\+LOW}} = 13 \} \begin{DoxyCompactList}\small\item\em タスクの優先度レベル \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsubsection*{Functions} \begin{DoxyCompactItemize} \item {\footnotesize template$<$typename Msg\+Type$>$ }\\size\+\_\+t \doxymbox{\hyperlink{namespacetk_a083495c9bf857a63f6c20a20aac0ca52}{publish}} (const Msg\+Type \&msg) \begin{DoxyCompactList}\small\item\em メッセージの型を指定して、購読しているすべての \doxylink{classtk_1_1_actor}{Actor} へ同報配信します \end{DoxyCompactList}\item size\+\_\+t \doxymbox{\hyperlink{namespacetk_a5549bec310750722a1964de1145b9fed}{publish}} (uint32\+\_\+t id, uintptr\+\_\+t arg=0) \begin{DoxyCompactList}\small\item\em \doxylink{structtk_1_1_message}{tk::\+\+Message} 型の同報配信ショートカット \end{DoxyCompactList}\item \doxymbox{\hyperlink{structtk_1_1_task_handle}{Task\+Handle}} \doxymbox{\hyperlink{namespacetk_a6e721332f5a7d85998345ed218de7394}{create}} (\doxymbox{\hyperlink{namespacetk_a8908cf1e54cdc4e14ac3003126722cfc}{Task\+Fn}} fn, void \texorpdfstring{$\ast$}{*}arg=nullptr, uint32\+\_\+t prio=\doxymbox{\hyperlink{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50ea0e6779023b97999c2cef66ba1d4d1fca}{PRIO\+\_\+\+NORMAL}}) \begin{DoxyCompactList}\small\item\em タスクを生成・登録します \end{DoxyCompactList}\item void \doxymbox{\hyperlink{namespacetk_a675f1829b87e2a43239b6f80a526d0ed}{start}} () \begin{DoxyCompactList}\small\item\em tinykernel スケジューラを起動します \end{DoxyCompactList}\item void \doxymbox{\hyperlink{namespacetk_a8081956b0a19b87d5b7c81b772373397}{yield}} () \begin{DoxyCompactList}\small\item\em 現在実行中のタスクを一時中断し、同優先度の他のタスクへ CPU を譲渡します \end{DoxyCompactList}\item void \doxymbox{\hyperlink{namespacetk_aae83f84121085578a7568437a8dc2447}{sleep\+\_\+ms}} (uint32\+\_\+t ms) \begin{DoxyCompactList}\small\item\em 現在のタスクを指定時間スリープさせます \end{DoxyCompactList}\item void \doxymbox{\hyperlink{namespacetk_aba50cfc62cb8be71cf96df7f495a7a3d}{exit}} (int code=0) \begin{DoxyCompactList}\small\item\em 現在のタスクを終了・破棄します \end{DoxyCompactList}\item uint64\+\_\+t \doxymbox{\hyperlink{namespacetk_a46e15375fba47cbd1a93278f17e77848}{now\+\_\+ms}} () \begin{DoxyCompactList}\small\item\em システム起動時からの経過時間をミリ秒単位で取得します \end{DoxyCompactList}\item bool \doxymbox{\hyperlink{namespacetk_a6540aa25eb8562f6d6c8b37977d6cfe8}{lock}} () \begin{DoxyCompactList}\small\item\em ハードウェアスピンロックと全割り込み禁止によるクリティカルセクションに入ります \end{DoxyCompactList}\item void \doxymbox{\hyperlink{namespacetk_a752b12f6862815c94a52347af52578b7}{unlock}} (bool was\+\_\+enabled) \begin{DoxyCompactList}\small\item\em \doxylink{namespacetk_a6540aa25eb8562f6d6c8b37977d6cfe8}{tk::\+lock()} で入ったクリティカルセクションを抜けます \end{DoxyCompactList}\item void \doxymbox{\hyperlink{namespacetk_a3254a7e2a9f5ed3abe44e8cf62a8dcfe}{preempt\+\_\+disable}} () \begin{DoxyCompactList}\small\item\em 自コアのタスクスイッチ (プリエンプション) を一時的に禁止します \end{DoxyCompactList}\item void \doxymbox{\hyperlink{namespacetk_a70e6ee5f456e67a24ce13ff0fd04e4d9}{preempt\+\_\+enable}} () \begin{DoxyCompactList}\small\item\em 自コアのタスクスイッチ (プリエンプション) を再開します \end{DoxyCompactList}\end{DoxyCompactItemize} \label{namespacetk_doc-typedef-members} \Hypertarget{namespacetk_doc-typedef-members} \doxysubsection{Typedef Documentation} \Hypertarget{namespacetk_ab1f2fa3d79e99f13610bd330a0df928b}\index{tk@{tk}!BinarySemaphore@{BinarySemaphore}} \index{BinarySemaphore@{BinarySemaphore}!tk@{tk}} \doxysubsubsection{\texorpdfstring{BinarySemaphore}{BinarySemaphore}} {\footnotesize\ttfamily \label{namespacetk_ab1f2fa3d79e99f13610bd330a0df928b} using \doxymbox{\hyperlink{namespacetk_ab1f2fa3d79e99f13610bd330a0df928b}{tk::\+\+Binary\+Semaphore}} = \doxymbox{\hyperlink{classtk_1_1_semaphore}{Semaphore}}} バイナリセマフォ (初期値1, 最大1) の型エイリアス \Hypertarget{namespacetk_add371a241ec6c1695ef4e67935317edd}\index{tk@{tk}!task\_mask\_t@{task\_mask\_t}} \index{task\_mask\_t@{task\_mask\_t}!tk@{tk}} \doxysubsubsection{\texorpdfstring{task\_mask\_t}{task\_mask\_t}} {\footnotesize\ttfamily \label{namespacetk_add371a241ec6c1695ef4e67935317edd} using \doxymbox{\hyperlink{namespacetk_add371a241ec6c1695ef4e67935317edd}{tk::\+task\+\_\+mask\+\_\+t}} = uint32\+\_\+t} \Hypertarget{namespacetk_a8908cf1e54cdc4e14ac3003126722cfc}\index{tk@{tk}!TaskFn@{TaskFn}} \index{TaskFn@{TaskFn}!tk@{tk}} \doxysubsubsection{\texorpdfstring{TaskFn}{TaskFn}} {\footnotesize\ttfamily \label{namespacetk_a8908cf1e54cdc4e14ac3003126722cfc} using \doxymbox{\hyperlink{namespacetk_a8908cf1e54cdc4e14ac3003126722cfc}{tk::\+\+Task\+Fn}} = void (\texorpdfstring{$\ast$}{*})(void\texorpdfstring{$\ast$}{*} arg)} タスク関数のシグネチャ (void func(void\texorpdfstring{$\ast$}{*} arg)) \label{namespacetk_doc-enum-members} \Hypertarget{namespacetk_doc-enum-members} \doxysubsection{Enumeration Type Documentation} \Hypertarget{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50e}\index{tk@{tk}!Prio@{Prio}} \index{Prio@{Prio}!tk@{tk}} \doxysubsubsection{\texorpdfstring{Prio}{Prio}} {\footnotesize\ttfamily \label{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50e} enum \doxymbox{\hyperlink{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50e}{tk::\+\+Prio}} :\+ uint32\+\_\+t} タスクの優先度レベル 数値が小さいほど高優先度です。0..15 の範囲で指定します (15 はアイドルタスク専用)。 \begin{DoxyEnumFields}[2]{Enumerator} \raisebox{\heightof{T}}[0pt][0pt]{\index{PRIO\_REALTIME@{PRIO\_REALTIME}!tk@{tk}} \index{tk@{tk}!PRIO\_REALTIME@{PRIO\_REALTIME}} }\Hypertarget{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50eabbefd771d1fb2ac0708c1bd5371e5a75}\label{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50eabbefd771d1fb2ac0708c1bd5371e5a75} PRIO\+\_\+\+REALTIME&リアルタイム最優先 \\ \hline \raisebox{\heightof{T}}[0pt][0pt]{\index{PRIO\_HIGH@{PRIO\_HIGH}!tk@{tk}} \index{tk@{tk}!PRIO\_HIGH@{PRIO\_HIGH}} }\Hypertarget{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50ea614240a3a3fc1094c6daa0fdca92ba37}\label{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50ea614240a3a3fc1094c6daa0fdca92ba37} PRIO\+\_\+\+HIGH&高優先度 \\ \hline \raisebox{\heightof{T}}[0pt][0pt]{\index{PRIO\_NORMAL@{PRIO\_NORMAL}!tk@{tk}} \index{tk@{tk}!PRIO\_NORMAL@{PRIO\_NORMAL}} }\Hypertarget{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50ea0e6779023b97999c2cef66ba1d4d1fca}\label{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50ea0e6779023b97999c2cef66ba1d4d1fca} PRIO\+\_\+\+NORMAL&通常優先度 (デフォルト) \\ \hline \raisebox{\heightof{T}}[0pt][0pt]{\index{PRIO\_LOW@{PRIO\_LOW}!tk@{tk}} \index{tk@{tk}!PRIO\_LOW@{PRIO\_LOW}} }\Hypertarget{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50eacf084edcfe985b77c205a37c3bd60519}\label{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50eacf084edcfe985b77c205a37c3bd60519} PRIO\+\_\+\+LOW&低優先度 \\ \hline \end{DoxyEnumFields} \label{namespacetk_doc-func-members} \Hypertarget{namespacetk_doc-func-members} \doxysubsection{Function Documentation} \Hypertarget{namespacetk_a6e721332f5a7d85998345ed218de7394}\index{tk@{tk}!create@{create}} \index{create@{create}!tk@{tk}} \doxysubsubsection{\texorpdfstring{create()}{create()}} {\footnotesize\ttfamily \label{namespacetk_a6e721332f5a7d85998345ed218de7394} \doxymbox{\hyperlink{structtk_1_1_task_handle}{tk::\+\+Task\+Handle}} tk::\+create (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{namespacetk_a8908cf1e54cdc4e14ac3003126722cfc}{Task\+Fn}}}]{fn}{, }\item[{void \texorpdfstring{$\ast$}{*}}]{arg}{ = {\ttfamily nullptr}, }\item[{uint32\+\_\+t}]{prio}{ = {\ttfamily \doxymbox{\hyperlink{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50ea0e6779023b97999c2cef66ba1d4d1fca}{PRIO\+\_\+\+NORMAL}}}}\end{DoxyParamCaption})} タスクを生成・登録します \doxylink{namespacetk_a675f1829b87e2a43239b6f80a526d0ed}{tk::\+start()} を呼び出す前に登録する必要があります。 \begin{DoxyParams}{Parameters} {\em fn} & タスク関数ポインタ (void (\texorpdfstring{$\ast$}{*})(void\texorpdfstring{$\ast$}{*} arg)) \\ \hline {\em arg} & タスク関数に渡すユーザー引数ポインタ (省略時: nullptr) \\ \hline {\em prio} & タスクの優先度 (省略時: \doxylink{namespacetk_a3d47fbd63b95ed3b46bed70c2fa1e50ea0e6779023b97999c2cef66ba1d4d1fca}{tk::\+\+PRIO\+\_\+\+NORMAL}) \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} \doxylink{structtk_1_1_task_handle}{Task\+Handle} 生成されたタスクのハンドル。登録失敗時は is\+\_\+valid() が false \end{DoxyReturn} \Hypertarget{namespacetk_aba50cfc62cb8be71cf96df7f495a7a3d}\index{tk@{tk}!exit@{exit}} \index{exit@{exit}!tk@{tk}} \doxysubsubsection{\texorpdfstring{exit()}{exit()}} {\footnotesize\ttfamily \label{namespacetk_aba50cfc62cb8be71cf96df7f495a7a3d} void tk::\+exit (\begin{DoxyParamCaption}\item[{int}]{code}{ = {\ttfamily 0}}\end{DoxyParamCaption})} 現在のタスクを終了・破棄します \begin{DoxyParams}{Parameters} {\em code} & 終了コード (予約用、省略時: 0) \\ \hline \end{DoxyParams} \begin{DoxyNote}{Note} タスク関数の末尾に到達した場合は自動的に呼ばれます。 \end{DoxyNote} \Hypertarget{namespacetk_a6540aa25eb8562f6d6c8b37977d6cfe8}\index{tk@{tk}!lock@{lock}} \index{lock@{lock}!tk@{tk}} \doxysubsubsection{\texorpdfstring{lock()}{lock()}} {\footnotesize\ttfamily \label{namespacetk_a6540aa25eb8562f6d6c8b37977d6cfe8} bool tk::\+lock (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})} ハードウェアスピンロックと全割り込み禁止によるクリティカルセクションに入ります \begin{DoxyReturn}{Returns} true 呼び出し前の割り込みが有効だった場合 false 呼び出し前の割り込みが無効だった場合 \end{DoxyReturn} \begin{DoxyWarning}{Warning} 長時間のロックは避けてください。数マイクロ秒以内のレジスタ操作等に使用します。 \end{DoxyWarning} \Hypertarget{namespacetk_a46e15375fba47cbd1a93278f17e77848}\index{tk@{tk}!now\_ms@{now\_ms}} \index{now\_ms@{now\_ms}!tk@{tk}} \doxysubsubsection{\texorpdfstring{now\_ms()}{now\_ms()}} {\footnotesize\ttfamily \label{namespacetk_a46e15375fba47cbd1a93278f17e77848} uint64\+\_\+t tk::\+now\+\_\+ms (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})} システム起動時からの経過時間をミリ秒単位で取得します \begin{DoxyReturn}{Returns} uint64\+\_\+t 経過ミリ秒数 (分解能: 1 / TK\+\_\+\+TICKS\+\_\+\+PER\+\_\+\+SEC 秒) \end{DoxyReturn} \Hypertarget{namespacetk_a3254a7e2a9f5ed3abe44e8cf62a8dcfe}\index{tk@{tk}!preempt\_disable@{preempt\_disable}} \index{preempt\_disable@{preempt\_disable}!tk@{tk}} \doxysubsubsection{\texorpdfstring{preempt\_disable()}{preempt\_disable()}} {\footnotesize\ttfamily \label{namespacetk_a3254a7e2a9f5ed3abe44e8cf62a8dcfe} void tk::\+preempt\+\_\+disable (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})} 自コアのタスクスイッチ (プリエンプション) を一時的に禁止します 割り込み (Sys\+Tick やタイマー、\+NVIC) は停止しないため、通信クロックや時刻更新を 阻害することなく、自タスクの処理をアトミックに実行できます。ネスト (入れ子) 呼び出しに対応しています。 \begin{DoxySeeAlso}{See also} \doxylink{classtk_1_1_preempt_guard}{tk::\+\+Preempt\+Guard}, \doxylink{namespacetk_a70e6ee5f456e67a24ce13ff0fd04e4d9}{tk::\+preempt\+\_\+enable()} \end{DoxySeeAlso} \Hypertarget{namespacetk_a70e6ee5f456e67a24ce13ff0fd04e4d9}\index{tk@{tk}!preempt\_enable@{preempt\_enable}} \index{preempt\_enable@{preempt\_enable}!tk@{tk}} \doxysubsubsection{\texorpdfstring{preempt\_enable()}{preempt\_enable()}} {\footnotesize\ttfamily \label{namespacetk_a70e6ee5f456e67a24ce13ff0fd04e4d9} void tk::\+preempt\+\_\+enable (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})} 自コアのタスクスイッチ (プリエンプション) を再開します ネストカウンタが 0 に戻った時点で、保留されていたタスクスイッチが即座に実行されます。 \begin{DoxySeeAlso}{See also} \doxylink{classtk_1_1_preempt_guard}{tk::\+\+Preempt\+Guard}, \doxylink{namespacetk_a3254a7e2a9f5ed3abe44e8cf62a8dcfe}{tk::\+preempt\+\_\+disable()} \end{DoxySeeAlso} \Hypertarget{namespacetk_a083495c9bf857a63f6c20a20aac0ca52}\index{tk@{tk}!publish@{publish}} \index{publish@{publish}!tk@{tk}} \doxysubsubsection{\texorpdfstring{publish()}{publish()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} {\footnotesize\ttfamily \label{namespacetk_a083495c9bf857a63f6c20a20aac0ca52} template$<$typename Msg\+Type$>$ \\ size\+\_\+t tk::\+publish (\begin{DoxyParamCaption}\item[{const Msg\+Type \&}]{msg}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}} メッセージの型を指定して、購読しているすべての \doxylink{classtk_1_1_actor}{Actor} へ同報配信します 送信側は \doxylink{classtk_1_1_actor}{Actor} のインスタンスや名前を知る必要がありません (完全疎結合)。 メッセージの実体は各 \doxylink{classtk_1_1_actor}{Actor} のキューへ値コピーされるため、スタック上のローカル変数でも安全に渡せます。 \begin{DoxyTemplParams}{Template Parameters} {\em Msg\+Type} & 配信するメッセージ型 \\ \hline \end{DoxyTemplParams} \begin{DoxyParams}{Parameters} {\em msg} & 送信するメッセージ \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} size\+\_\+t 配信に成功した \doxylink{classtk_1_1_actor}{Actor} の数 \end{DoxyReturn} \begin{DoxyCode}{0} \DoxyCodeLine{MyEvent\ ev\{1,\ \textcolor{stringliteral}{"{}Button\ Pressed"{}}\};} \DoxyCodeLine{\doxymbox{\hyperlink{namespacetk_a083495c9bf857a63f6c20a20aac0ca52}{tk::publish}}(ev);\ \textcolor{comment}{//\ MyEvent\ を受け付けるすべての\ Actor\ に届く}} \end{DoxyCode} \Hypertarget{namespacetk_a5549bec310750722a1964de1145b9fed}\index{tk@{tk}!publish@{publish}} \index{publish@{publish}!tk@{tk}} \doxysubsubsection{\texorpdfstring{publish()}{publish()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} {\footnotesize\ttfamily \label{namespacetk_a5549bec310750722a1964de1145b9fed} size\+\_\+t tk::\+publish (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{id}{, }\item[{uintptr\+\_\+t}]{arg}{ = {\ttfamily 0}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}} \doxylink{structtk_1_1_message}{tk::\+\+Message} 型の同報配信ショートカット \begin{DoxyParams}{Parameters} {\em id} & メッセージ\+ID \\ \hline {\em arg} & 引数 (省略時: 0) \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} size\+\_\+t 配信に成功した \doxylink{classtk_1_1_actor}{Actor} の数 \end{DoxyReturn} \Hypertarget{namespacetk_aae83f84121085578a7568437a8dc2447}\index{tk@{tk}!sleep\_ms@{sleep\_ms}} \index{sleep\_ms@{sleep\_ms}!tk@{tk}} \doxysubsubsection{\texorpdfstring{sleep\_ms()}{sleep\_ms()}} {\footnotesize\ttfamily \label{namespacetk_aae83f84121085578a7568437a8dc2447} void tk::\+sleep\+\_\+ms (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{ms}{}\end{DoxyParamCaption})} 現在のタスクを指定時間スリープさせます スリープ中はタスクが休止状態になり、\+CPU は他のタスクへ自動的に割り当てられます (CPU消費ゼロ)。 \begin{DoxyParams}{Parameters} {\em ms} & スリープする時間 (ミリ秒) \\ \hline \end{DoxyParams} \begin{DoxyNote}{Note} タスクコンテキスト内から呼び出す必要があります。 \end{DoxyNote} \Hypertarget{namespacetk_a675f1829b87e2a43239b6f80a526d0ed}\index{tk@{tk}!start@{start}} \index{start@{start}!tk@{tk}} \doxysubsubsection{\texorpdfstring{start()}{start()}} {\footnotesize\ttfamily \label{namespacetk_a675f1829b87e2a43239b6f80a526d0ed} void tk::\+start (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})} tinykernel スケジューラを起動します Core 0 のスケジューラを開始し、\+Core 1 を自動ブートしてデュアルコア並行実行を開始します。 この関数から制御が戻ることはありません (Never returns)。 \Hypertarget{namespacetk_a752b12f6862815c94a52347af52578b7}\index{tk@{tk}!unlock@{unlock}} \index{unlock@{unlock}!tk@{tk}} \doxysubsubsection{\texorpdfstring{unlock()}{unlock()}} {\footnotesize\ttfamily \label{namespacetk_a752b12f6862815c94a52347af52578b7} void tk::\+unlock (\begin{DoxyParamCaption}\item[{bool}]{was\+\_\+enabled}{}\end{DoxyParamCaption})} \doxylink{namespacetk_a6540aa25eb8562f6d6c8b37977d6cfe8}{tk::\+lock()} で入ったクリティカルセクションを抜けます \begin{DoxyParams}{Parameters} {\em was\+\_\+enabled} & \doxylink{namespacetk_a6540aa25eb8562f6d6c8b37977d6cfe8}{tk::\+lock()} の戻り値 \\ \hline \end{DoxyParams} \Hypertarget{namespacetk_a8081956b0a19b87d5b7c81b772373397}\index{tk@{tk}!yield@{yield}} \index{yield@{yield}!tk@{tk}} \doxysubsubsection{\texorpdfstring{yield()}{yield()}} {\footnotesize\ttfamily \label{namespacetk_a8081956b0a19b87d5b7c81b772373397} void tk::\+yield (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})} 現在実行中のタスクを一時中断し、同優先度の他のタスクへ CPU を譲渡します \begin{DoxyNote}{Note} タスクコンテキスト内から呼び出す必要があります。 \end{DoxyNote}