Skip to content

Commit 7149a1b

Browse files
committed
Extract magic strings
1 parent fb8a54f commit 7149a1b

File tree

1 file changed

+3
-2
lines changed
  • libraries/Camera/extras/WebSerialCamera

1 file changed

+3
-2
lines changed

libraries/Camera/extras/WebSerialCamera/app.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ const ctx = canvas.getContext('2d');
1313

1414

1515
// Set the buffer size to the total bytes. This allows to read the entire bitmap in one go.
16-
const bufferSize = 1024 * 1024;//Math.min(totalBytes, 16 * 1024 * 1024); // Max buffer size is 16MB
16+
const bufferSize = 2 * 1024 * 1024; // Max buffer size is 16MB
1717
const flowControl = 'hardware';
1818
const baudRate = 115200; // Adjust this value based on your device's baud rate
1919
const dataBits = 8; // Adjust this value based on your device's data bits
2020
const stopBits = 2; // Adjust this value based on your device's stop bits
21+
const parityBit = 'even'; // Adjust this value based on your device's parity bit
2122

2223
const imageDataProcessor = new ImageDataProcessor(ctx);
23-
const connectionHandler = new SerialConnectionHandler(baudRate, dataBits, stopBits, "even", "hardware", bufferSize);
24+
const connectionHandler = new SerialConnectionHandler(baudRate, dataBits, stopBits, parityBit, flowControl, bufferSize);
2425

2526
connectionHandler.onConnect = async () => {
2627
connectButton.textContent = 'Disconnect';

0 commit comments

Comments
 (0)