diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml
index 5c756c4..150eec4 100644
--- a/.github/workflows/static.yml
+++ b/.github/workflows/static.yml
@@ -36,7 +36,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
- path: 'docs'
+ path: 'html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
diff --git a/README.md b/README.md
index e461a8b..1cfc4ea 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@
引脚映射:0508090A0B0C0D
```
- 
+ 
- 老五 4.2 寸价签,黑白红三色版本
@@ -36,9 +36,9 @@
地址:https://tsl0922.github.io/EPD-nRF51/
-
+
-本项目自带一个基于浏览器蓝牙接口实现的网页版上位机,可通过上面网址访问,或者在本地直接双击打开 `docs/index.html` 来使用。
+本项目自带一个基于浏览器蓝牙接口实现的网页版上位机,可通过上面网址访问,或者在本地直接双击打开 `html/index.html` 来使用。
至于能不能使用,要看你打开这个页面的设备是否带有蓝牙硬件,还有使用的浏览器是否支持蓝牙接口。
diff --git a/docs/images/0.jpg b/docs/images/0.jpg
deleted file mode 100644
index f949de8..0000000
Binary files a/docs/images/0.jpg and /dev/null differ
diff --git a/docs/index.html b/docs/index.html
deleted file mode 100644
index 2e37cf5..0000000
--- a/docs/index.html
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
4.2 寸电子墨水屏蓝牙控制器(nRF51)
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/html/images/0.jpg b/html/images/0.jpg
new file mode 100644
index 0000000..c35a698
Binary files /dev/null and b/html/images/0.jpg differ
diff --git a/docs/images/1.jpg b/html/images/1.jpg
similarity index 100%
rename from docs/images/1.jpg
rename to html/images/1.jpg
diff --git a/html/index.html b/html/index.html
new file mode 100644
index 0000000..76e16f7
--- /dev/null
+++ b/html/index.html
@@ -0,0 +1,112 @@
+
+
+
+
+
4.2 寸电子墨水屏蓝牙控制器(nRF51)
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/js/dithering.js b/html/js/dithering.js
similarity index 100%
rename from docs/js/dithering.js
rename to html/js/dithering.js
diff --git a/docs/js/main.js b/html/js/main.js
similarity index 97%
rename from docs/js/main.js
rename to html/js/main.js
index 2df5bb9..f1d92b1 100644
--- a/docs/js/main.js
+++ b/html/js/main.js
@@ -34,6 +34,8 @@ function handleError(error) {
async function sendCommand(cmd) {
if (writeCharacteristic) {
await writeCharacteristic.writeValue(cmd);
+ } else {
+ addLog("服务不可用,请检查蓝牙连接");
}
}
@@ -119,7 +121,10 @@ function preConnect() {
}
else {
connectTrys = 0;
- navigator.bluetooth.requestDevice({ optionalServices: ['62750001-d828-918d-fb46-b6c11c675aec'], acceptAllDevices: true }).then(device => {
+ navigator.bluetooth.requestDevice({
+ optionalServices: ['62750001-d828-918d-fb46-b6c11c675aec'],
+ acceptAllDevices: true
+ }).then(device => {
device.addEventListener('gattserverdisconnected', disconnect);
bleDevice = device;
connect();
@@ -152,7 +157,6 @@ function connect() {
document.getElementById("connectbutton").innerHTML = '断开';
updateButtonStatus();
writeCharacteristic = characteristic;
- return;
}).catch(handleError);
}
}