CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

timer and Flash

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
cindy
Guest







timer and Flash
PostPosted: Sat Jan 03, 2009 10:41 pm     Reply with quote

..........

Quote:
#define WAITKEY_TIMEOUT 75 /* at 15/second */
#define RESET_KBD_COUNT 75 /* at 15/second */

#use delay ( clock = 4000000, restart_wdt ) /* sets appropriate compiler constants */
#use fast_io ( A ) /* don't set TRIS on each I/O statement */
#use fast_io ( B )
#zero_ram

/* initialize EEPROM */
#rom 0x2100 = {
1, 2 , 3, 4, 5, 6, /* master combo (6) */
1, 5, ACTIVE, /* lamp time seconds (2) & ACTIVE flag (1) */
0, 1, ACTIVE /* lock time seconds (2) & ACTIVE flag (1) */
}
..............
void StartOpenLock ( char cCnt );
void StartLampTimer ( char cCnt );

void Flash ( void );

static long iLampCount, iLampLimit, iLockCount, iLockLimit;

static char cProgMode, cProgTimeoutCount, cResetKbdCount;

void main ( void )
{
...................
setup_counters ( RTCC_INTERNAL, RTCC_DIV_256 ); /* 65mS roll */
enable_interrupts ( INT_RTCC ); /* turn on timer interrupt */
enable_interrupts ( GLOBAL ); /* enable interrupts */


......................

#int_rtcc
void TimerInterrupt ( void ) /* 65mS tic */
{
if ( cProgMode == YES ) /* if in program mode */
{
if ( cProgTimeoutCount++ >= 8 )
{
ILL_OUT ^= 1; /* toggle lamp state */
cProgTimeoutCount = 0;
}
}
else /* if in normal mode */
{
if ( iLampCount++ > iLampLimit ) /* if timeout yet */
{
ILL_OUT = OFF; /* turn lamp off */
}
if ( cResetKbdCount++ > RESET_KBD_COUNT )
{
cKeyCnt = 0; /* reset to first key */
}

}

=============================================

- void Flash ( void );
What is the purpsose?


- if ( cProgTimeoutCount++ >= 8 )

What is the "8" mean in this sentence?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jan 03, 2009 10:54 pm     Reply with quote

You got that code from here:
http://www.vermontficks.org/combo2c.htm
Please email Jon Fick and ask him about his code.
http://www.vermontficks.org/
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group