Skip to content
Snippets Groups Projects
Commit dccab942 authored by Alexander Mandera's avatar Alexander Mandera
Browse files

Change DMI OP checks

parent 28ccdcd8
No related branches found
No related tags found
No related merge requests found
...@@ -175,7 +175,7 @@ int LEWriteReg32( void * dev, uint8_t reg_7_bit, uint32_t command ) ...@@ -175,7 +175,7 @@ int LEWriteReg32( void * dev, uint8_t reg_7_bit, uint32_t command )
uint8_t resp[128]; uint8_t resp[128];
int resplen; int resplen;
wch_link_command( devh, req, sizeof(req), &resplen, resp, sizeof(resp) ); wch_link_command( devh, req, sizeof(req), &resplen, resp, sizeof(resp) );
if( resplen != 9 || resp[3] != reg_7_bit ) if( resplen != 9 || resp[8] == 0x02 || resp[8] == 0x03 ) //|| resp[3] != reg_7_bit )
{ {
fprintf( stderr, "Error setting write reg. Tell cnlohr. Maybe we should allow retries here?\n" ); fprintf( stderr, "Error setting write reg. Tell cnlohr. Maybe we should allow retries here?\n" );
fprintf( stderr, "RR: %d :", resplen ); fprintf( stderr, "RR: %d :", resplen );
...@@ -201,7 +201,7 @@ int LEReadReg32( void * dev, uint8_t reg_7_bit, uint32_t * commandresp ) ...@@ -201,7 +201,7 @@ int LEReadReg32( void * dev, uint8_t reg_7_bit, uint32_t * commandresp )
iOP }; iOP };
wch_link_command( devh, req, sizeof( req ), (int*)&transferred, rbuff, sizeof( rbuff ) ); wch_link_command( devh, req, sizeof( req ), (int*)&transferred, rbuff, sizeof( rbuff ) );
*commandresp = ( rbuff[4]<<24 ) | (rbuff[5]<<16) | (rbuff[6]<<8) | (rbuff[7]<<0); *commandresp = ( rbuff[4]<<24 ) | (rbuff[5]<<16) | (rbuff[6]<<8) | (rbuff[7]<<0);
if( transferred != 9 || rbuff[3] != reg_7_bit ) if( transferred != 9 || resp[8] == 0x02 || resp[8] == 0x03 ) //|| resp[3] != reg_7_bit )
{ {
fprintf( stderr, "Error setting write reg. Tell cnlohr. Maybe we should allow retries here?\n" ); fprintf( stderr, "Error setting write reg. Tell cnlohr. Maybe we should allow retries here?\n" );
fprintf( stderr, "RR: %d :", transferred ); fprintf( stderr, "RR: %d :", transferred );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment