inverse red ram with register

This commit is contained in:
Shuanglei Tao
2025-05-10 21:36:02 +08:00
parent 883d2f918a
commit 2bd2a142eb
6 changed files with 18 additions and 40 deletions

View File

@@ -21,13 +21,10 @@
<div class="flex-group debug">
<label for="epddriver">驱动</label>
<select id="epddriver" onchange="filterDitheringOptions()">
<option value="01">UC8176黑白屏</option>
<option value="03">UC8176三色屏</option>
<option value="05">UC8276三色屏)</option>
<option value="04">SSD1619(黑白屏)</option>
<option value="02">SSD1619三色屏</option>
<option value="04">SSD1683黑白屏</option>
<option value="02">SSD1683三色屏</option>
<option value="01">UC8176/UC8276(黑白屏)</option>
<option value="03">UC8176/UC8276(三色屏)</option>
<option value="04">SSD1619/SSD1683黑白屏)</option>
<option value="02">SSD1619/SSD1683三色屏)</option>
</select>
</div>
<div class="flex-group debug">

View File

@@ -124,7 +124,7 @@ async function sendimg() {
status.parentElement.style.display = "block";
if (mode.startsWith('bwr')) {
const invert = (driver === '02') || (driver === '05');
const invert = (appVersion < 0x16) ? (driver === '02') : false;
await epdWrite(driver === "02" ? 0x24 : 0x10, canvas2bytes(canvas, 'bw'));
await epdWrite(driver === "02" ? 0x26 : 0x13, canvas2bytes(canvas, 'red', invert));
} else {
@@ -219,11 +219,11 @@ async function connect() {
try {
addLog("正在连接: " + bleDevice.name);
gattServer = await bleDevice.gatt.connect();
addLog(' 找到 GATT Server');
addLog('&nbsp;&nbsp;找到 GATT Server');
epdService = await gattServer.getPrimaryService('62750001-d828-918d-fb46-b6c11c675aec');
addLog(' 找到 EPD Service');
addLog('&nbsp;&nbsp;找到 EPD Service');
epdCharacteristic = await epdService.getCharacteristic('62750002-d828-918d-fb46-b6c11c675aec');
addLog(' 找到 Characteristic');
addLog('&nbsp;&nbsp;找到 Characteristic');
} catch (e) {
console.error(e);
if (e.message) addLog("connect: " + e.message);