File tree 2 files changed +10
-4
lines changed
hardware/arduino/sam/cores/arduino
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ ARDUINO 1.5.6 BETA
8
8
* TFT: warning messages in PImage class and strings inside examples now stored in flash to save RAM.
9
9
* Ethernet: added operator == for EthernetClient class (Norbert Truchsess)
10
10
11
+ [core]
12
+ * sam: Fixed wrap-around bug in delay() (Mark Tillotson)
13
+
11
14
ARDUINO 1.5.5 BETA 2013.11.28
12
15
13
16
NOTICE:
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ extern "C" {
25
25
uint32_t millis ( void )
26
26
{
27
27
// todo: ensure no interrupts
28
- return GetTickCount () ;
28
+ return GetTickCount () ;
29
29
}
30
30
31
31
// Interrupt-compatible version of micros
@@ -74,9 +74,12 @@ uint32_t micros( void )
74
74
75
75
void delay ( uint32_t ms )
76
76
{
77
- uint32_t end = GetTickCount () + ms ;
78
- while (GetTickCount () < end )
79
- yield ();
77
+ if (ms == 0 )
78
+ return ;
79
+ uint32_t start = GetTickCount ();
80
+ do {
81
+ yield ();
82
+ } while (GetTickCount () - start < ms );
80
83
}
81
84
82
85
#if defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */
You can’t perform that action at this time.
0 commit comments