# IAR STM8 delay function

i was wondering how i could write a delay function in the STM8 - IAR Embedded Workbench? I used the search-function inside the IDE, so i found the "__delay()" function but if i try to use it i get:

"no definition for '__delay'"

• Are you including the header that declares that function? – Nick Williams Aug 19 '15 at 19:01
• Hi and thanks for your reply, i don't think so, according to the help it is a "pre-defined system macro" – binaryBigInt Aug 19 '15 at 19:23
• I'm not familiar with IAR Embedded Workbench, so I'm just guessing. Can you see what file the "delay" is declared and try to include that in your source file. You might have to google: "include file for IAR Embedded Workbench". – Nick Williams Aug 19 '15 at 19:27
• According to the Help-function i have to define my system macros in an extra file which will be loaded while the code is executing. Is there seriously no build-in delay-function? – binaryBigInt Aug 19 '15 at 19:46

#include <intrinsics.h>