Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top