Subversion Repositories HomeAutomation

Rev

Rev 73 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. /*********************************************************************
  2.  *
  3.  *                  Ticker header file
  4.  *
  5.  *********************************************************************
  6.  * FileName:        $HeadURL: https://svn.auml.se/svn/HomeAutomation/trunk/EmbeddedSoftware/PIC/canToSerial/Include/Tick.h $
  7.  * Last changed:    $LastChangedDate: 2006-11-14 21:22:17 +0100 (Tue, 14 Nov 2006) $
  8.  * By:              $LastChangedBy: johboh $
  9.  * Revision:        $Revision: 97 $
  10.  ********************************************************************/
  11.  
  12. #ifndef TICK_H
  13. #define TICK_H
  14.  
  15. #include <stackTasks.h>
  16.  
  17. typedef unsigned long TICK;
  18.  
  19. #if !defined(TICKS_PER_SECOND)
  20.     #error TICKS_PER_SECOND must be defined.
  21. #endif
  22.  
  23. #if !defined(TICK_PRESCALE_VALUE)
  24.     #error TICK_PRESCALE_VALUE must be defined.
  25. #endif
  26.  
  27. #define TICK_PERIOD_MS          10
  28. #define TICK_SECOND             ((TICK)TICKS_PER_SECOND)
  29.  
  30.  
  31. /*
  32.  * Only Tick.c defines TICK_INCLUDE and thus defines Seconds
  33.  * and TickValue storage.
  34.  */
  35. #ifndef TICK_INCLUDE
  36. extern TICK TickCount;
  37. #endif
  38.  
  39. void tickInit(void);
  40. TICK tickGet(void);
  41. void tickUpdate(void);
  42.  
  43. #endif
  44.