f/keyboardio-model-100
Jesse Vincent 3 years ago
parent ff1cacad51
commit c6eb7529ca
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -57,9 +57,9 @@ void Model100Hands::setup(void) {
// Turn on the switched 5V network. // Turn on the switched 5V network.
// TODO - make sure this happens at least 100ms after USB connect // TODO - make sure this happens at least 100ms after USB connect
// to satisfy inrush limits // to satisfy inrush limits
pinMode(PC13, OUTPUT_OPEN_DRAIN); pinMode(PC13, OUTPUT_OPEN_DRAIN);
digitalWrite(PC13, LOW); digitalWrite(PC13, LOW);
Wire.begin(); Wire.begin();
// Set B4, the overcurrent check to an input with an internal pull-up // Set B4, the overcurrent check to an input with an internal pull-up
// TODO DDRB &= ~_BV(4); // set bit, input // TODO DDRB &= ~_BV(4); // set bit, input
// TODO PORTB &= ~_BV(4); // set bit, enable pull-up resistor // TODO PORTB &= ~_BV(4); // set bit, enable pull-up resistor

@ -67,7 +67,7 @@ uint8_t Model100Side::controllerAddress() {
// https://www.arduino.cc/en/Reference/WireEndTransmission // https://www.arduino.cc/en/Reference/WireEndTransmission
byte Model100Side::setKeyscanInterval(byte delay) { byte Model100Side::setKeyscanInterval(byte delay) {
uint8_t data[] = {TWI_CMD_KEYSCAN_INTERVAL, delay}; uint8_t data[] = {TWI_CMD_KEYSCAN_INTERVAL, delay};
uint8_t result = writeData( data, ELEMENTS(data)); uint8_t result = writeData(data, ELEMENTS(data));
return result; return result;
} }
@ -103,9 +103,9 @@ byte Model100Side::setLEDSPIFrequency(byte frequency) {
} }
uint8_t Model100Side::writeData(uint8_t *data,uint8_t length) { uint8_t Model100Side::writeData(uint8_t *data, uint8_t length) {
Wire.beginTransmission(addr); Wire.beginTransmission(addr);
Wire.write( data, length); Wire.write(data, length);
uint8_t result = Wire.endTransmission(); uint8_t result = Wire.endTransmission();
return result; return result;
} }

Loading…
Cancel
Save