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 66#include <util/delay.h>
77#include "as_common.h"
88
9+ extern void delay_impl ();
10+
11+ // lightweight asm function call interface
12+ void delay (uint32_t msec )
13+ {
14+ register __uint24 ms asm ("r24" ) = msec ;
15+ asm volatile (
16+ "%~call %x1\n"
17+ : "+r" (ms )
18+ : "i" (delay_impl )
19+ : "r20" , "r21" // clobbers
20+ );
21+ }
22+
923// delays a specified number of microseconds - modified from picoCore
1024// works for clock frequencies of 4Mhz and up
1125void delayMicroseconds (uint16_t us )
You can’t perform that action at this time.
0 commit comments