SukkoPera / PsxNewLib

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

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

Closed RechieKho closed 1 month ago

RechieKho commented 2 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 2 months ago

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

RechieKho commented 1 month ago

Hopefully that one day is today 👌

SukkoPera commented 1 month ago

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