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 = {
55 .spi_mode = SPI_MODE1,
66 .clock_speed = 1000000 ,
77 .bit_resolution = 14 ,
8- .angle_register = 0xCFFF ,
8+ .angle_register = 0x3FFF ,
99 .data_start_bit = 13 ,
1010 .command_rw_bit = 14 ,
1111 .command_parity_bit = 15
@@ -233,7 +233,7 @@ word MagneticSensorSPI::read(word angle_register){
233233
234234 register_value = register_value >> (1 + data_start_bit - bit_resolution); // this should shift data to the rightmost bits of the word
235235
236- const static word data_mask = ~( 0 >> (16 - bit_resolution) );
236+ const static word data_mask = 0xFFFF >> (16 - bit_resolution);
237237
238238 return register_value & data_mask; // Return the data, stripping the non data (e.g parity) bits
239239}
You can’t perform that action at this time.
0 commit comments