Skip to content

Commit

Permalink
Merge pull request #462 from monte-monte/master
Browse files Browse the repository at this point in the history
Deal with 'Issue with hid_send_feature_report' errors on linux
  • Loading branch information
cnlohr authored Dec 2, 2024
2 parents 82b50c6 + 0787741 commit 9bba69e
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions minichlink/pgm-b003fun.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,16 @@ static int CommitOp( struct B003FunProgrammerStruct * eps )
#endif
if( r < 0 )
{
fprintf( stderr, "Warning: Issue with hid_send_feature_report. Retrying: %d\n", retries );
if( retries ) fprintf( stderr, "Warning: Issue with hid_send_feature_report. Retrying: %d\n", retries );
if( retries++ > 10 )
{
return r;
}
else
{
MCF.DelayUS( eps, 5000 );
goto resend;
}
}

if (eps->no_get_report) return r;
Expand Down Expand Up @@ -219,11 +224,11 @@ static int B003FunWaitForDoneOp( void * dev, int ignore )
return 0;
}

static int B003FunDelayUS( void * dev, int microseconds )
{
usleep( microseconds );
return 0;
}
// static int B003FunDelayUS( void * dev, int microseconds )
// {
// usleep( microseconds );
// return 0;
// }

// Does not handle erasing
static int InternalB003FunWriteBinaryBlob( void * dev, uint32_t address_to_write_to, uint32_t write_size, const uint8_t * blob )
Expand Down Expand Up @@ -557,7 +562,7 @@ void * TryInit_B003Fun()
MCF.WriteReg32 = 0;
MCF.ReadReg32 = 0;
MCF.FlushLLCommands = B003FunFlushLLCommands;
MCF.DelayUS = B003FunDelayUS;
// MCF.DelayUS = B003FunDelayUS;
MCF.Control3v3 = 0;
MCF.SetupInterface = B003FunSetupInterface;
MCF.Exit = B003FunExit;
Expand Down

0 comments on commit 9bba69e

Please sign in to comment.