diff options
Diffstat (limited to 'src/devices/machine/rtc65271.cpp')
-rw-r--r-- | src/devices/machine/rtc65271.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/devices/machine/rtc65271.cpp b/src/devices/machine/rtc65271.cpp index 5ddc59ddb5f..dc7aad8d210 100644 --- a/src/devices/machine/rtc65271.cpp +++ b/src/devices/machine/rtc65271.cpp @@ -405,7 +405,7 @@ void rtc65271_device::write(int xramsel, offs_t offset, uint8_t data) { attotime period = attotime::from_hz(SQW_freq_table[data & reg_A_RS]); attotime half_period = period / 2; - attotime elapsed = m_update_timer->elapsed(); + attotime elapsed = m_begin_update_timer->elapsed(); if (half_period > elapsed) m_SQW_timer->adjust(half_period - elapsed); @@ -510,7 +510,7 @@ TIMER_CALLBACK_MEMBER(rtc65271_device::rtc_begin_update_cb) m_regs[reg_A] |= reg_A_UIP; /* schedule end of update cycle */ - machine().scheduler().timer_set(UPDATE_CYCLE_TIME, timer_expired_delegate(FUNC(rtc65271_device::rtc_end_update_cb), this)); + m_end_update_timer->adjust(UPDATE_CYCLE_TIME); } } @@ -682,9 +682,11 @@ rtc65271_device::rtc65271_device(const machine_config &mconfig, const char *tag, //------------------------------------------------- void rtc65271_device::device_start() { - m_update_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rtc65271_device::rtc_begin_update_cb), this)); - m_update_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); - m_SQW_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rtc65271_device::rtc_SQW_cb), this)); + m_begin_update_timer = timer_alloc(FUNC(rtc65271_device::rtc_begin_update_cb), this); + m_begin_update_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); + m_end_update_timer = timer_alloc(FUNC(rtc65271_device::rtc_end_update_cb), this); + m_end_update_timer->adjust(attotime::never); + m_SQW_timer = timer_alloc(FUNC(rtc65271_device::rtc_SQW_cb), this); m_interrupt_cb.resolve(); save_item(NAME(m_regs)); |