Skip to content

Commit

Permalink
Merge pull request #847 from miek/sweepfix
Browse files Browse the repository at this point in the history
Disable USB interrupts during sweep set_freq call
  • Loading branch information
mossmann authored Mar 17, 2021
2 parents f202160 + 1cb2abf commit b112d18
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions firmware/hackrf_usb/usb_api_sweep.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include "usb_endpoint.h"
#include "streaming.h"

#include <libopencm3/lpc43xx/m4/nvic.h>

#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)>(y)?(x):(y))
#define FREQ_GRANULARITY 1000000
Expand Down Expand Up @@ -155,7 +157,10 @@ void sweep_mode(void) {
sweep_freq += step_width;
}
}

nvic_disable_irq(NVIC_USB0_IRQ);
set_freq(sweep_freq + offset);
nvic_enable_irq(NVIC_USB0_IRQ);
blocks_queued = 0;
}
}
Expand Down

0 comments on commit b112d18

Please sign in to comment.