1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-29 16:55:59 +00:00

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.

This commit is contained in:
Thomas Harte 2017-08-01 17:01:20 -04:00
parent 08ad35efd9
commit 64da8e17d1

View File

@ -22,7 +22,7 @@ class PortHandler {
// ignoring operation mode. But at least it establishes proper ownership and hand-off of decision making.
template <class T> 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 T> class i8255 {
uint8_t control_;
uint8_t outputs_[3];
T port_handler_;
T &port_handler_;
};
}