Comments cleanup

pull/640/head
Jesse Vincent 5 years ago
parent 2f5b9d5c1d
commit e9e404e7e7

@ -44,22 +44,14 @@ Model01::Model01(void) {
} }
void Model01::enableScannerPower(void) { void Model01::enableScannerPower(void) {
// PC7
//pinMode(13, OUTPUT);
//digitalWrite(13, HIGH);
// Turn on power to the LED net // Turn on power to the LED net
DDRC |= _BV(7); DDRC |= _BV(7);
PORTC |= _BV(7); PORTC |= _BV(7);
} }
// This lets the keyboard pull up to 1.6 amps from
// the host. That violates the USB spec. But it sure
// is pretty looking
void Model01::enableHighPowerLeds(void) { void Model01::enableHighPowerLeds(void) {
// PE6 // This lets the keyboard pull up to 1.6 amps from the host.
// pinMode(7, OUTPUT); // That violates the USB spec. But it sure is pretty looking
// digitalWrite(7, LOW);
DDRE |= _BV(6); DDRE |= _BV(6);
PORTE &= ~_BV(6); PORTE &= ~_BV(6);
@ -76,9 +68,8 @@ void Model01::setup(void) {
delay(100); delay(100);
enableScannerPower(); enableScannerPower();
// Consider not doing this until 30s after keyboard // TODO: Consider not doing this until 30s after keyboard
// boot up, to make it easier to rescue things // boot up, to make it easier to rescue things in case of power draw issues.
// in case of power draw issues.
enableHighPowerLeds(); enableHighPowerLeds();
leftHandState.all = 0; leftHandState.all = 0;
rightHandState.all = 0; rightHandState.all = 0;
@ -134,7 +125,7 @@ cRGB Model01::getCrgbAt(int8_t i) {
if (i < 32) { if (i < 32) {
return leftHand.ledData.leds[i]; return leftHand.ledData.leds[i];
} else { } else {
return rightHand.ledData.leds[i - 32] ; return rightHand.ledData.leds[i - 32];
} }
} }
@ -142,6 +133,12 @@ void Model01::syncLeds() {
if (!isLEDChanged) if (!isLEDChanged)
return; return;
// LED Data is stored in four "banks" for each side
// We send it all at once to make it look nicer.
// We alternate left and right hands because otherwise
// we run into a race condition with updating the next bank
// on an ATTiny before it's done writing the previous one to memory
leftHand.sendLEDData(); leftHand.sendLEDData();
rightHand.sendLEDData(); rightHand.sendLEDData();

Loading…
Cancel
Save