Update platform drivers
Revision 10:b5115cd6b916, committed 2020-06-17
- Comitter:
- EndaKilgarriff
- Date:
- Wed Jun 17 14:54:14 2020 +0000
- Parent:
- 9:9e247b9c9abf
- Commit message:
- Roll back delay.cpp to previous version
Changed in this revision
src/delay.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 9e247b9c9abf -r b5115cd6b916 src/delay.cpp --- a/src/delay.cpp Mon Jun 15 13:03:55 2020 +0000 +++ b/src/delay.cpp Wed Jun 17 14:54:14 2020 +0000 @@ -10,22 +10,22 @@ * By using this software you agree to the terms of the associated * Analog Devices Software License Agreement. *******************************************************************************/ - + /******************************************************************************/ /***************************** Include Files **********************************/ /******************************************************************************/ - + #include <mbed.h> #include "platform_drivers.h" - + /******************************************************************************/ /********************** Macros and Constants Definitions **********************/ /******************************************************************************/ - + /******************************************************************************/ /************************ Functions Definitions *******************************/ /******************************************************************************/ - + /** * @brief Generate microseconds delay. * @param usecs - Delay in microseconds. @@ -33,17 +33,11 @@ */ void udelay(uint32_t usecs) { - if (usecs < 1000) { - // Simple delay, minimum time is 1ms. - HAL_Delay(1); - } else { - // This is a simple approach to guarantee a delay - usecs /= 1000; - usecs++; // Simple 'ceiling' to round up to guarantee minimum delay - HAL_Delay(usecs); - } + if (usecs) { + // Unused variable - fix compiler warning + } } - + /** * @brief Generate miliseconds delay. * @param msecs - Delay in miliseconds. @@ -51,7 +45,8 @@ */ void mdelay(uint32_t msecs) { - if (msecs) { - HAL_Delay(msecs); - } + if (msecs) { + HAL_Delay(msecs); + } } + \ No newline at end of file