Skip to content

Commit

Permalink
floppy: Report in the log when WGATE glitch filter is triggered.
Browse files Browse the repository at this point in the history
  • Loading branch information
keirf committed Jan 17, 2018
1 parent f0e6b53 commit c0fe6d3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,22 @@ static void wdata_start(void)
{
uint32_t start_pos;

if (dma_wr->state != DMA_inactive) {
switch (dma_wr->state) {
case DMA_starting:
case DMA_active:
/* Already active: ignore WGATE glitch. */
printk("*** WGATE glitch\n");
return;
case DMA_stopping:
/* We are still processing the previous write and so we lose this new
* write. Complain to the log. */
printk("*** Missed write\n");
return;
case DMA_inactive:
/* The write path is quiescent and ready to process this new write. */
break;
}

dma_wr->state = DMA_starting;

/* Start DMA to circular buffer. */
Expand Down

0 comments on commit c0fe6d3

Please sign in to comment.