mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Tue Feb 16 14:28:01 2016 +0000
Revision:
114:252557024ec3
Parent:
102:da0ca467f8b5
Release 114 of the mbed library

Changes:
- Atmel SAM - warnings fixes
- B96B F446VE - hw control flow addition
- Remove of GCC CW which was not active
- Remove GCC CS, not released anymore - deprecated

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 97:433970e64889 1 #ifndef _NRF_DELAY_H
Kojto 97:433970e64889 2 #define _NRF_DELAY_H
Kojto 97:433970e64889 3
Kojto 97:433970e64889 4 // #include "nrf.h"
Kojto 97:433970e64889 5
Kojto 97:433970e64889 6 /*lint --e{438, 522} "Variable not used" "Function lacks side-effects" */
Kojto 97:433970e64889 7 #if defined ( __CC_ARM )
Kojto 97:433970e64889 8 static __ASM void __INLINE nrf_delay_us(uint32_t volatile number_of_us)
Kojto 97:433970e64889 9 {
Kojto 97:433970e64889 10 loop
Kojto 97:433970e64889 11 SUBS R0, R0, #1
Kojto 97:433970e64889 12 NOP
Kojto 97:433970e64889 13 NOP
Kojto 97:433970e64889 14 NOP
Kojto 97:433970e64889 15 NOP
Kojto 97:433970e64889 16 NOP
Kojto 97:433970e64889 17 NOP
Kojto 97:433970e64889 18 NOP
Kojto 97:433970e64889 19 NOP
Kojto 97:433970e64889 20 NOP
Kojto 97:433970e64889 21 NOP
Kojto 97:433970e64889 22 NOP
Kojto 97:433970e64889 23 NOP
Kojto 97:433970e64889 24 BNE loop
Kojto 97:433970e64889 25 BX LR
Kojto 97:433970e64889 26 }
Kojto 97:433970e64889 27 #elif defined ( __ICCARM__ )
Kojto 97:433970e64889 28 static void __INLINE nrf_delay_us(uint32_t volatile number_of_us)
Kojto 97:433970e64889 29 {
Kojto 97:433970e64889 30 __ASM (
Kojto 97:433970e64889 31 "loop:\n\t"
Kojto 97:433970e64889 32 " SUBS R0, R0, #1\n\t"
Kojto 97:433970e64889 33 " NOP\n\t"
Kojto 97:433970e64889 34 " NOP\n\t"
Kojto 97:433970e64889 35 " NOP\n\t"
Kojto 97:433970e64889 36 " NOP\n\t"
Kojto 97:433970e64889 37 " NOP\n\t"
Kojto 97:433970e64889 38 " NOP\n\t"
Kojto 97:433970e64889 39 " NOP\n\t"
Kojto 97:433970e64889 40 " NOP\n\t"
Kojto 97:433970e64889 41 " NOP\n\t"
Kojto 97:433970e64889 42 " NOP\n\t"
Kojto 97:433970e64889 43 " NOP\n\t"
Kojto 97:433970e64889 44 " NOP\n\t"
Kojto 97:433970e64889 45 " BNE loop\n\t");
Kojto 97:433970e64889 46 }
Kojto 97:433970e64889 47 #elif defined ( __GNUC__ )
Kojto 102:da0ca467f8b5 48 __INLINE static void nrf_delay_us(uint32_t volatile number_of_us)
Kojto 97:433970e64889 49 {
Kojto 97:433970e64889 50 do
Kojto 97:433970e64889 51 {
Kojto 97:433970e64889 52 __ASM volatile (
Kojto 97:433970e64889 53 "NOP\n\t"
Kojto 97:433970e64889 54 "NOP\n\t"
Kojto 97:433970e64889 55 "NOP\n\t"
Kojto 97:433970e64889 56 "NOP\n\t"
Kojto 97:433970e64889 57 "NOP\n\t"
Kojto 97:433970e64889 58 "NOP\n\t"
Kojto 97:433970e64889 59 "NOP\n\t"
Kojto 97:433970e64889 60 "NOP\n\t"
Kojto 97:433970e64889 61 "NOP\n\t"
Kojto 97:433970e64889 62 "NOP\n\t"
Kojto 97:433970e64889 63 "NOP\n\t"
Kojto 97:433970e64889 64 "NOP\n\t"
Kojto 97:433970e64889 65 "NOP\n\t"
Kojto 97:433970e64889 66 "NOP\n\t"
Kojto 97:433970e64889 67 );
Kojto 97:433970e64889 68 } while (--number_of_us);
Kojto 97:433970e64889 69 }
Kojto 97:433970e64889 70 #endif
Kojto 97:433970e64889 71
Kojto 97:433970e64889 72 void nrf_delay_ms(uint32_t volatile number_of_ms);
Kojto 97:433970e64889 73
Kojto 97:433970e64889 74 #endif