You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (avr_regbit_get(avr, p->spe)) {
// in master mode, any byte is sent as it comes..
if (avr_regbit_get(avr, p->mstr)) {
avr_raise_interrupt(avr, &p->spi);
avr_raise_irq(p->io.irq + SPI_IRQ_OUTPUT, avr->data[p->r_spdr]);
}
// in slave mode, bytes are sent but no interrupt is raised
// TODO check for state of SS line??
else {
avr_raise_irq(p->io.irq + SPI_IRQ_OUTPUT, avr->data[p->r_spdr]);
}
}
return 0;
}
The text was updated successfully, but these errors were encountered:
Good catch -- to be fair I've haven't had to use spi slave in a long time, so that probably had been left as 'an exercise to the reader' ;-)
Please PR, even if it's not all polished, as long as you are happy it works...
I found that IRQ is not raised when simulating firmware operating as a SPI slave.
PR is WIP to see if there is anything else that needs to be done but here is a quick fix.
static avr_cycle_count_t avr_spi_raise(struct avr_t * avr, avr_cycle_count_t when, void * param)
{
avr_spi_t * p = (avr_spi_t *)param;
}
The text was updated successfully, but these errors were encountered: