mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-25 03:29:58 -07:00
[FL-3734] UART framing mode selection (#4121)
* HAL: feat: uart framing * JS: feat: uart framing * fix formatting * fix pvs warning * HAL: flash impact reduction attempt 1 * HAL: flash impact reduction attempt 2 * fix compile error * HAL: finalize flash impact reduction * HAL: remove user-facing magic numbers Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// This script is like uart_echo, except it uses 8E1 framing (8 data bits, even
|
||||
// parity, 1 stop bit) as opposed to the default 8N1 (8 data bits, no parity,
|
||||
// 1 stop bit)
|
||||
|
||||
let serial = require("serial");
|
||||
serial.setup("usart", 230400, { dataBits: "8", parity: "even", stopBits: "1" });
|
||||
|
||||
while (1) {
|
||||
let rx_data = serial.readBytes(1, 1000);
|
||||
if (rx_data !== undefined) {
|
||||
serial.write(rx_data);
|
||||
let data_view = Uint8Array(rx_data);
|
||||
print("0x" + data_view[0].toString(16));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user