File tree Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 11// (c) Ralph Doncaster 2020
22// ArduinoShrink
33
4- extern "C" void delay_impl ();
5- // lightweight custom function call abi
6- __attribute((always_inline ))
7- inline void delay (uint32_t msec )
8- {
9- register __uint24 ms asm ("r24" ) = msec ;
10- asm volatile (
11- "%~call %x1\n"
12- : "+r" (ms )
13- : "i" (delay_impl )
14- : "r20" , "r21" // clobbers
15- );
16- }
17-
4+ // Nothing here since ArduinoShrink replaces functions already defined
5+ // in Arduino.h
Original file line number Diff line number Diff line change 55#include <util/delay.h>
66#include "as_common.h"
77
8+ extern void delay_impl ();
9+
10+ // lightweight asm function call interface
11+ void delay (uint32_t msec )
12+ {
13+ register __uint24 ms asm ("r24" ) = msec ;
14+ asm volatile (
15+ "%~call %x1\n"
16+ : "+r" (ms )
17+ : "i" (delay_impl )
18+ : "r20" , "r21" // clobbers
19+ );
20+ }
21+
822// delays a specified number of microseconds - modified from picoCore
923// works for clock frequencies of 4Mhz and up
1024void delayMicroseconds (uint16_t us )
You can’t perform that action at this time.
0 commit comments