busvoodoo: use LED for UART activity
This commit is contained in:
parent
a91161981c
commit
b875d88bd5
|
@ -144,7 +144,7 @@ static bool busvoodoo_uart_setup(char** prefix, const char* line)
|
|||
}
|
||||
if (BUSVOODOO_UART_SETTING_DRIVE==busvoodoo_uart_setting) { // if next setting
|
||||
printf("p) push-pull (3.3V)\n");
|
||||
printf("o) open-drain (set lV do desired voltage), with embedded pull-up (2kR)\n");
|
||||
printf("o) open-drain (set lV do desired voltage), with embedded pull-up (2kO)\n");
|
||||
snprintf(config, LENGTH(config), "drive mode (p,o) [%c]", busvoodoo_uart_drive); // show drive mode
|
||||
*prefix = config; // display next setting
|
||||
}
|
||||
|
@ -214,6 +214,7 @@ static bool busvoodoo_uart_setup(char** prefix, const char* line)
|
|||
printf("|xx xx RX 3V3 GND|\n");
|
||||
printf("|xx xx TX lV 5V |\n");
|
||||
printf("+----------------+\n");
|
||||
led_off(); // disable LED because there is no activity
|
||||
busvoodoo_uart_setting = BUSVOODOO_UART_SETTING_NONE; // restart settings next time
|
||||
complete = true; // configuration is complete
|
||||
*prefix = "UART"; // display mode
|
||||
|
@ -250,6 +251,7 @@ static void busvoodoo_uart_command_transmit(void* argument)
|
|||
uint16_t i=0;
|
||||
while (((char*)(argument))[i]) { // go through word to send
|
||||
usart_send_blocking(USART(BUSVOODOO_USART_ID), ((char*)(argument))[i++]); // send character
|
||||
busvoodoo_led_red(100); // enable red LED to show transmission
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -261,6 +263,7 @@ static void busvoodoo_uart_command_receive(void* argument)
|
|||
(void)argument; // we won't use the argument
|
||||
while (true) {
|
||||
char c = usart_recv_blocking(USART(BUSVOODOO_USART_ID)); // receive character
|
||||
busvoodoo_led_blue(100); // enable blue LED to show reception
|
||||
printf("%c", c); // print received character
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue