tk::PreemptGuard kernel.hpp tk::PreemptGuard::PreemptGuard () PreemptGuard tk::PreemptGuard::PreemptGuard tk::PreemptGuard::~PreemptGuard () ~PreemptGuard tk::PreemptGuard::~PreemptGuard tk::PreemptGuard::PreemptGuard (const PreemptGuard &)=delete PreemptGuard tk::PreemptGuard::PreemptGuard const PreemptGuard & PreemptGuard & PreemptGuard & tk::PreemptGuard::operator= (const PreemptGuard &)=delete operator= tk::PreemptGuard::operator= const PreemptGuard & プリエンプション禁止をスコープ単位で安全に管理する RAII クラス 生成時に自動で tk::preempt_disable() を呼び、スコープを抜けた際に自動で tk::preempt_enable() を呼びます。 { tk::PreemptGuardguard; //この区間はタスクスイッチが発生しない(I2C/SPI通信などに最適) i2c_write_blocking(...); }//自動でタスクスイッチが再開 tk::PreemptGuardoperator= tk::PreemptGuardPreemptGuard tk::PreemptGuardPreemptGuard tk::PreemptGuard~PreemptGuard