This commit is contained in:
2024-09-09 17:37:41 +02:00
parent 44ffb09ee9
commit 8fa5cddc23
6 changed files with 20 additions and 16 deletions

View File

@ -14,13 +14,25 @@ void rust_main();
void test_hardware() {
int fd0 = hw_device_open("uart0", 5);
write(fd0, "uart0\n", 6);
write(fd0, "UART0\n", 6);
int fd1 = hw_device_open("uart1", 5);
write(fd1, "uart1\n", 6);
vTaskDelay(1 / portTICK_PERIOD_MS);
uint8_t buffer[255];
// for (int i = 0; i< sizeof(buffer); i++) {
// buffer[i] = i;
// }
// write(fd0, buffer, sizeof(buffer));
vTaskDelay(10 / portTICK_PERIOD_MS);
write(1, "got:\n", 5);
uint8_t buffer[100];
int read_bytes = read(fd0, buffer, sizeof(buffer));
write(1, buffer, read_bytes);
read_bytes = read(fd1, buffer, sizeof(buffer));