Enda Kilgarriff / platform_drivers
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers delay.cpp Source File

delay.cpp

Go to the documentation of this file.
00001 /***************************************************************************//**
00002  *   @file   delay.cpp
00003  *   @brief  Implementation of delay functionality
00004 ********************************************************************************
00005  * Copyright (c) 2019, 2020 Analog Devices, Inc.
00006  *
00007  * All rights reserved.
00008  *
00009  * This software is proprietary to Analog Devices, Inc. and its licensors.
00010  * By using this software you agree to the terms of the associated
00011  * Analog Devices Software License Agreement.
00012 *******************************************************************************/
00013  
00014 /******************************************************************************/
00015 /***************************** Include Files **********************************/
00016 /******************************************************************************/
00017  
00018 #include <mbed.h>
00019 #include "platform_drivers.h"
00020  
00021 /******************************************************************************/
00022 /********************** Macros and Constants Definitions **********************/
00023 /******************************************************************************/
00024  
00025 /******************************************************************************/
00026 /************************ Functions Definitions *******************************/
00027 /******************************************************************************/
00028  
00029 /**
00030  * @brief Generate microseconds delay.
00031  * @param usecs - Delay in microseconds.
00032  * @return None.
00033  */
00034 void udelay(uint32_t usecs)
00035 {
00036     if (usecs) {
00037         // Unused variable - fix compiler warning
00038     }
00039 }
00040  
00041 /**
00042  * @brief Generate miliseconds delay.
00043  * @param msecs - Delay in miliseconds.
00044  * @return None.
00045  */
00046 void mdelay(uint32_t msecs)
00047 {
00048     if (msecs) {
00049         HAL_Delay(msecs);
00050     }
00051 }
00052