SAM4SD32 (SAM4S-EK2)
Loading...
Searching...
No Matches
cycle_counter.c File Reference

ARM functions for busy-wait delay loops. More...

#include "cycle_counter.h"

Go to the source code of this file.

Functions

OPTIMIZE_HIGH RAMFUNC void portable_delay_cycles (unsigned long n)
 Delay loop to delay n number of cycles.

Detailed Description

ARM functions for busy-wait delay loops.

Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.

\cond ASF_LICENSE

Definition in file cycle_counter.c.

Function Documentation

◆ portable_delay_cycles()

OPTIMIZE_HIGH RAMFUNC void portable_delay_cycles ( unsigned long n)

Delay loop to delay n number of cycles.

Note
The function runs in internal RAM so that flash wait states will not affect the delay time.
Parameters
nNumber of cycles

Definition at line 42 of file cycle_counter.c.

43{
44 UNUSED(n);
45
46 __asm (
47 "loop: DMB \n"
48 "SUBS R0, R0, #1 \n"
49 "BNE.N loop "
50 );
51}