Refactor setup a bit

pull/18/head
Jesse Vincent 10 years ago
parent cd483ffe39
commit 8c88c19cb1

@ -466,12 +466,19 @@ void release_key(Key mappedKey){
// Hardware initialization // Hardware initialization
void setup_pins() void setup_pins()
{ {
setup_output_pins();
setup_input_pins();
}
void setup_output_pins() {
//set up the row pins as outputs //set up the row pins as outputs
for (byte row = 0; row < ROWS; row++) { for (byte row = 0; row < ROWS; row++) {
pinMode(rowPins[row], OUTPUT); pinMode(rowPins[row], OUTPUT);
digitalWriteFast(rowPins[row], HIGH); digitalWriteFast(rowPins[row], HIGH);
} }
}
void setup_input_pins {
for (byte col = 0; col < COLS; col++) { for (byte col = 0; col < COLS; col++) {
pinMode(colPins[col], INPUT); pinMode(colPins[col], INPUT);
digitalWriteFast(colPins[col], HIGH); digitalWriteFast(colPins[col], HIGH);

Loading…
Cancel
Save