Skip to content

Commit 3e825a3

Browse files
authored
Merge pull request #6 from movetones/fix-bank-select
fix alignment of bankselect bits in c backbone.
2 parents ecceea7 + 0d1bc20 commit 3e825a3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/util/ICM_20948_C.c

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ ICM_20948_Status_e ICM_20948_i2c_master_single_r( ICM_20948_Device_t* pdev, uint
116116

117117
ICM_20948_Status_e ICM_20948_set_bank( ICM_20948_Device_t* pdev, uint8_t bank ){
118118
if( bank > 3 ){ return ICM_20948_Stat_ParamErr; } // Only 4 possible banks
119+
bank = (bank << 4) & 0x30; // bits 5:4 of REG_BANK_SEL
119120
return ICM_20948_execute_w( pdev, REG_BANK_SEL, &bank, 1 );
120121
}
121122

0 commit comments

Comments
 (0)