Files
Embedded-Hacking/drivers/0x02_blink_cbm/Src/main.c
T
Kevin Thomas c46bcba401 fix: remove duplicate docstrings from public functions in .c files
Public function docstrings belong exclusively in .h headers per
coding convention. Only static helper functions and static variables
retain docstrings in .c files. Removed 413 duplicate docstrings
across 185 files (15 CBM + 15 C SDK projects). All 30 projects
rebuild with zero errors.
2026-04-06 08:49:37 -04:00

53 lines
1.4 KiB
C

/**
******************************************************************************
* @file main.c
* @author Kevin Thomas
* @brief Blink demonstration: toggle onboard LED every 500 ms.
*
* Demonstrates GPIO output control using the blink driver.
* The onboard LED on GPIO 25 is toggled every 500 ms and the
* current state is reported over UART.
*
******************************************************************************
* @attention
*
* Copyright (c) 2026 Kevin Thomas.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
#include "rp2350_led.h"
#include "rp2350_uart.h"
#include "rp2350_delay.h"
#define BLINK_DELAY_MS 500
/**
* @brief Print the current LED state over UART.
* @param pin GPIO pin number to query
* @retval None
*/
static void _print_led_state(uint32_t pin)
{
if (led_get_state(pin))
uart_puts("LED: ON\r\n");
else
uart_puts("LED: OFF\r\n");
}
int main(void)
{
led_init(LED_PIN);
uart_puts("LED driver initialized on GPIO 25\r\n");
while (1) {
led_toggle(LED_PIN);
_print_led_state(LED_PIN);
delay_ms(BLINK_DELAY_MS);
}
}