Skip to content

Latest commit

 

History

History
executable file
·
31 lines (19 loc) · 496 Bytes

README.md

File metadata and controls

executable file
·
31 lines (19 loc) · 496 Bytes

dwt_delay

Microseconds delay lib for STM32 (or whatever ARM) based on DWT.

Just include it in your project, call DWT_Init() and then use delays as needed.

Functions are named as DWT_* to be HAL-alike. If you dont use STM32 MCU, or dont like naming, change names to whatever you like.

Example

/* main.c */

#include "dwt_delay.h"


void main (void)
{
    // Init section of your code
    DWT_Init();


    while(1) {
        // Delay for 42us
        DWT_delay(42);
    }

}