mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-07-31 16:17:31 +02:00
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.
40 lines
1.0 KiB
C
40 lines
1.0 KiB
C
/**
|
|
******************************************************************************
|
|
* @file rp2350_delay.c
|
|
* @author Kevin Thomas
|
|
* @brief Delay driver implementation for RP2350.
|
|
*
|
|
* Busy-wait millisecond delay calibrated for a 12 MHz clock
|
|
* (3600 loop iterations per millisecond).
|
|
*
|
|
******************************************************************************
|
|
* @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_delay.h"
|
|
|
|
void delay_ms(uint32_t ms)
|
|
{
|
|
if (ms == 0)
|
|
return;
|
|
__asm__ volatile (
|
|
"mov r4, #3600\n\t"
|
|
"mul r5, %0, r4\n\t"
|
|
"1:\n\t"
|
|
"subs r5, #1\n\t"
|
|
"bne 1b\n\t"
|
|
:
|
|
: "r" (ms)
|
|
: "r4", "r5", "cc"
|
|
);
|
|
}
|