This is a class which contains function to interface with the MLX75320
Diff: LidarSpi.cpp
- Revision:
- 1:e3ace426cee5
- Parent:
- 0:dfe498e03679
- Child:
- 3:9ed1d493c235
diff -r dfe498e03679 -r e3ace426cee5 LidarSpi.cpp --- a/LidarSpi.cpp Thu Feb 25 08:02:11 2016 +0000 +++ b/LidarSpi.cpp Thu Feb 25 08:14:59 2016 +0000 @@ -595,7 +595,7 @@ // Decode the long responses, then extract data values res = MLX_DecodeResL2(&rxL); - if ((res < 0)|| a==5){ + if ((res < 0)){ pc->printf("\n\r"); pc->printf("-- -- -- -- -- -- --\n\r"); @@ -621,10 +621,10 @@ // Gather all of the echo data in a buffer. //for (b = 0; b < (MLX_LONG2_DATA_SZ / 2); ++b) - for (b = 0; b < (128/2); ++b) + for (b = 0; b < (128); ++b) { //buf[a*(MLX_LONG2_DATA_SZ / 2) + b] = (((u16ptr[b] & 0x00ff) << 8) | ((u16ptr[b] & 0xff00) >> 8)); //Swap LSByte with MSByte - buf[a*(128/2) + b] = (((u16ptr[b] & 0x00ff) << 8) | ((u16ptr[b] & 0xff00) >> 8)); //Swap LSByte with MSByte + buf[a*(128) + b] = (((u16ptr[b] & 0x00ff) << 8) | ((u16ptr[b] & 0xff00) >> 8)); //Swap LSByte with MSByte } //prevTX=txL; //prevRX=rxL;