Need a support for IAR-STM8

Status
Not open for further replies.

Mr.eyni

Newbie level 5
Joined
Jan 12, 2014
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,333
Hi everyone
I have downloaded a code and I want to use it in IAR for stm8 software.
Code:
// delay v1.0
// delays are limited by F_CPU * x overflowing 32bit integer value
#ifndef _UTIL_DELAY_H_
#define _UTIL_DELAY_H_ 1

#ifndef F_CPU
#warning F_CPU is not defined!
#endif

/*
 * Func delayed N cycles, where N = 3 + ( ticks * 3 )
 * so, ticks = ( N - 3 ) / 3, minimum delay is 6 CLK
 * when tick = 1, because 0 equels 65535
 */

static @inline void _delay_cycl( unsigned short __ticks )
{
#if defined(__CSMC__)
/* COSMIC */
  //#define T_COUNT(x) (( F_CPU * x / 1000000UL )-3)/3) // pùvodní varianta byla pøesnìjší ale hrozila podtíkáním
    #define T_COUNT(x) (((( F_CPU * x / 1000000UL ))/3)+1)
    // ldw X, __ticks ; insert automaticaly
    _asm("nop\n $N:\n decw X\n jrne $L\n nop\n ", __ticks);
#elif defined(__SDCC)
  //#define T_COUNT(x) (( F_CPU * x / 1000000UL )-5)/5) // pùvodní varianta byla pøesnìjší ale hrozila podtíkáním
    #define T_COUNT(x) (((( F_CPU * x / 1000000UL ))/5)+1)
    __asm__("nop\n nop\n");
    do {         // ASM: ldw X, #tick; lab$: decw X; tnzw X; jrne lab$
                __ticks--;//      2c;                 1c;     2c    ; 1/2c 
        } while ( __ticks );
    __asm__("nop\n");
#elif defined(__RCST7__)
/* RAISONANCE */
  #error ToDo for RAISONANCE
#elif defined(__ICCSTM8__)
/* IAR */
  #error ToDo for IAR
#else
 #error Unsupported Compiler!          /* Compiler defines not found */
#endif
}
This error occurs during compilation:
Code:
Fatal Error[Pe035]: #error directive: ToDo for IAR L:\شرکت\پروژه ها\Gps\Code\6 - rah andazi lcd\8\delay.h 37
The error is related to the following line:
Code:
  #error ToDo for IAR
I would be grateful if the experts of this forum could help to solve this problem.
 

It's not actually an error, just a reminder that the delay code for IAR compiler has to be written yet.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…