Fixed typo and removed uneeded counter in exchange for a more clear TIN pin clock update interface

This commit is contained in:
Joakim Larsson Edstrom 2016-11-30 22:08:28 +01:00
parent 6845eabdf1
commit 9b84f0bd72
2 changed files with 10 additions and 13 deletions

View File

@ -20,7 +20,7 @@
* - Complete support for clock and timers * - Complete support for clock and timers
* - Add interrupt support * - Add interrupt support
* - Add DMA support * - Add DMA support
* - Add apropriate buffering for each submode * - Add appropriate buffering for each submode
**********************************************************************/ **********************************************************************/
#include "68230pit.h" #include "68230pit.h"
@ -240,18 +240,15 @@ void pit68230_device::pa_update_bit(uint8_t bit, uint8_t state){ if (state) m_pa
void pit68230_device::pb_update_bit(uint8_t bit, uint8_t state){ if (state) m_pbdr |= (1 << bit); else m_pbdr &= ~(1 << bit); } void pit68230_device::pb_update_bit(uint8_t bit, uint8_t state){ if (state) m_pbdr |= (1 << bit); else m_pbdr &= ~(1 << bit); }
void pit68230_device::pc_update_bit(uint8_t bit, uint8_t state){ if (state) m_pcdr |= (1 << bit); else m_pcdr &= ~(1 << bit); } void pit68230_device::pc_update_bit(uint8_t bit, uint8_t state){ if (state) m_pcdr |= (1 << bit); else m_pcdr &= ~(1 << bit); }
void pit68230_device::update_tin() void pit68230_device::update_tin(uint8_t state)
{ {
static uint32_t counter = 0;
// Tick clock on falling edge. TODO: check what flank is correct // Tick clock on falling edge. TODO: check what flank is correct
if (((counter & 1) != 0)) if (state == CLEAR_LINE)
{ {
tick_clock(); tick_clock();
} }
pc_update_bit(REG_PCDR_TIN_BIT, counter & 1); pc_update_bit(REG_PCDR_TIN_BIT, state == ASSERT_LINE ? 0 : 1);
counter++;
} }
#if VERBOSE > 2 #if VERBOSE > 2

View File

@ -131,7 +131,7 @@ class pit68230_device : public device_t//, public device_execute_interface
void pa_update_bit(uint8_t bit, uint8_t state); void pa_update_bit(uint8_t bit, uint8_t state);
void pb_update_bit(uint8_t bit, uint8_t state); void pb_update_bit(uint8_t bit, uint8_t state);
void pc_update_bit(uint8_t bit, uint8_t state); void pc_update_bit(uint8_t bit, uint8_t state);
void update_tin(); void update_tin(uint8_t);
void wr_pitreg_pgcr(uint8_t data); void wr_pitreg_pgcr(uint8_t data);
void wr_pitreg_psrr(uint8_t data); void wr_pitreg_psrr(uint8_t data);