main: limit stored EEPROM to 1 extension
This commit is contained in:
parent
f486521126
commit
2f0ffb9c5a
19
main.c
19
main.c
|
@ -164,6 +164,12 @@ static void edid_modify(uint8_t* edid)
|
|||
{
|
||||
// modify EDID to include the character indicating the firewall
|
||||
const char firewall_indicator = '|'; // pipe/wall character to indicate the firewall
|
||||
|
||||
// ensure we only have up to one extension
|
||||
if (edid[126] > 1) {
|
||||
edid[126] = 1;
|
||||
}
|
||||
|
||||
// ensure descriptor 4 is for Display name
|
||||
if ((0 == edid[108]) && (0 == edid[109]) && (0 == edid[110]) && (0xfc == edid[111]) && (0 == edid[112])) { // ensure descriptor 4 is for Display name
|
||||
uint8_t last_c; // position of last character
|
||||
|
@ -179,14 +185,15 @@ static void edid_modify(uint8_t* edid)
|
|||
while (last_c < 126) {
|
||||
edid[last_c++] = ' '; // insert padding space
|
||||
}
|
||||
// calculate new checksum
|
||||
uint8_t checksum = 0;
|
||||
for (uint8_t i = 0; i < 127; i++) {
|
||||
checksum += edid[i];
|
||||
}
|
||||
edid[127] = (256 - checksum);
|
||||
}
|
||||
}
|
||||
|
||||
// calculate new checksum
|
||||
uint8_t checksum = 0;
|
||||
for (uint8_t i = 0; i < 127; i++) {
|
||||
checksum += edid[i];
|
||||
}
|
||||
edid[127] = (256 - checksum);
|
||||
}
|
||||
|
||||
void main(void)
|
||||
|
|
Loading…
Reference in New Issue