diff options
author | Vas Crabb <vas@vastheman.com> | 2018-06-10 23:02:51 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2018-06-10 23:02:51 +1000 |
commit | fa80ebf367d5c2e3e36158ba115040b18dd17ecf (patch) | |
tree | c5e2105fa8d63d60cd371364ed7910ef58281ac3 /src/devices/machine/eepromser.h | |
parent | b3e74fd12468a82f4d82891909468a1fa1f6a986 (diff) |
eepromser: prevent ambiguity between clock and streaming enable (nw)
Diffstat (limited to 'src/devices/machine/eepromser.h')
-rw-r--r-- | src/devices/machine/eepromser.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/devices/machine/eepromser.h b/src/devices/machine/eepromser.h index 0e5a299ecb1..c68276da19a 100644 --- a/src/devices/machine/eepromser.h +++ b/src/devices/machine/eepromser.h @@ -28,10 +28,10 @@ // TYPE DEFINITIONS //************************************************************************** -enum : bool +enum class eeprom_serial_streaming : bool { - EEPROM_SERIAL_NO_STREAMING = false, - EEPROM_SERIAL_ENABLE_STREAMING = true + DISABLE = false, + ENABLE = true }; // ======================> eeprom_serial_base_device @@ -40,14 +40,13 @@ class eeprom_serial_base_device : public eeprom_base_device { public: // inline configuration helpers - void set_address_bits(int addrbits) { m_command_address_bits = addrbits; } void enable_streaming(bool enable) { m_streaming_enabled = enable; } void enable_output_on_falling_clock(bool enable) { m_output_on_falling_clock_enabled = enable; } template<class Object> devcb_base &set_do_callback(Object &&cb) { return m_do_cb.set_callback(std::forward<Object>(cb)); } protected: // construction/destruction - eeprom_serial_base_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool enable_streaming = EEPROM_SERIAL_NO_STREAMING); + eeprom_serial_base_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, eeprom_serial_streaming enable_streaming); // device-level overrides virtual void device_start() override; @@ -91,6 +90,7 @@ protected: }; // internal helpers + void set_address_bits(int addrbits) { m_command_address_bits = addrbits; } void set_state(eeprom_state newstate); void execute_write_command(); @@ -145,7 +145,7 @@ public: protected: // construction/destruction - eeprom_serial_93cxx_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool enable_streaming = EEPROM_SERIAL_NO_STREAMING); + using eeprom_serial_base_device::eeprom_serial_base_device; // subclass overrides virtual void parse_command_and_address() override; @@ -158,11 +158,7 @@ class eeprom_serial_s29x90_device : public eeprom_serial_93cxx_device { protected: // construction/destruction - eeprom_serial_s29x90_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool ignored = EEPROM_SERIAL_NO_STREAMING) - : eeprom_serial_93cxx_device(mconfig, devtype, tag, owner, true) - { - enable_output_on_falling_clock(true); - } + eeprom_serial_s29x90_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, eeprom_serial_streaming ignored); }; @@ -182,7 +178,7 @@ public: protected: // construction/destruction - eeprom_serial_er5911_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool enable_streaming = EEPROM_SERIAL_NO_STREAMING); + using eeprom_serial_base_device::eeprom_serial_base_device; // subclass overrides virtual void parse_command_and_address() override; @@ -206,7 +202,7 @@ public: protected: // construction/destruction - eeprom_serial_x24c44_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool enable_streaming = EEPROM_SERIAL_NO_STREAMING); + using eeprom_serial_base_device::eeprom_serial_base_device; // subclass overrides virtual void parse_command_and_address() override; @@ -233,7 +229,8 @@ protected: class eeprom_serial_##_lowercase##_##_bits##bit_device : public eeprom_serial_##_baseclass##_device \ { \ public: \ - eeprom_serial_##_lowercase##_##_bits##bit_device(const machine_config &mconfig, const char *tag, device_t *owner, bool enable_streaming = EEPROM_SERIAL_NO_STREAMING); \ + eeprom_serial_##_lowercase##_##_bits##bit_device(const machine_config &mconfig, const char *tag, device_t *owner, eeprom_serial_streaming enable_streaming = eeprom_serial_streaming::DISABLE); \ + eeprom_serial_##_lowercase##_##_bits##bit_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); \ }; \ DECLARE_DEVICE_TYPE(EEPROM_SERIAL_##_uppercase##_##_bits##BIT, eeprom_serial_##_lowercase##_##_bits##bit_device) |