Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Jul 08 11:22:30 2015 +0100
Revision:
102:da0ca467f8b5
Parent:
101:7cff1c4259d7
Release 102 of the mbed library

Changes:
- new platform: MPS2
- K64f - mac address fix
- Freescale Kinetis - Serial NC handling fix
- Asynch constnes fixes
- startup files .s - change extension to .S
- APPNEARME_MICRONFCBOARD rename to MICRONFCBOARD

Who changed what in which revision?

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