SukkoPera / PsxNewLib

Playstation controller interface library for Arduino
GNU General Public License v3.0
133 stars 29 forks source link

Didn't mark `getRightAnalog` as `const` #31

Closed RechieKho closed 6 months ago

RechieKho commented 6 months ago

So, on line 1186,

    boolean getRightAnalog (byte& x, byte& y) {
        x = rx;
        y = ry;

        return analogSticksValid;
    }

I believe you forgot to mark const.

Since the getLeftAnalog marked const (on line 1165),

    boolean getLeftAnalog (byte& x, byte& y) const {
        x = lx;
        y = ly;

        return analogSticksValid;
    }

So I believe it is a bug.

SukkoPera commented 6 months ago

Good catch! Doesn't cause any issue but it's still an oversight, I will fix it (one day).

RechieKho commented 6 months ago

Hopefully that one day is today 👌

SukkoPera commented 6 months ago

Well yes, with a PR everything is easier :). Thanks a lot!