SDL-News: XOPTCHAN, XOPT, SDL_Clock()


Subject: SDL-News: XOPTCHAN, XOPT, SDL_Clock()
From: Eldor Roedseth (SystemSoft AS) (etoxer#ericsson.no)
Date: Wed Oct 27 1999 - 05:14:34 GMT


The originator of this message is responsible for its content.
-----From "Eldor Roedseth (SystemSoft AS)" <etoxer#ericsson.no> to sdlnews -----

Dear Mr. Zhang,

> ----------
> From: zhangxh#mail.eastcomtd.com
> To: sdlnews#sdl-forum.org
> Subject:
> Date: Tuesday, October 26, 1999 7:21 AM
>
> The originator of this message is responsible for its content.
> -----From zhangxh#mail.eastcomtd.com to sdlnews -----
>
> Hi,SDL experts!
> I use XOPTCHAN in the tight integration,but some errors ocurred,could you
> tell
> me "why"? and other question,does the switch XOPT can promote the
> efficiency?

It is difficult to indicate any reason why XOPTCHAN gives you errors
at compile-time without having any knowledge of the other compiler
directives you use in your system. I guess you use some sort of
combination of these compiler directives which are not "compatible",
e.g. defining XCONST=const, XOPTCHAN and XSIGLOG in combination,
perhaps ...? Check scttypes.h to verify which directives are implicitly
defined based on the directives you explicitely define.

The directive XOPT will probably promote the runtime efficiency a
little,
but most certainly the memory efficiency a lot since you avoid defining
the so-called xIdNodes for signal parameters (SIGPARA), variables (DCL),
formal parameters (FPAR), struct components (STRUCT), literals (LIT) and
newtypes/syntypes (SORT).

>
> And,could you tell me how to use the sort SDL_Time and the function
> SDL_Clock()?
> what should I do if I want to get time in SDT?

Independent on how your target platform is implemented, you have to
support some sort of timer functionality requried by the SDT Kernel on
target. SDL_Clock() requires the ability to return the time in seconds
and nanoseconds (from e.g. system startup) each time it is called.
Assuming that you have the possibility to extract the number of
milliseconds
since system startup, SDL_Clock() could be implemented as follows
(cut-and-paste from sctos.c):

##ifdef XCLOCK

##ifdef TC2
/* this is needed for TurboC v2.x */
##define CLOCKS_PER_SEC CLK_TCK
##endif

##ifdef PSOS_C
unsigned long Sys_Ticks = 0;
##endif

/*---+---------------------------------------------------------------
     SDL_Clock
-------------------------------------------------------------------*/
SDL_Time SDL_Clock XPP(( void ))
{
  SDL_Time time;

  time.s = (xint32)(getNoOfMsec () / 1000);
  time.ns = (xint32)((getNoOfMsec () % 1000) * 1000000);

  return (time);
}
##endif
       /* XCLOCK */

where getNoOfMsec() is supplied by you.

Regards, Eldor

-- 

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Eldor R�dseth, B.Eng MSE, | tel (work): +47 95086888 System Consultant, MD, | tel (priv): +47 66905188 SystemSoft AS, | fax : +47 66905122 Nedre H�n Terrasse 7, | e-mail: eldor#systemsoft.no N-1384 Asker -=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- At Ericsson (ETO) | tel: +47 66840621 | e-mail: etoxer#ericsson.no -=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

-----End text from "Eldor Roedseth (SystemSoft AS)" <etoxer#ericsson.no> to sdlnews ----- Join http://www.sdl-forum.org/Society/members.htm for extra SDL Forum Society benefits For help, email "majordomo#sdl-forum.org" with the body of your email as: help or (iff this does not answer your question) email: owner-sdlnews#sdl-forum.org



This archive was generated by hypermail 2a23 : Sun Jun 16 2013 - 10:41:41 GMT