--- nono/hd64180/hd647180dev.cpp 2026/04/29 17:05:18 1.1 +++ nono/hd64180/hd647180dev.cpp 2026/04/29 17:06:01 1.1.1.3 @@ -9,6 +9,7 @@ // #include "mpu64180.h" +#include "event.h" #include "hd647180.h" #include "scheduler.h" @@ -36,10 +37,10 @@ MPU64180Device::EnableTimer() // 停止していたのを開始する時だけ次の tick までの時間を求める。 uint64 now = scheduler->GetVirtTime() - timer_epoch; - uint64 tick = now / (clock_nsec * 20); - uint64 next = (tick + 1) * (clock_nsec * 20); + uint64 tick = now / (clock_tsec * 20); + uint64 next = (tick + 1) * (clock_tsec * 20); - timer_event.time = next - now; + timer_event->time = next - now; scheduler->StartEvent(timer_event); } @@ -61,7 +62,7 @@ MPU64180Device::ChangeTimerInterrupt() // タイマーイベント void -MPU64180Device::TimerCallback(Event& ev) +MPU64180Device::TimerCallback(Event *ev) { // アクティブがなければ停止 if (active_timer.empty()) { @@ -86,9 +87,9 @@ MPU64180Device::TimerCallback(Event& ev) // タイマーへの入力は原クロックの20倍なので、 // 厳密には 162.7604… * 20 = 3.255… [nsec] だが、 - // ここでは clock_nsec * 20 = 3.260 [nsec] とする。 + // ここでは clock_tsec * 20 = 3.260 [nsec] とする。 // この代入は本当は1回目だけでいいのだが。 - timer_event.time = clock_nsec * 20; + timer_event->time = clock_tsec * 20; scheduler->RestartEvent(ev); }