In a lab I use atmega2560 (arduino mega), I need to trigger an interrupt when the comparator detects a voltage change.
I use 0.4.15-SR9 and I have tried to add it in ./src/simavr/cores/sim_mega2560.c in this way :
and it seems to work fine !
I use 0.4.15-SR9 and I have tried to add it in ./src/simavr/cores/sim_mega2560.c in this way :
- Code:
void m2560_init(struct avr_t * avr)
{
struct mcu_t * mcu = (struct mcu_t*)avr;
avr_eeprom_init(avr, &mcu->eeprom);
/* ... */
avr_uart_init(avr, &mcu->uart3);
avr_acomp_init(avr, &mcu->acomp); // try
avr_adc_init(avr, &mcu->adc);
/* ... */
and it seems to work fine !