delay.c 650 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. / _____) _ | |
  3. ( (____ _____ ____ _| |_ _____ ____| |__
  4. \____ \| ___ | (_ _) ___ |/ ___) _ \
  5. _____) ) ____| | | || |_| ____( (___| | | |
  6. (______/|_____)_|_|_| \__)_____)\____)_| |_|
  7. (C)2013 Semtech
  8. Description: Delay functions implementation
  9. License: Revised BSD License, see LICENSE.TXT file include in the project
  10. Maintainer: Miguel Luis and Gregory Cristian
  11. */
  12. #include "board.h"
  13. void Delay( float s )
  14. {
  15. DelayMs( s * 1000.0f );
  16. }
  17. void DelayMs( uint32_t ms )
  18. {
  19. if( TimerGetLowPowerEnable( ) == true )
  20. {
  21. RtcDelayMs( ms );
  22. }
  23. else
  24. {
  25. TimerHwDelayMs( ms );
  26. }
  27. }