Skip to content

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

License

Notifications You must be signed in to change notification settings

RaymondSuTMY/dwt_delay

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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);
    }

}

Changelog

  • 2018-01-06 This lib emerged.

  • 2019-02-19 Overflow check added.

  • 2019-03-26 Typo in definition fixed. Got back to short and simpler function.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 100.0%