View Single Post
  #40   Spotlight this post!  
Unread 31-12-2004, 18:31
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: encoder vs. motor

Stephen,


Quote:
Originally Posted by stephenthe1
1: what is "#pragma"
A pragma tells the C pre-processor that what follows is a special note telling it to do something non-C language related. In this case, it tells the pre-processor (and later the linker) that you want this specific piece of code placed in a special place in memory reserved for interrupt service routines.


Quote:
Originally Posted by stephenthe1
2: what is the purpose of putting the "#" symbol in front of it
This just indicates that this is a message for the C compiler pre-processor. Other examples are #include and #ifdef.


Quote:
Originally Posted by stephenthe1
3: what are _asm and _endasm
This tells the C compiler that you want to insert raw assembly language within a C source file. In this case, we're just putting a jump instruction to the interrupt handler at the special location in memory where the CPU starts execution in response to an interrupt condition.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org