From 64da8e17d1f9114f1ba6a104ae993594e1e58c39 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 1 Aug 2017 17:01:20 -0400 Subject: [PATCH] Fixed: of course this should take a reference to an existing port handler rather than hatching its own; otherwise additional communication with a port handler by an i8255 owner doesn't work as intended. --- Components/8255/i8255.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Components/8255/i8255.hpp b/Components/8255/i8255.hpp index 96e4e0a0a..e188d669c 100644 --- a/Components/8255/i8255.hpp +++ b/Components/8255/i8255.hpp @@ -22,7 +22,7 @@ class PortHandler { // ignoring operation mode. But at least it establishes proper ownership and hand-off of decision making. template class i8255 { public: - i8255() : control_(0), outputs_{0, 0, 0} {} + i8255(T &port_handler) : control_(0), outputs_{0, 0, 0}, port_handler_(port_handler) {} void set_register(int address, uint8_t value) { switch(address & 3) { @@ -63,7 +63,7 @@ template class i8255 { uint8_t control_; uint8_t outputs_[3]; - T port_handler_; + T &port_handler_; }; }