Skip to content

Commit

Permalink
Added check for zero freq in SetClock
Browse files Browse the repository at this point in the history
  • Loading branch information
devttys0 committed Oct 11, 2014
1 parent c9f3b61 commit c13df34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mpsse.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ int SetClock(struct mpsse_context *mpsse, uint32_t freq)
unsigned char buf[CMD_SIZE] = { 0 };

/* Do not call is_valid_context() here, as the FTDI chip may not be completely configured when SetClock is called */
if(mpsse)
if(mpsse && freq)
{
divisor_sixty = freq2div(SIXTY_MHZ, freq);
divisor_twelve = freq2div(TWELVE_MHZ, freq);
Expand Down

0 comments on commit c13df34

Please sign in to comment.