Small JS fixes (#3950)

This commit is contained in:
porta 2024-10-15 20:03:15 +03:00 committed by GitHub
parent fbc3b494b7
commit a6cf08523c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -2,10 +2,10 @@ let serial = require("serial");
serial.setup("usart", 230400);
while (1) {
let rx_data = serial.readBytes(1, 0);
let rx_data = serial.readBytes(1, 1000);
if (rx_data !== undefined) {
serial.write(rx_data);
let data_view = Uint8Array(rx_data);
print("0x" + toString(data_view[0], 16));
}
}
}

View file

@ -78,4 +78,4 @@ export declare function print(string: string, delay?: number): void;
* @param string The string to print
* @param delay How many milliseconds to wait between key presses
*/
export declare function println(): void;
export declare function println(string: string, delay?: number): void;