File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ MagneticSensorSPIConfig_s AS5147_SPI = {
5
5
.spi_mode = SPI_MODE1,
6
6
.clock_speed = 1000000 ,
7
7
.bit_resolution = 14 ,
8
- .angle_register = 0xCFFF ,
8
+ .angle_register = 0x3FFF ,
9
9
.data_start_bit = 13 ,
10
10
.command_rw_bit = 14 ,
11
11
.command_parity_bit = 15
@@ -233,7 +233,7 @@ word MagneticSensorSPI::read(word angle_register){
233
233
234
234
register_value = register_value >> (1 + data_start_bit - bit_resolution); // this should shift data to the rightmost bits of the word
235
235
236
- const static word data_mask = ~( 0 >> (16 - bit_resolution) );
236
+ const static word data_mask = 0xFFFF >> (16 - bit_resolution);
237
237
238
238
return register_value & data_mask; // Return the data, stripping the non data (e.g parity) bits
239
239
}
You can’t perform that action at this time.
0 commit comments