avr_vcd_init(avr, "gtkwave_output.vcd", &vcd_file, 10000 /* usec */);
avr_vcd_add_signal(&vcd_file,
- avr_get_interupt_irq(avr, 7), 1 /* bit */ ,
+ avr_get_interrupt_irq(avr, 7), 1 /* bit */ ,
"TIMER2_COMPA" );
avr_vcd_add_signal(&vcd_file,
- avr_get_interupt_irq(avr, 17), 1 /* bit */ ,
+ avr_get_interrupt_irq(avr, 17), 1 /* bit */ ,
"SPI_INT" );
avr_vcd_add_signal(&vcd_file,
i_mosi, 8 /* bits */ ,
/*
avr_extint.h
- External Interupt Handling (for INT0-3)
+ External Interrupt Handling (for INT0-3)
Copyright 2008, 2009 Michel Pollet <buserror@gmail.com>
avr_core_watch_write(avr, addr, v);
// clear any interrupts & flags
- avr_clear_interupt_if(avr, &p->overflow, ov);
- avr_clear_interupt_if(avr, &p->icr, ic);
+ avr_clear_interrupt_if(avr, &p->overflow, ov);
+ avr_clear_interrupt_if(avr, &p->icr, ic);
for (int compi = 0; compi < AVR_TIMER_COMP_COUNT; compi++)
- avr_clear_interupt_if(avr, &p->comp[compi].interrupt, cp[compi]);
+ avr_clear_interrupt_if(avr, &p->comp[compi].interrupt, cp[compi]);
}
static void avr_timer_irq_icp(struct avr_irq_t * irq, uint32_t value, void * param)
if (!twen)
return;
- int cleared = avr_clear_interupt_if(avr, &p->twi, twint);
+ int cleared = avr_clear_interrupt_if(avr, &p->twi, twint);
// clear the interrupt if this bit is now written to 1
if (cleared) {
{
avr_uart_t * p = (avr_uart_t *)param;
if (avr_regbit_get(avr, p->txen)) {
- // if the interrupts are not used, still raised the UDRE and TXC flag
+ // if the interrupts are not used, still raise the UDRE and TXC flag
avr_raise_interrupt(avr, &p->udrc);
avr_raise_interrupt(avr, &p->txc);
}
}
if (addr == p->udrc.enable.reg) {
/*
- * If enabling the UDRC interupt, raise it immediately if FIFO is empty
+ * If enabling the UDRC interrupt, raise it immediately if FIFO is empty
*/
uint8_t udrce = avr_regbit_get(avr, p->udrc.enable);
avr_core_watch_write(avr, addr, v);
uint8_t nudrce = avr_regbit_get(avr, p->udrc.enable);
if (!udrce && nudrce) {
- // if the FIDO is not empty (clear timer is flying) we dont
- // need to raise the interupt, it will happend when the timer
+ // if the FIDO is not empty (clear timer is flying) we don't
+ // need to raise the interrupt, it will happen when the timer
// is fired.
if (avr_cycle_timer_status(avr, avr_uart_txc_raise, p) == 0)
avr_raise_interrupt(avr, &p->udrc);
uint8_t txc = avr_regbit_get(avr, p->txc.raised);
// no need to write this value in here, only the
- // interupt flags needs clearing!
+ // interrupt flags need clearing!
// avr_core_watch_write(avr, addr, v);
- //avr_clear_interupt_if(avr, &p->udrc, udre);
- avr_clear_interupt_if(avr, &p->txc, txc);
+ //avr_clear_interrupt_if(avr, &p->udrc, udre);
+ avr_clear_interrupt_if(avr, &p->txc, txc);
}
}
avr_regbit_clear(avr, vector->raised);
}
-int avr_clear_interupt_if(avr_t * avr, avr_int_vector_t * vector, uint8_t old)
+int avr_clear_interrupt_if(avr_t * avr, avr_int_vector_t * vector, uint8_t old)
{
if (avr_regbit_get(avr, vector->raised)) {
avr_clear_interrupt(avr, vector->vector);
return 0;
}
-avr_irq_t * avr_get_interupt_irq(avr_t * avr, uint8_t v)
+avr_irq_t * avr_get_interrupt_irq(avr_t * avr, uint8_t v)
{
avr_int_vector_t * vector = avr->vector[v];
return vector ? &vector->irq : NULL;
int bit = ffs(map)-1;
int v = (bi * 32) + bit; // vector
avr_int_vector_t * vector = avr->vector[v];
- // if that single interupt is masked, ignore it and continue
+ // if that single interrupt is masked, ignore it and continue
if (vector && !avr_regbit_get(avr, vector->enable)) {
map &= ~(1 << bit);
continue;
along with simavr. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __SIM_INTERUPTS_H__
-#define __SIM_INTERUPTS_H__
+#ifndef __SIM_INTERRUPTS_H__
+#define __SIM_INTERRUPTS_H__
#include "sim_avr.h"
#include "sim_irq.h"
void avr_service_interrupts(avr_t * avr);
// clear the interrupt (inc pending) if "raised" flag is 1
-int avr_clear_interupt_if(avr_t * avr, avr_int_vector_t * vector, uint8_t old);
+int avr_clear_interrupt_if(avr_t * avr, avr_int_vector_t * vector, uint8_t old);
// return the IRQ that is raised when the vector is enabled and called/cleared
-// this allows tracing of pending interupts
-avr_irq_t * avr_get_interupt_irq(avr_t * avr, uint8_t v);
+// this allows tracing of pending interrupts
+avr_irq_t * avr_get_interrupt_irq(avr_t * avr, uint8_t v);
#ifdef __cplusplus
};
#endif
-#endif /* __SIM_INTERUPTS_H__ */
+#endif /* __SIM_INTERRUPTS_H__ */