Skip to content

Commit d670348

Browse files
committed
Remove unused constructors
1 parent 80915bd commit d670348

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

N64Controller/N64Controller.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,12 @@
2323
#define N64_PINB_LOW DDRB |= pincode
2424
#define N64_PINB_QUERY (PINB & pincode)
2525

26-
N64Controller::N64Controller() {
27-
}
28-
29-
N64Controller::N64Controller(int serialPin) {
26+
N64Controller::N64Controller(unsigned char serialPin) {
27+
if(serialPin > 13)
28+
serialPin = 2;
3029
n64_PIN = serialPin;
3130
}
32-
void N64Controller::begin(int serialPin) {
33-
n64_PIN = serialPin;
34-
begin();
35-
}
31+
3632
void N64Controller::begin() {
3733
// Communication with N64 controller controller on this pin
3834
// Don't remove these lines, we don't want to push +5V to the controller

N64Controller/N64Controller.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@
4141

4242
class N64Controller {
4343
public:
44-
N64Controller();
45-
N64Controller(int serialPin); // first thing to call
46-
void begin(int serialPin);
44+
N64Controller(unsigned char serialPin); // first thing to call
4745
void begin(); // second thing to call
4846
void update(); // then update always and get button info
4947
// consider to have a delay instead of
@@ -68,7 +66,7 @@ class N64Controller {
6866
void print_N64_status();
6967
private:
7068
void set_up();
71-
int n64_PIN; // might also be set by constructor or begin()
69+
char n64_PIN; // might also be set by constructor or begin()
7270
char n64_pincode;
7371
bool n64_first_register; // PIN0-7: DDRD PIN8-13: DDRB
7472

0 commit comments

Comments
 (0)