--- nono/vm/rtc.cpp 2026/04/29 17:05:18 1.1.1.9 +++ nono/vm/rtc.cpp 2026/04/29 17:05:29 1.1.1.10 @@ -17,9 +17,6 @@ RTCDevice::RTCDevice() : inherited(OBJ_RTC) { - event.Regist("RTC ClockIn"); - event.time = period; - event.func = ToEventCallback(&RTCDevice::Callback); } // デストラクタ @@ -96,6 +93,11 @@ RTCDevice::Init() rtc_tm.tm_sec = ss; } + event.func = ToEventCallback(&RTCDevice::Callback); + event.time = period; + event.SetName("RTC ClockIn"); + scheduler->RegistEvent(event); + return true; } @@ -107,7 +109,6 @@ RTCDevice::StartTime() struct tm tm; if (force_fixed) { - putmsgn("force_fixed"); // 固定の時刻を設定 struct tm fixed { .tm_sec = 16, @@ -378,11 +379,11 @@ RTCDevice::CountUpMin() } // 現在の月の最終日を返す (月の繰り上がり処理用) -int +uint RTCDevice::GetLastMday() const { // 下記の理由により 0 月が必要。値は適当。 - static const int mdays[] = { + static const uint mdays[] = { 30, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; @@ -391,8 +392,8 @@ RTCDevice::GetLastMday() const // 範囲外の値に対するロジックは違うだろうが規定されていないので // こっち都合で実装しておく。 // m は 0..12 - int m = GetMon() % 13; - int lastday = mdays[m]; + uint m = GetMon() % 13; + uint lastday = mdays[m]; if (m == 2 && GetLeap() == 0) { lastday++; }