Update platform drivers
src/delay.cpp@10:b5115cd6b916, 2020-06-17 (annotated)
- Committer:
- EndaKilgarriff
- Date:
- Wed Jun 17 14:54:14 2020 +0000
- Revision:
- 10:b5115cd6b916
- Parent:
- 9:9e247b9c9abf
Roll back delay.cpp to previous version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mahphalke | 8:70fc373a5f46 | 1 | /***************************************************************************//** |
mahphalke | 8:70fc373a5f46 | 2 | * @file delay.cpp |
mahphalke | 8:70fc373a5f46 | 3 | * @brief Implementation of delay functionality |
mahphalke | 8:70fc373a5f46 | 4 | ******************************************************************************** |
mahphalke | 8:70fc373a5f46 | 5 | * Copyright (c) 2019, 2020 Analog Devices, Inc. |
mahphalke | 8:70fc373a5f46 | 6 | * |
mahphalke | 8:70fc373a5f46 | 7 | * All rights reserved. |
mahphalke | 8:70fc373a5f46 | 8 | * |
mahphalke | 8:70fc373a5f46 | 9 | * This software is proprietary to Analog Devices, Inc. and its licensors. |
mahphalke | 8:70fc373a5f46 | 10 | * By using this software you agree to the terms of the associated |
mahphalke | 8:70fc373a5f46 | 11 | * Analog Devices Software License Agreement. |
mahphalke | 8:70fc373a5f46 | 12 | *******************************************************************************/ |
EndaKilgarriff | 10:b5115cd6b916 | 13 | |
mahphalke | 8:70fc373a5f46 | 14 | /******************************************************************************/ |
mahphalke | 8:70fc373a5f46 | 15 | /***************************** Include Files **********************************/ |
mahphalke | 8:70fc373a5f46 | 16 | /******************************************************************************/ |
EndaKilgarriff | 10:b5115cd6b916 | 17 | |
mahphalke | 8:70fc373a5f46 | 18 | #include <mbed.h> |
mahphalke | 8:70fc373a5f46 | 19 | #include "platform_drivers.h" |
EndaKilgarriff | 10:b5115cd6b916 | 20 | |
mahphalke | 8:70fc373a5f46 | 21 | /******************************************************************************/ |
mahphalke | 8:70fc373a5f46 | 22 | /********************** Macros and Constants Definitions **********************/ |
mahphalke | 8:70fc373a5f46 | 23 | /******************************************************************************/ |
EndaKilgarriff | 10:b5115cd6b916 | 24 | |
mahphalke | 8:70fc373a5f46 | 25 | /******************************************************************************/ |
mahphalke | 8:70fc373a5f46 | 26 | /************************ Functions Definitions *******************************/ |
mahphalke | 8:70fc373a5f46 | 27 | /******************************************************************************/ |
EndaKilgarriff | 10:b5115cd6b916 | 28 | |
mahphalke | 8:70fc373a5f46 | 29 | /** |
mahphalke | 8:70fc373a5f46 | 30 | * @brief Generate microseconds delay. |
mahphalke | 8:70fc373a5f46 | 31 | * @param usecs - Delay in microseconds. |
mahphalke | 8:70fc373a5f46 | 32 | * @return None. |
mahphalke | 8:70fc373a5f46 | 33 | */ |
mahphalke | 8:70fc373a5f46 | 34 | void udelay(uint32_t usecs) |
mahphalke | 8:70fc373a5f46 | 35 | { |
EndaKilgarriff | 10:b5115cd6b916 | 36 | if (usecs) { |
EndaKilgarriff | 10:b5115cd6b916 | 37 | // Unused variable - fix compiler warning |
EndaKilgarriff | 10:b5115cd6b916 | 38 | } |
mahphalke | 8:70fc373a5f46 | 39 | } |
EndaKilgarriff | 10:b5115cd6b916 | 40 | |
mahphalke | 8:70fc373a5f46 | 41 | /** |
mahphalke | 8:70fc373a5f46 | 42 | * @brief Generate miliseconds delay. |
mahphalke | 8:70fc373a5f46 | 43 | * @param msecs - Delay in miliseconds. |
mahphalke | 8:70fc373a5f46 | 44 | * @return None. |
mahphalke | 8:70fc373a5f46 | 45 | */ |
mahphalke | 8:70fc373a5f46 | 46 | void mdelay(uint32_t msecs) |
mahphalke | 8:70fc373a5f46 | 47 | { |
EndaKilgarriff | 10:b5115cd6b916 | 48 | if (msecs) { |
EndaKilgarriff | 10:b5115cd6b916 | 49 | HAL_Delay(msecs); |
EndaKilgarriff | 10:b5115cd6b916 | 50 | } |
mahphalke | 8:70fc373a5f46 | 51 | } |
EndaKilgarriff | 10:b5115cd6b916 | 52 |