|
|
@ -1,5 +1,4 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
|
|
|
* geigerzaehler.c
|
|
|
|
* geigerzaehler.c
|
|
|
|
*
|
|
|
|
*
|
|
|
|
=======
|
|
|
|
=======
|
|
|
@ -17,12 +16,9 @@
|
|
|
|
#include <avr/io.h>
|
|
|
|
#include <avr/io.h>
|
|
|
|
#include <avr/interrupt.h>
|
|
|
|
#include <avr/interrupt.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
|
|
|
=======
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Global variable declaration
|
|
|
|
// Global variable declaration
|
|
|
|
uint8_t
|
|
|
|
uint8_t test = 0;
|
|
|
|
>>>>>>> f39ee6c90de22ce1514bb4f9e7e3e3116efac22f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
int main()
|
|
|
@ -33,13 +29,11 @@ int main()
|
|
|
|
PORTD |= (1<<2); // Enable Pull Up Resistor Pin D2
|
|
|
|
PORTD |= (1<<2); // Enable Pull Up Resistor Pin D2
|
|
|
|
PORTD |= (1<<3); // Enable Pull Up Resistor Pin D3
|
|
|
|
PORTD |= (1<<3); // Enable Pull Up Resistor Pin D3
|
|
|
|
|
|
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
|
|
|
EICRA |= (1 << ISC11)|(1 << ISC10); // Only at raising edge
|
|
|
|
EICRA |= (1 << ISC11)|(1 << ISC10); // Only at raising edge
|
|
|
|
EIMSK |= (1 << INT1); // Activate Interrupt INT0
|
|
|
|
EIMSK |= (1 << INT1); // Activate Interrupt INT0
|
|
|
|
|
|
|
|
|
|
|
|
EICRA |= (1 << ISC00); // Only at falling edge
|
|
|
|
EICRA |= (1 << ISC00); // Only at falling edge
|
|
|
|
EIMSK |= (1 << INT0); // Activate Interrupt INT1
|
|
|
|
EIMSK |= (1 << INT0); // Activate Interrupt INT1
|
|
|
|
=======
|
|
|
|
|
|
|
|
// Interrupt for INT0 Pin-D2 High-voltage check
|
|
|
|
// Interrupt for INT0 Pin-D2 High-voltage check
|
|
|
|
EICRA |= (1 << ISC01)|(0 << ISC00); // Only at falling edge [1|0]
|
|
|
|
EICRA |= (1 << ISC01)|(0 << ISC00); // Only at falling edge [1|0]
|
|
|
|
EIMSK |= (1 << INT0); // Activate Interrupt INT0
|
|
|
|
EIMSK |= (1 << INT0); // Activate Interrupt INT0
|
|
|
@ -47,7 +41,6 @@ int main()
|
|
|
|
// Interrupt for INT1 Pin-D3 Counter-click
|
|
|
|
// Interrupt for INT1 Pin-D3 Counter-click
|
|
|
|
EICRA |= (1 << ISC11)|(1 << ISC10); // Only at rising edge [1|1]
|
|
|
|
EICRA |= (1 << ISC11)|(1 << ISC10); // Only at rising edge [1|1]
|
|
|
|
EIMSK |= (1 <<INT1); // Activate Interrupt INT1
|
|
|
|
EIMSK |= (1 <<INT1); // Activate Interrupt INT1
|
|
|
|
>>>>>>> f39ee6c90de22ce1514bb4f9e7e3e3116efac22f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sei(); // Activate global interrupts
|
|
|
|
sei(); // Activate global interrupts
|
|
|
|
|
|
|
|
|
|
|
@ -64,22 +57,13 @@ int main()
|
|
|
|
// Address: 0x001 INT0
|
|
|
|
// Address: 0x001 INT0
|
|
|
|
ISR(INT0_vect)
|
|
|
|
ISR(INT0_vect)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
|
|
|
reti();
|
|
|
|
|
|
|
|
=======
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reti(); // Exit interrupt-handler
|
|
|
|
reti(); // Exit interrupt-handler
|
|
|
|
>>>>>>> f39ee6c90de22ce1514bb4f9e7e3e3116efac22f
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ISR(INT1_vect)
|
|
|
|
ISR(INT1_vect)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
|
|
|
reti();
|
|
|
|
|
|
|
|
=======
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reti(); // Exit interrupt-handler
|
|
|
|
reti(); // Exit interrupt-handler
|
|
|
|
>>>>>>> f39ee6c90de22ce1514bb4f9e7e3e3116efac22f
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
1
|
|
|
|
|