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'"
IAR has __delay_cycles you can use it. Here a basic code
#include <intrinsics.h> #if !defined(F_CPU) #warning no F_CPU #endif #define delay_us(us) __delay_cycles((F_CPU *(us)/4000000uL)