From 84518e442cc91843753b3734345f3ebd6e359848 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 16 Sep 2014 12:29:36 +0200 Subject: [PATCH] Fixed attribution rights for SAM delayMicroseconds function --- build/shared/revisions.txt | 2 +- hardware/arduino/sam/cores/arduino/wiring.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 08c405dea..8d1f07f89 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -214,7 +214,7 @@ ARDUINO 1.5.3 BETA - 2013.08.30 * Scrollable menus can now be scrolled with the mouse wheel [arduino core] -* sam: Fixed delayMicrosecond() when interrupts are disabled +* sam: Fixed delayMicrosecond() when interrupts are disabled (Paul Stoffregen) * sam: Upgraded libsam, and added missing modules (CAN, ETH, etc.) (Thibaut Viard) * sam: Added compatibility for avr/pgmspace.h (Paul Stoffregen) * sam: Added serialEvent*() support diff --git a/hardware/arduino/sam/cores/arduino/wiring.h b/hardware/arduino/sam/cores/arduino/wiring.h index 4316ea39e..9a3310dfd 100644 --- a/hardware/arduino/sam/cores/arduino/wiring.h +++ b/hardware/arduino/sam/cores/arduino/wiring.h @@ -1,5 +1,6 @@ /* Copyright (c) 2011 Arduino. All right reserved. + Copyright (c) 2013 by Paul Stoffregen (delayMicroseconds) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -65,6 +66,10 @@ extern void delay( uint32_t dwMs ) ; */ static inline void delayMicroseconds(uint32_t) __attribute__((always_inline, unused)); static inline void delayMicroseconds(uint32_t usec){ + /* + * Based on Paul Stoffregen's implementation + * for Teensy 3.0 (http://www.pjrc.com/) + */ if (usec == 0) return; uint32_t n = usec * (VARIANT_MCK / 3000000); asm volatile(