Thread: Timer Application Interface

  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    347

    Timer Application Interface

    It is a micro controller based application. I am writing a driver for 1ms now i want to give to application an interface such that he can use it for example if he wants to call a particular task every 10ms using this interface. Could you please suggest me how to implement this interface? Thanks in advance.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Perhaps an interface like
    Code:
    // Register fn(data) to be called at period intervals
    // returns a timer ID (or error)
    int addTimer( int period, void (*fn)(void*), void *data );
    
    // Removes a previously registered timer.
    void delTimer( int id );
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 05-18-2012, 04:20 AM
  2. Replies: 5
    Last Post: 11-08-2008, 04:48 PM
  3. Adding interface to Win32 console application
    By motiz in forum Windows Programming
    Replies: 5
    Last Post: 01-03-2008, 03:17 AM
  4. interface, implementation, & application files
    By trongsi in forum C++ Programming
    Replies: 4
    Last Post: 04-08-2006, 02:11 PM
  5. application console interface
    By Laurie8 in forum Windows Programming
    Replies: 4
    Last Post: 11-30-2005, 01:34 PM

Tags for this Thread