Skip to content

Commit

Permalink
* Fix get/set request on Windows 10.
Browse files Browse the repository at this point in the history
 * Rebuild Windows minichlink exe.
  • Loading branch information
cnlohr committed Mar 5, 2025
1 parent a0f6afd commit 09098da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Binary file modified minichlink/minichlink.exe
Binary file not shown.
12 changes: 9 additions & 3 deletions minichlink/pgm-esp32s2-ch32xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

#define DETAILED_DEBUG 0

#if defined( WIN32 ) || defined( _WIN32 )
#define WIN32ADD1 1
#else
#define WIN32ADD1 0
#endif

struct ESP32ProgrammerStruct
{
void * internal;
Expand Down Expand Up @@ -234,7 +240,7 @@ int ESPFlushLLCommands( void * dev )
printf("\n" );
#endif

r = hid_send_feature_report( eps->hd, eps->commandbuffer, eps->commandbuffersize );
r = hid_send_feature_report( eps->hd, eps->commandbuffer, eps->commandbuffersize+WIN32ADD1 );
eps->commandplace = 1;
if( r < 0 )
{
Expand All @@ -243,7 +249,7 @@ int ESPFlushLLCommands( void * dev )
}
retry:
eps->reply[0] = 0xad; // Key report ID
r = hid_get_feature_report( eps->hd, eps->reply, eps->replysize );
r = hid_get_feature_report( eps->hd, eps->reply, eps->replysize+WIN32ADD1 );
#if DETAILED_DEBUG
printf( "RESP: %d %d", (int)r, (int)eps->reply[0] );
for( int i = 0; i < eps->reply[0]; i++ )
Expand All @@ -258,7 +264,7 @@ int ESPFlushLLCommands( void * dev )
//printf( ">:::%d: %02x %02x %02x %02x %02x %02x\n", eps->replylen, eps->reply[0], eps->reply[1], eps->reply[2], eps->reply[3], eps->reply[4], eps->reply[5] );
if( r < 0 )
{
fprintf( stderr, "Error: Got error %d when sending hid feature report.\n", r );
fprintf( stderr, "Error: Got error %d when getting hid feature report. (Size %d/%d)\n", r, eps->commandbuffersize, eps->replysize );
return r;
}
eps->replylen = eps->reply[0] + 1; // Include the header byte.
Expand Down

0 comments on commit 09098da

Please sign in to comment.