2013-01-17 13:06:51 +01:00
|
|
|
/*
|
|
|
|
interrupt.h - replacement for the avr include of the same name to provide
|
|
|
|
dummy register variables and macros
|
|
|
|
|
|
|
|
Part of Grbl Simulator
|
|
|
|
|
|
|
|
Copyright (c) 2012 Jens Geisler
|
|
|
|
|
|
|
|
Grbl is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Grbl is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef interrupt_h
|
|
|
|
#define interrupt_h
|
|
|
|
|
|
|
|
// macros to turn avr interrupts into regular functions
|
2014-07-04 17:14:54 +02:00
|
|
|
//#define TIMER1_COMPA_vect
|
2013-01-17 13:06:51 +01:00
|
|
|
#define ISR(a) void interrupt_ ## a ()
|
|
|
|
|
2014-07-10 19:01:03 +02:00
|
|
|
// Stubs of the hardware interrupt functions we are using
|
2014-07-04 17:14:54 +02:00
|
|
|
void interrupt_TIMER0_COMPA_vect();
|
|
|
|
void interrupt_TIMER1_COMPA_vect();
|
|
|
|
void interrupt_TIMER0_OVF_vect();
|
|
|
|
void interrupt_SERIAL_UDRE();
|
|
|
|
void interrupt_SERIAL_RX();
|
2014-07-10 19:01:03 +02:00
|
|
|
void interrupt_LIMIT_INT_vect();
|
|
|
|
void interrupt_WDT_vect();
|
2014-07-04 17:14:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
//pseudo-Interrupt vector table
|
|
|
|
typedef void(*isr_fp)(void);
|
|
|
|
extern isr_fp compa_vect[6];
|
|
|
|
extern isr_fp compb_vect[6];
|
|
|
|
extern isr_fp ovf_vect[6];
|
2014-07-10 19:01:03 +02:00
|
|
|
extern isr_fp wdt_vect;
|
|
|
|
extern isr_fp pc_vect; //pin change
|
2014-07-04 17:14:54 +02:00
|
|
|
|
|
|
|
// enable interrupts now does something in the simulation environment
|
|
|
|
#define SEI 0x80
|
2013-01-17 13:06:51 +01:00
|
|
|
void sei();
|
2013-02-20 14:56:47 +01:00
|
|
|
void cli();
|
2013-01-17 13:06:51 +01:00
|
|
|
|
2014-07-04 17:14:54 +02:00
|
|
|
//simulate timer operation
|
|
|
|
void timer_interrupts();
|
|
|
|
|
|
|
|
|
2013-01-17 13:06:51 +01:00
|
|
|
#endif
|