diff --git a/src/boot/ksdk1.1.0/boot.c b/src/boot/ksdk1.1.0/boot.c index 0aca13b07..544b2b1ed 100644 --- a/src/boot/ksdk1.1.0/boot.c +++ b/src/boot/ksdk1.1.0/boot.c @@ -3976,7 +3976,7 @@ repeatRegisterReadForDeviceAndAddress(WarpSensorDevice warpSensorDevice, uint8_t break; } -case kWarpSensorBNO055: + case kWarpSensorBNO055: { /* * BNO055: VDD 1.95--3.6 @@ -4004,7 +4004,7 @@ case kWarpSensorBNO055: break; } -case kWarpSensorRF430CL331H: + case kWarpSensorRF430CL331H: { /* * BNO055: VDD 1.95--3.6 diff --git a/src/boot/ksdk1.1.0/config.h b/src/boot/ksdk1.1.0/config.h index 57f8ff2f5..17ef41985 100644 --- a/src/boot/ksdk1.1.0/config.h +++ b/src/boot/ksdk1.1.0/config.h @@ -202,5 +202,5 @@ typedef enum kWarpDefaultSupplyVoltageMillivoltsAT45DB = 1800, kWarpDefaultSupplyVoltageMillivoltsICE40 = 1800, kWarpDefaultSupplyVoltageMillivoltsBNO055 = 2500, - kWarpDefaultSupplyVoltageMillivoltsRF430CL331H = 2500, + kWarpDefaultSupplyVoltageMillivoltsRF430CL331H = 2500, } WarpDefaults; \ No newline at end of file diff --git a/src/boot/ksdk1.1.0/devBME680.c b/src/boot/ksdk1.1.0/devBME680.c index 0b70fa408..0ad39fbb4 100644 --- a/src/boot/ksdk1.1.0/devBME680.c +++ b/src/boot/ksdk1.1.0/devBME680.c @@ -438,6 +438,7 @@ appendSensorDataBME680(uint8_t* buf) */ return index; } + WarpStatus StateBME680() { diff --git a/src/boot/ksdk1.1.0/devBNO055.c b/src/boot/ksdk1.1.0/devBNO055.c index d201359c6..7bb84fb62 100644 --- a/src/boot/ksdk1.1.0/devBNO055.c +++ b/src/boot/ksdk1.1.0/devBNO055.c @@ -127,7 +127,7 @@ readSensorRegisterBNO055(uint8_t deviceRegister, int numberOfBytes) void printSensorDataBNO055(bool hexModeFlag) { - int16_t readSensorRegisterValueLSB; + int16_t readSensorRegisterValueLSB; int16_t readSensorRegisterValueMSB; int16_t readSensorRegisterValueCombined; WarpStatus i2cReadStatus; @@ -139,7 +139,7 @@ printSensorDataBNO055(bool hexModeFlag) { accY = (int16_t)((deviceBNO055State.i2cBuffer[3] << 8) | deviceBNO055State.i2cBuffer[2]); accZ = (int16_t)((deviceBNO055State.i2cBuffer[5] << 8) | deviceBNO055State.i2cBuffer[4]); - if (i2cReadStatus != kWarpStatusOK) + if (i2cReadStatus != kWarpStatusOK) { warpPrint(" ----,"); } @@ -155,13 +155,13 @@ printSensorDataBNO055(bool hexModeFlag) { } } - i2cReadStatus = readSensorRegisterBNO055(kWarpSensourOutputRegisterBNO055Mag_Data_X_LSB, 6); + i2cReadStatus = readSensorRegisterBNO055(kWarpSensourOutputRegisterBNO055Mag_Data_X_LSB, 6); - magX = (int16_t)((deviceBNO055State.i2cBuffer[1] << 8) | deviceBNO055State.i2cBuffer[0]); - magY = (int16_t)((deviceBNO055State.i2cBuffer[3] << 8) | deviceBNO055State.i2cBuffer[2]); - magZ = (int16_t)((deviceBNO055State.i2cBuffer[5] << 8) | deviceBNO055State.i2cBuffer[4]); + magX = (int16_t)((deviceBNO055State.i2cBuffer[1] << 8) | deviceBNO055State.i2cBuffer[0]); + magY = (int16_t)((deviceBNO055State.i2cBuffer[3] << 8) | deviceBNO055State.i2cBuffer[2]); + magZ = (int16_t)((deviceBNO055State.i2cBuffer[5] << 8) | deviceBNO055State.i2cBuffer[4]); - if (i2cReadStatus != kWarpStatusOK) + if (i2cReadStatus != kWarpStatusOK) { warpPrint(" ----,"); } @@ -177,14 +177,14 @@ printSensorDataBNO055(bool hexModeFlag) { } } - warpScaleSupplyVoltage(deviceBNO055State.operatingVoltageMillivolts); + warpScaleSupplyVoltage(deviceBNO055State.operatingVoltageMillivolts); i2cReadStatus = readSensorRegisterBNO055(kWarpSensourOutputRegisterBNO055Gyro_Data_X_LSB, 6); - gyrX = (int16_t)((deviceBNO055State.i2cBuffer[1] << 8) | deviceBNO055State.i2cBuffer[0]); - gyrY = (int16_t)((deviceBNO055State.i2cBuffer[3] << 8) | deviceBNO055State.i2cBuffer[2]); - gyrZ = (int16_t)((deviceBNO055State.i2cBuffer[5] << 8) | deviceBNO055State.i2cBuffer[4]); + gyrX = (int16_t)((deviceBNO055State.i2cBuffer[1] << 8) | deviceBNO055State.i2cBuffer[0]); + gyrY = (int16_t)((deviceBNO055State.i2cBuffer[3] << 8) | deviceBNO055State.i2cBuffer[2]); + gyrZ = (int16_t)((deviceBNO055State.i2cBuffer[5] << 8) | deviceBNO055State.i2cBuffer[4]); - if (i2cReadStatus != kWarpStatusOK) + if (i2cReadStatus != kWarpStatusOK) { warpPrint(" ----,"); } @@ -230,9 +230,9 @@ appendSensorDataBNO055(uint8_t* buf) */ i2cReadStatus = readSensorRegisterBNO055(kWarpSensourOutputRegisterBNO055Accel_Data_X_LSB, 2); - readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; - readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; - readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; + readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; + readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; + readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; if ((i2cReadStatus != kWarpStatusOK)) @@ -254,11 +254,11 @@ appendSensorDataBNO055(uint8_t* buf) } i2cReadStatus = readSensorRegisterBNO055(kWarpSensourOutputRegisterBNO055Accel_Data_Y_LSB, 2); - readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; - readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; - readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; + readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; + readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; + readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; - if ((i2cReadStatus != kWarpStatusOK)) + if ((i2cReadStatus != kWarpStatusOK)) { buf[index] = 0; index += 1; @@ -276,12 +276,12 @@ appendSensorDataBNO055(uint8_t* buf) } - i2cReadStatus = readSensorRegisterBNO055(kWarpSensourOutputRegisterBNO055Accel_Data_Z_LSB, 2); - readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; - readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; - readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; + i2cReadStatus = readSensorRegisterBNO055(kWarpSensourOutputRegisterBNO055Accel_Data_Z_LSB, 2); + readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; + readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; + readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; - if ((i2cReadStatus != kWarpStatusOK)) + if ((i2cReadStatus != kWarpStatusOK)) { buf[index] = 0; index += 1; @@ -300,11 +300,11 @@ appendSensorDataBNO055(uint8_t* buf) } i2cReadStatus = readSensorRegisterBNO055(kWarpSensourOutputRegisterBNO055Mag_Data_X_LSB, 2); - readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; - readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; - readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; + readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; + readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; + readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; - if ((i2cReadStatus != kWarpStatusOK)) + if ((i2cReadStatus != kWarpStatusOK)) { buf[index] = 0; index += 1; @@ -321,12 +321,13 @@ appendSensorDataBNO055(uint8_t* buf) index += 1; } + i2cReadStatus = readSensorRegisterBNO055(kWarpSensourOutputRegisterBNO055Mag_Data_Y_LSB, 2); - readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; - readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; - readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; + readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; + readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; + readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; - if ((i2cReadStatus != kWarpStatusOK)) + if ((i2cReadStatus != kWarpStatusOK)) { buf[index] = 0; index += 1; @@ -343,12 +344,13 @@ appendSensorDataBNO055(uint8_t* buf) index += 1; } + i2cReadStatus = readSensorRegisterBNO055(kWarpSensourOutputRegisterBNO055Mag_Data_Z_LSB, 2); - readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; - readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; - readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; + readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; + readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; + readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; - if ((i2cReadStatus != kWarpStatusOK)) + if ((i2cReadStatus != kWarpStatusOK)) { buf[index] = 0; index += 1; @@ -365,12 +367,13 @@ appendSensorDataBNO055(uint8_t* buf) index += 1; } + i2cReadStatus = readSensorRegisterBNO055(kWarpSensourOutputRegisterBNO055Gyro_Data_X_LSB, 2); - readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; - readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; - readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; + readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; + readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; + readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; - if ((i2cReadStatus != kWarpStatusOK)) + if ((i2cReadStatus != kWarpStatusOK)) { buf[index] = 0; index += 1; @@ -387,12 +390,13 @@ appendSensorDataBNO055(uint8_t* buf) index += 1; } + i2cReadStatus = readSensorRegisterBNO055(kWarpSensourOutputRegisterBNO055Gyro_Data_Y_LSB, 2); - readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; - readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; - readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; + readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; + readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; + readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; - if ((i2cReadStatus != kWarpStatusOK)) + if ((i2cReadStatus != kWarpStatusOK)) { buf[index] = 0; index += 1; @@ -410,12 +414,13 @@ appendSensorDataBNO055(uint8_t* buf) index += 1; } + i2cReadStatus = readSensorRegisterBNO055(kWarpSensourOutputRegisterBNO055Gyro_Data_Z_LSB, 2); - readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; - readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; - readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; + readSensorRegisterValueLSB = deviceBNO055State.i2cBuffer[0]; + readSensorRegisterValueMSB = deviceBNO055State.i2cBuffer[1]; + readSensorRegisterValueCombined = (readSensorRegisterValueMSB << 8) | readSensorRegisterValueLSB; - if ((i2cReadStatus != kWarpStatusOK)) + if ((i2cReadStatus != kWarpStatusOK)) { buf[index] = 0; index += 1; diff --git a/src/boot/ksdk1.1.0/devBNO055.h b/src/boot/ksdk1.1.0/devBNO055.h index be0ce8aeb..6954295f2 100644 --- a/src/boot/ksdk1.1.0/devBNO055.h +++ b/src/boot/ksdk1.1.0/devBNO055.h @@ -1,9 +1,9 @@ void initBNO055(const uint8_t i2cAddress, uint16_t operatingVoltageMillivolts); WarpStatus readSensorRegisterBNO055(uint8_t deviceRegister, int numberOfBytes); WarpStatus writeSensorRegisterBNO055(uint8_t deviceRegister, uint8_t payload); -WarpStatus configureSensorRegisterBNO055(uint8_t payloadOP_Mode, uint8_t payloadPWR_Mode); +WarpStatus configureSensorRegisterBNO055(uint8_t payloadOP_Mode, uint8_t payloadPWR_Mode); void printSensorDataBNO055(bool hexModeFlag); -WarpStatus StateBNO055(); +WarpStatus StateBNO055(); uint8_t appendSensorDataBNO055(uint8_t* buf);