docs: Modified Comments

This commit is contained in:
Devoalda 2023-09-08 07:50:55 +08:00
parent b90fe403f5
commit 7bdb0dbf1a
1 changed files with 5 additions and 4 deletions

View File

@ -1,8 +1,8 @@
/**
* Lab 2
* This is configured with GPIO15 as a pseudo button with a pull up resistor
* Since the button is active low, the program will send '1' when the button is not pressed (high)
* and send 'A' to 'Z' when the button is pressed (low)
* Since the button is active low, the program will send '1' when the button
* is not pressed (high) and send 'A' to 'Z' when the button is pressed (low)
*/
#include <stdio.h>
@ -31,7 +31,9 @@ static void uart_transmit(u_char *uart_input) {
else
{
uart_putc(UART_ID, *uart_input);
*uart_input = (*uart_input - 'A' + 1) % 26 + 'A'; // Next character and wrap around back to A
// Increment character and wrap around if necessary
*uart_input = (*uart_input - 'A' + 1) % 26 + 'A';
}
}
@ -89,7 +91,6 @@ static void pin_init() {
int main() {
// Initialize stdio and pins first
stdio_init_all();
pin_init();