mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-08-15 23:50:23 +02:00
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.
This commit is contained in:
@@ -22,9 +22,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @brief IMAGE_DEF block structure placed in flash
|
||||
*/
|
||||
__attribute__((section(".embedded_block"), used))
|
||||
const uint8_t picobin_block[] = {
|
||||
0xD3, 0xDE, 0xFF, 0xFF,
|
||||
|
||||
@@ -38,10 +38,6 @@ static void _heartbeat(void)
|
||||
uart_puts("Timer heartbeat\r\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Application entry point for the repeating timer demo.
|
||||
* @retval int does not return
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
uart_puts("Timer alarm demo initialized\r\n");
|
||||
|
||||
@@ -22,11 +22,6 @@
|
||||
|
||||
#include "rp2350_delay.h"
|
||||
|
||||
/**
|
||||
* @brief Delay for the specified number of milliseconds.
|
||||
* @param ms number of milliseconds to delay
|
||||
* @retval None
|
||||
*/
|
||||
void delay_ms(uint32_t ms)
|
||||
{
|
||||
if (ms == 0)
|
||||
@@ -43,11 +38,6 @@ void delay_ms(uint32_t ms)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Delay for the specified number of microseconds.
|
||||
* @param us number of microseconds to delay
|
||||
* @retval None
|
||||
*/
|
||||
void delay_us(uint32_t us)
|
||||
{
|
||||
if (us == 0)
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
|
||||
#include "rp2350_reset.h"
|
||||
|
||||
/**
|
||||
* @brief Release IO_BANK0 from reset and wait until ready.
|
||||
* @retval None
|
||||
*/
|
||||
void reset_init_subsystem(void)
|
||||
{
|
||||
uint32_t value;
|
||||
|
||||
@@ -30,20 +30,12 @@
|
||||
|
||||
extern int main(void);
|
||||
|
||||
/**
|
||||
* @brief Initialize late peripherals (timer release and tick init).
|
||||
* @retval None
|
||||
*/
|
||||
void _late_init(void)
|
||||
{
|
||||
timer_release_reset();
|
||||
timer_tick_init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reset handler entry point (naked, noreturn).
|
||||
* @retval None
|
||||
*/
|
||||
void __attribute__((naked, noreturn)) Reset_Handler(void)
|
||||
{
|
||||
__asm__ volatile (
|
||||
|
||||
@@ -21,10 +21,6 @@
|
||||
|
||||
#include "rp2350_stack.h"
|
||||
|
||||
/**
|
||||
* @brief Initialize MSP, PSP, MSPLIM, and PSPLIM stack pointers.
|
||||
* @retval None
|
||||
*/
|
||||
void stack_init(void)
|
||||
{
|
||||
__asm__ volatile (
|
||||
|
||||
@@ -102,32 +102,18 @@ static void _timer_arm_alarm(void)
|
||||
TIMER0->ALARM0 = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Release TIMER0 from reset and wait until ready.
|
||||
* @retval None
|
||||
*/
|
||||
void timer_release_reset(void)
|
||||
{
|
||||
_timer_clear_reset_bit();
|
||||
_timer_wait_reset_done();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Start the TIMER0 tick generator at 1 us resolution.
|
||||
* @retval None
|
||||
*/
|
||||
void timer_tick_init(void)
|
||||
{
|
||||
_timer_set_tick_cycles();
|
||||
_timer_enable_tick();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Start a repeating alarm that fires every period_ms milliseconds.
|
||||
* @param period_ms interval in milliseconds between callbacks
|
||||
* @param cb function to call on each alarm
|
||||
* @retval None
|
||||
*/
|
||||
void timer_alarm_start(uint32_t period_ms, timer_callback_t cb)
|
||||
{
|
||||
_user_callback = cb;
|
||||
@@ -137,10 +123,6 @@ void timer_alarm_start(uint32_t period_ms, timer_callback_t cb)
|
||||
_timer_arm_alarm();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIMER0 alarm 0 interrupt handler (exception 16 + IRQ 0).
|
||||
* @retval None
|
||||
*/
|
||||
void TIMER0_IRQ_0_Handler(void)
|
||||
{
|
||||
TIMER0->INTR = TIMER_INTR_ALARM0_MASK;
|
||||
|
||||
@@ -79,20 +79,12 @@ static void _uart_enable(void)
|
||||
UART_BASE[UART_CR_OFFSET] = UART_CR_ENABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Release UART0 from reset and wait until ready.
|
||||
* @retval None
|
||||
*/
|
||||
void uart_release_reset(void)
|
||||
{
|
||||
_uart_clear_reset_bit();
|
||||
_uart_wait_reset_done();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize UART0 pins, baud rate, line control, and enable.
|
||||
* @retval None
|
||||
*/
|
||||
void uart_init(void)
|
||||
{
|
||||
_uart_configure_pins();
|
||||
@@ -100,19 +92,11 @@ void uart_init(void)
|
||||
_uart_enable();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether a received byte is waiting in the UART FIFO.
|
||||
* @retval bool true if at least one byte is available
|
||||
*/
|
||||
bool uart_is_readable(void)
|
||||
{
|
||||
return (UART_BASE[UART_FR_OFFSET] & UART_FR_RXFE_MASK) == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read one character from UART0 (blocking).
|
||||
* @retval char the received character
|
||||
*/
|
||||
char uart_getchar(void)
|
||||
{
|
||||
while (UART_BASE[UART_FR_OFFSET] & UART_FR_RXFE_MASK) {
|
||||
@@ -120,11 +104,6 @@ char uart_getchar(void)
|
||||
return (char)(UART_BASE[UART_DR_OFFSET] & 0xFF);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Transmit one character over UART0 (blocking).
|
||||
* @param c character to transmit
|
||||
* @retval None
|
||||
*/
|
||||
void uart_putchar(char c)
|
||||
{
|
||||
while (UART_BASE[UART_FR_OFFSET] & UART_FR_TXFF_MASK) {
|
||||
@@ -132,11 +111,6 @@ void uart_putchar(char c)
|
||||
UART_BASE[UART_DR_OFFSET] = (uint32_t)c;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Transmit a null-terminated string over UART0.
|
||||
* @param str pointer to the string to send
|
||||
* @retval None
|
||||
*/
|
||||
void uart_puts(const char *str)
|
||||
{
|
||||
while (*str) {
|
||||
@@ -144,11 +118,6 @@ void uart_puts(const char *str)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convert a lowercase ASCII character to uppercase.
|
||||
* @param c input character
|
||||
* @retval char uppercase equivalent or original character
|
||||
*/
|
||||
char uart_to_upper(char c)
|
||||
{
|
||||
if (c >= 'a' && c <= 'z')
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
|
||||
#include "rp2350_xosc.h"
|
||||
|
||||
/**
|
||||
* @brief Initialize the external crystal oscillator and wait until stable.
|
||||
* @retval None
|
||||
*/
|
||||
void xosc_init(void)
|
||||
{
|
||||
XOSC->STARTUP = 0x00C4U;
|
||||
@@ -34,10 +30,6 @@ void xosc_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable the XOSC peripheral clock via CLK_PERI_CTRL.
|
||||
* @retval None
|
||||
*/
|
||||
void xosc_enable_peri_clk(void)
|
||||
{
|
||||
uint32_t value;
|
||||
@@ -48,10 +40,6 @@ void xosc_enable_peri_clk(void)
|
||||
CLOCKS->CLK_PERI_CTRL = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Switch CLK_REF source to XOSC for a stable 12 MHz clk_sys.
|
||||
* @retval None
|
||||
*/
|
||||
void xosc_set_clk_ref(void)
|
||||
{
|
||||
CLOCKS->CLK_REF_CTRL = CLK_REF_CTRL_SRC_XOSC;
|
||||
|
||||
@@ -40,14 +40,6 @@ static void _default_handler(void)
|
||||
|
||||
typedef void (*vector_func_t)(void);
|
||||
|
||||
/**
|
||||
* @brief Vector table placed in .vectors section
|
||||
*
|
||||
* Entry 0: Initial SP
|
||||
* Entry 1: Reset handler
|
||||
* Entries 2-15: System exceptions (NMI, HardFault, etc.)
|
||||
* Entry 16: IRQ 0 = TIMER0_IRQ_0
|
||||
*/
|
||||
__attribute__((section(".vectors"), used))
|
||||
const void *_vectors[17] = {
|
||||
&_stack_top, // 0: Initial stack pointer
|
||||
|
||||
Reference in New Issue
Block a user