lis3 bugfixes
This commit is contained in:
parent
38779e619a
commit
ddb76ff61b
@ -6,7 +6,7 @@
|
||||
#ifndef CONFIG_OBSWCONFIG_H_
|
||||
#define CONFIG_OBSWCONFIG_H_
|
||||
|
||||
#define ADD_TEST_CODE 1
|
||||
#define OBSW_ADD_TEST_CODE 1
|
||||
|
||||
// Define not used yet, PUS stack and TMTC tasks are always started
|
||||
#define ADD_PUS_STACK 1
|
||||
|
@ -115,14 +115,12 @@ ReturnValue_t MGMHandlerLIS3MDL::buildCommandFromCommand(
|
||||
lastSentCommand = deviceCommand;
|
||||
switch(deviceCommand) {
|
||||
case(MGMLIS3MDL::READALL_MGM): {
|
||||
if (commandDataLen == 0) {
|
||||
std::memset(commandBuffer, 0, sizeof(commandBuffer));
|
||||
commandBuffer[0] = readCommand(0, true);
|
||||
|
||||
rawPacket = commandBuffer;
|
||||
rawPacketLen = sizeof(commandBuffer);
|
||||
return RETURN_OK;
|
||||
}
|
||||
case(MGMLIS3MDL::IDENTIFY_DEVICE): {
|
||||
return identifyDevice();
|
||||
}
|
||||
@ -346,8 +344,8 @@ ReturnValue_t MGMHandlerLIS3MDL::prepareRegisterWrite() {
|
||||
|
||||
commandBuffer[0] = writeCommand(MGMLIS3MDL::CTRL_REG1, true);
|
||||
|
||||
for (size_t i = 1; i <= MGMLIS3MDL::NR_OF_CTRL_REGISTERS; i++) {
|
||||
commandBuffer[i] = registers[i];
|
||||
for (size_t i = 0; i < MGMLIS3MDL::NR_OF_CTRL_REGISTERS; i++) {
|
||||
commandBuffer[i + 1] = registers[i];
|
||||
}
|
||||
rawPacket = commandBuffer;
|
||||
rawPacketLen = MGMLIS3MDL::NR_OF_CTRL_REGISTERS;
|
||||
|
Loading…
Reference in New Issue
Block a user