#include "ac_input.h"
static avr_cycle_count_t
-switch_auto(struct avr_t * avr,
- avr_cycle_count_t when, void * param)
+switch_auto(
+ struct avr_t * avr,
+ avr_cycle_count_t when,
+ void * param)
{
ac_input_t * b = (ac_input_t *) param;
b->value = !b->value;
return when + avr_usec_to_cycles(avr, 100000 / 50);
}
+static const char * name = ">ac_input";
+
void ac_input_init(avr_t *avr, ac_input_t *b)
{
- const char * name = ">ac_input";
b->irq = avr_alloc_irq(&avr->irq_pool, 0, IRQ_AC_COUNT, &name);
b->avr = avr;
b->value = 0;
z &= ~1;
printf("Writing page %04x (%d)\n", (z / p->spm_pagesize), p->spm_pagesize);
} else if (avr_regbit_get(avr, p->blbset)) {
- printf("Settting lock bits (ignored)\n");
+ printf("Setting lock bits (ignored)\n");
} else {
z &= ~1;
avr->flash[z++] = r01;
avr_register_vector(avr, &p->flash);
avr_register_io_write(avr, p->r_spm, avr_flash_write, p);
-// avr_register_io_read(avr, p->r_spm, avr_flash_read, p);
}