#include "SensorOnlyMode.h"
#include "global.h"
#include <avr/interrupt.h>
#include <avr/signal.h>
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 |
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 }
Definition at line 100 of file SensorOnlyMode.c.
int softwareMode |
volatile int wheel1 = 0 |
globals for ISR
Definition at line 6 of file InterruptVectors.c.
Referenced by FeedbackSensor::enableSensor(), FeedbackSensor::FeedbackSensor(), FeedbackSensor::getFeedback(), and SIGNAL().
volatile int wheel2 = 0 |
Definition at line 7 of file InterruptVectors.c.
Referenced by FeedbackSensor::enableSensor(), FeedbackSensor::FeedbackSensor(), and FeedbackSensor::getFeedback().