Thread: Delay until answer?

  1. #1
    Plasma
    Guest

    Question Delay until answer?

    Hi!
    I'm making a program to run a LCD Display with a HD61830 controller.
    I've got some C Sourcecode which helps some, but it uses something I don't quite understand:

    Code:
    /***************************************************
    * wait till HD61830 is not busy
    *************************************************/
    void lcgwait(void)
    {
    	char busy;
    
    	_outp(PORTB,LCGCMD|LCGRD|LCGDIS);
    	do{
    		_outp(PORTB,LCGCMD|LCGRD|LCGEN);
    		delay(EDELY);
    		busy=_inp(PORTA)&0x80;
    		_outp(PORTB,LCGCMD|LCGRD|LCGDIS);
    		delay(EDELY);
    	}while(busy);
    }
    Notice the "delay(EDELY);" ? what is EDELY? I could possibly replace it with sleep(), but it hasn't got any time! Is it "wait for answer" or something?
    I appreciate any help on this

    Cheers!

  2. #2
    Plasma
    Guest
    And I forgot to mention, the compiler gives me a "error C2065: 'delay' : undeclared identifier"

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    delay isnt standard or a part of the Windows API (well as far as I know...)

    I think it may be implemented under conio.h on an old compiler....

    As for EDELY...that may be a user defined constant or provided with that implementation of delay().....either way its difficult to know without knowing the compiler used with this code

  4. #4
    Plasma
    Guest
    I don't know what compiler is used with the original code, I downloaded it from http://panda.bg.univ.gda.pl/~janusz/software.html#lcg .

  5. #5
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Originally posted by Plasma
    I don't know what compiler is used with the original code, I downloaded it from http://panda.bg.univ.gda.pl/~janusz/software.html#lcg .
    Looking at the site, he seems to have his own compiler for download - http://panda.bg.univ.gda.pl/~janusz/...e.html#mediumc - So I imagine it might use that

  6. #6
    Plasma
    Guest

    Thumbs up

    Oh

  7. #7
    Plasma
    Guest

    Thumbs up

    Oh!
    I didn't read through the whole site. Gotta find a way to incorporate his code into MS Visual C++, then.

    I'm going to make a nice GUI for it too, so I don't fancy starting to learn a new flavour of c++

    Thanks for the help anyways. If anyone has a way to incorporate this into a C++ project I would appreciate your feedback ASAP


    Regards Thomas

  8. #8
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Originally posted by Plasma
    Oh!
    I didn't read through the whole site. Gotta find a way to incorporate his code into MS Visual C++, then.

    I'm going to make a nice GUI for it too, so I don't fancy starting to learn a new flavour of c++

    Thanks for the help anyways. If anyone has a way to incorporate this into a C++ project I would appreciate your feedback ASAP


    Regards Thomas
    Well....the _outp and _inp functions are still available in VC++'s version of conio.h......

    As for those constants (IE - LCGCMD), either the code you have, or the headers in that guy's compiler will show you what they mean...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Looking for constructive criticism
    By wd_kendrick in forum C Programming
    Replies: 16
    Last Post: 05-28-2008, 09:42 AM
  2. temperature sensors
    By danko in forum C Programming
    Replies: 22
    Last Post: 07-10-2007, 07:26 PM
  3. One quick question...
    By Kross7 in forum C++ Programming
    Replies: 10
    Last Post: 04-13-2007, 09:50 PM
  4. Tic Tac Toe program...
    By Kross7 in forum C++ Programming
    Replies: 12
    Last Post: 04-12-2007, 03:25 PM
  5. code help :)
    By Unregistered in forum C Programming
    Replies: 4
    Last Post: 02-28-2002, 01:12 PM