stash
This commit is contained in:
parent
863ff46105
commit
f888d62ab8
@ -106,7 +106,7 @@ uint8_t edidbuf[256] = {
|
||||
|
||||
uint8_t i2cWrite(uint8_t addr, uint8_t reg, uint8_t value) {
|
||||
uint8_t err;
|
||||
|
||||
//return 0;
|
||||
Wire.beginTransmission(addr);
|
||||
Wire.write(reg);
|
||||
Wire.write(value);
|
||||
@ -198,10 +198,11 @@ uint8_t matrixInit() {
|
||||
i2cWrite(0x64, 0x46, 0xe4);
|
||||
i2cWrite(0x64, 0x47, 0x80);
|
||||
i2cWrite(0x64, 0x48, 0x04);
|
||||
i2cWrite(0x64, 0x49, 0b01110000);
|
||||
i2cWrite(0x64, 0x4a, 0xcf); // 0xff
|
||||
//i2cWrite(0x64, 0x49, 0b00111100);
|
||||
i2cWrite(0x64, 0x49, 0xb5);
|
||||
i2cWrite(0x64, 0x4a, 0xf2); // 0xff
|
||||
//i2cWrite(0x64, 0x49, 0xc0);
|
||||
i2cWrite(0x64, 0x4b, 0b111111);
|
||||
i2cWrite(0x64, 0x4b, 0x24);
|
||||
|
||||
uint8_t err;
|
||||
uint8_t physettings[4] = {0x4c, 0x02, 0x50, 0x00};
|
||||
@ -212,19 +213,19 @@ uint8_t matrixInit() {
|
||||
|
||||
physettings[0] = 0x4d;
|
||||
physettings[1] = 0x16;
|
||||
physettings[2] = 0x41;
|
||||
physettings[2] = 0x01;
|
||||
|
||||
if ((err = twi_writeTo(0x64, physettings, 3, true)) != 0) {
|
||||
Serial.printf("txphy write failed: %d\r\n", err);
|
||||
}
|
||||
Serial.printf("discharging txphy...");
|
||||
/*Serial.printf("discharging txphy...");
|
||||
delay(1000);
|
||||
|
||||
physettings[2] = 0x01;
|
||||
|
||||
if ((err = twi_writeTo(0x64, physettings, 3, true)) != 0) {
|
||||
Serial.printf("txphy write failed: %d\r\n", err);
|
||||
}
|
||||
}*/
|
||||
|
||||
//i2cWrite(0x64, 0x4c, 0x76);
|
||||
|
||||
@ -269,7 +270,7 @@ void init()
|
||||
input_a = (arrived - 0x31) & 0x3;
|
||||
input_b = (arrived - 0x31) & 0x3;
|
||||
debugf("setting: %d", input_a);
|
||||
i2cWrite(0x64, 0x49, (0b01010000 | 0) | (input_b << 2));
|
||||
i2cWrite(0x64, 0x49, (0b00110000 | input_a) | ((~input_b&3) << 2));
|
||||
});
|
||||
WDT.enable(false); // First (but not the best) option: fully disable watch dog timer
|
||||
|
||||
@ -368,6 +369,12 @@ void init()
|
||||
Serial.printf("%02x ", i2cRead(0x65, 0x0a));
|
||||
Serial.printf("%02x ", i2cRead(0x65, 0x0e));
|
||||
Serial.printf("%02x]\r\n", i2cRead(0x65, 0x0f));
|
||||
if (millis() < 15000) {
|
||||
i2cWrite(0x65, 0x08, 0x82);
|
||||
} else {
|
||||
i2cWrite(0x65, 0x08, 0x02);
|
||||
}
|
||||
i2cWrite(0x65, 0x0f, 0x10);
|
||||
}
|
||||
//Serial.println("====\n\n0x65 (1):");
|
||||
//select_output(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user