Просмотр исходного кода

extend readme and status output

Thomas Buck 9 месяцев назад
Родитель
Сommit
0f8d8efd8a
2 измененных файлов: 26 добавлений и 2 удалений
  1. 22
    0
      README.md
  2. 4
    2
      docs/src/js/3d.js

+ 22
- 0
README.md Просмотреть файл

@@ -35,8 +35,22 @@ For the first time, flash as usual using the mass storage bootloader (hold BOOTS
35 35
 After the firmware has been flashed once you can just use the included `flash.sh` to avoid having to hold the button.
36 36
 Use `debug.sh` to open a serial console via USB.
37 37
 
38
+## Documentation
39
+
40
+You can find the [documentation here on GitHub pages](https://xythobuz.github.io/lars/).
41
+
42
+The docs are built using [mdbook](https://github.com/rust-lang/mdBook), licensed as `MPL-2.0`.
43
+Get the [latest release from GitHub](https://github.com/rust-lang/mdBook/releases) for a pre-built binary if you want to test changes to the docs locally.
44
+
45
+    ./docs/generate_docs.sh serve
46
+
47
+This will open your browser to a local development instance of the docs.
48
+
38 49
 ## Hardware Connections
39 50
 
51
+These are the used pins on the first prototype.
52
+Follow these if you want to build your own version without the included PCB design.
53
+
40 54
     Pin 1    GP0    I2C0 SDA
41 55
     Pin 2    GP1    I2C0 SCL
42 56
 
@@ -69,6 +83,14 @@ It uses the [Pi Pico SDK](https://github.com/raspberrypi/pico-sdk), licensed as
69 83
 
70 84
 The code in `src/encoder.c` is derived from [mathertel/RotaryEncoder](https://github.com/mathertel/RotaryEncoder) and therefore licensed as BSD 3-clause.
71 85
 
86
+The docs are built using [mdbook](https://github.com/rust-lang/mdBook), licensed as `MPL-2.0`.
87
+
88
+The PCB SVG files in the documentation are displayed using [svg-pan-zoom](https://github.com/bumbu/svg-pan-zoom), licensed as `BSD-2-Clause`.
89
+
90
+The 3D PCB files in the documentation are displayed using [three.js](hhttps://github.com/mrdoob/three.js), licensed as `MIT`.
91
+
92
+Some code in `docs/src/js/3d.js` is derived from [a blog post of Michal Jirků](https://wejn.org/2020/12/cracking-the-threejs-object-fitting-nut/).
93
+
72 94
     This program is free software: you can redistribute it and/or modify
73 95
     it under the terms of the GNU General Public License as published by
74 96
     the Free Software Foundation, either version 3 of the License, or

+ 4
- 2
docs/src/js/3d.js Просмотреть файл

@@ -142,9 +142,10 @@ export function init_3d(path, container, status, div_width, div_height) {
142 142
                 scene.add(mesh);
143 143
                 fitCameraToObject(camera, scene, 0, controls, 0);
144 144
                 controls.update();
145
+                status.textContent = "Loaded STL 100%";
145 146
             },
146 147
             (xhr) => {
147
-                const s = (xhr.loaded / xhr.total) * 100 + '% loaded';
148
+                const s = Math.floor((xhr.loaded / xhr.total) * 100) + '% loaded';
148 149
                 console.log(s);
149 150
                 status.textContent = s;
150 151
             },
@@ -164,9 +165,10 @@ export function init_3d(path, container, status, div_width, div_height) {
164 165
                 scene.add(object);
165 166
                 fitCameraToObject(camera, scene, 0, controls, 0);
166 167
                 controls.update();
168
+                status.textContent = "Loaded VRML 100%";
167 169
             },
168 170
             (xhr) => {
169
-                const s = (xhr.loaded / xhr.total) * 100 + '% loaded';
171
+                const s = Math.floor((xhr.loaded / xhr.total) * 100) + '% loaded';
170 172
                 console.log(s);
171 173
                 status.textContent = s;
172 174
             },

Загрузка…
Отмена
Сохранить