Defines | |
#define | NEAR_TICK |
#define | TICK_COUNTER_HIGH ((TICK_COUNTER_RELOAD >> 8) & 0xff) |
#define | TICK_COUNTER_LOW (TICK_COUNTER_RELOAD & 0xff) |
#define | TICK_COUNTER_RELOAD (65536 - (WORD)(((CLOCK_FREQ/4)/TICKS_PER_SECOND)/4) ) |
#define | TICK_SECOND ((TICK)TICKS_PER_SECOND) |
#define | TickGet() tickCount |
#define | TickGet16bit() ((WORD)tickCount) |
#define | TickGet8bit() ((BYTE)tickCount) |
#define | TickGet8bitSec() ((BYTE)tickSec) |
#define | TickGetDiff(t) ((TICK)(tickCount - ((TICK)t) )) |
#define | TickGetDiff16bit(t) ((TICK16)( ((TICK16)tickCount) - ((TICK16)t) )) |
#define | TickGetDiff8bit(t) ((TICK8)( ((TICK8)tickCount) - ((TICK8)t) )) |
#define | TickGetDiff8bitSec(t) ((TICK8)( ((TICK8)tickSec) - ((TICK8)t) )) |
#define | TickGetDiffSec(t) ((TICK16)( ((TICK16)tickSec) - ((TICK16)t) )) |
#define | TickGetSec() tickSec |
#define | TickGetSecDiff(t) ((TICK16)( ((TICK16)tickSec) - ((TICK16)t) )) |
#define | TICKS_PER_SECOND (100ul) |
#define | TickUpdate() |
Typedefs | |
typedef unsigned long | TICK |
typedef unsigned short | TICK16 |
typedef unsigned long | TICK32 |
typedef unsigned char | TICK8 |
Functions | |
void | TickInit (void) |
Variables | |
NEAR_TICK TICK | tickCount |
NEAR_TICK unsigned char | tickHelper |
NEAR_TICK TICK16 | tickSec |
#define NEAR_TICK |
Only Tick.c defines TICK_INCLUDE and thus defines Seconds and TickValue storage.
#define TICK_COUNTER_HIGH ((TICK_COUNTER_RELOAD >> 8) & 0xff) |
#define TICK_COUNTER_LOW (TICK_COUNTER_RELOAD & 0xff) |
#define TICK_COUNTER_RELOAD (65536 - (WORD)(((CLOCK_FREQ/4)/TICKS_PER_SECOND)/4) ) |
#define TICK_SECOND ((TICK)TICKS_PER_SECOND) |
Defines the number of ticks per second
#define TickGet | ( | ) | tickCount |
Get the current 32 bit tick value. The given tick is incremented every 10ms Has 32 Bits, range of 0 - 2^32 = 11930 hours = 497 days
Get the current 16 bit tick value. The given tick is incremented every 10ms Has 16 Bits, range of 0 - 65535 = 65535 x 10ms = 655 seconds = 10.9 minutes
Get the current 8 bit tick value. The given tick is incremented every 10ms. Has 8 Bits, range of 0 - 255 = 255 x 10ms = 2.55 seconds
Get the current 8 bit second tick value. The given tick is incremented every 1 second Has 8 Bits, range of 0 - 255 seconds
Returns the difference between the given value and the current 32 bit tick value Has 32 Bits, range of 0 - 2^32 = 11930 hours = 497 days
Returns the difference between the given value and the current 16 bit tick value. Has 16 Bits, range of 0 - 65535 = 65535 x 10ms = 655 seconds = 10.9 minutes
Returns the difference between the given value and the current 8 bit tick value Has 8 Bits, range of 0 - 255 = 255 x 10ms = 2.55 seconds
Returns the difference between the given value and the current 8 bit second tick value. Has 8 Bits, range of 0 - 255 seconds
Returns the difference between the given value and the current 16 bit second counter. Has 16 Bits, range of 0 - 65,536 seconds = 0 to 18.2 hours
#define TickGetSec | ( | ) | tickSec |
Get the current 16 bit second tick value. The given tick is incremented every 1 second. Has 16 Bits, range of 0 - 65,536 seconds = 0 to 18.2 hours
Returns the difference between the given value and the current 16 bit second counter. Has 16 Bits, range of 0 - 65,536 seconds = 0 to 18.2 hours
#define TICKS_PER_SECOND (100ul) |
#define TickUpdate | ( | ) |
Value:
{ \ TMR0H = TICK_COUNTER_HIGH; \ TMR0L = TICK_COUNTER_LOW; \ tickCount++; \ if (--tickHelper == 0) { \ tickHelper = TICKS_PER_SECOND; \ tickSec++; \ } \ }
typedef unsigned short TICK16 |
typedef unsigned long TICK32 |
typedef unsigned char TICK8 |
void TickInit | ( | void | ) |
Tick manager is initialized. Initializes Timer0 as a tick counter.
NEAR_TICK unsigned char tickHelper |