InterruptVectors.c File Reference

#include "SensorOnlyMode.h"
#include "FeedbackSensor.h"
#include "global.h"
#include <avr/interrupt.h>
#include <avr/signal.h>
Include dependency graph for InterruptVectors.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 SIGNAL (SIG_INTERRUPT0)

Variables

Smartbuffer interruptbuff
int softwareMode
volatile int wheel1 = 0
volatile int wheel2 = 0

Function Documentation

SIGNAL ( SIG_INTERRUPT0   ) 

Interrupt-Service-Routine (ISR) for incremental encoder on INT0

Definition at line 14 of file InterruptVectors.c.

References SENSOR_MODE, softwareMode, and wheel1.

00014                        {
00015 
00016      cli();
00017 
00018      register unsigned char pd = PIND;
00019 
00020      if (( (pd & (1<<PIND6))>=1  &&  (pd & (1<<PIND2))==0 ) ||
00021          ( (pd & (1<<PIND6))==0  &&  (pd & (1<<PIND2))>=1 ) 
00022      ) {
00023           if (softwareMode == SENSOR_MODE) {
00024                wheel1++;
00025           } else if (wheel1 < 127) { // only a char-byte will be saved in memory
00026                wheel1++;
00027           }
00028 
00029      } else {  
00030           if (softwareMode == SENSOR_MODE) {
00031                wheel1--;
00032           } else if (wheel1 > -127) { // only a char-byte will be saved in memory
00033                wheel1--;
00034           }    
00035      }
00036 
00037      sei();
00038 }


Variable Documentation

Definition at line 100 of file SensorOnlyMode.c.

Definition at line 8 of file main.c.

Referenced by main(), and SIGNAL().

volatile int wheel1 = 0

globals for ISR

Definition at line 6 of file InterruptVectors.c.

volatile int wheel2 = 0

Definition at line 7 of file InterruptVectors.c.

Generated on Fri Oct 8 17:10:09 2010 for Crawling Robot Microcontroller Software by  doxygen 1.6.3