Skip to content

Commit

Permalink
Remove ghost comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tabiosg committed Mar 29, 2024
1 parent d70e639 commit 0ad919c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
2 changes: 1 addition & 1 deletion src/esw/fw/science/Core/Src/heater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace mrover {
: m_diag_temp_sensor(std::move(diag_temp_sensor)),
m_heater_pin(std::move(heater_pin)),
m_state(false),
m_auto_shutoff_enabled(true), // TODO - may want to make true if thermistors work
m_auto_shutoff_enabled(true),
m_last_time_received_message(0)
{}

Expand Down
18 changes: 0 additions & 18 deletions src/esw/fw/science/Core/Src/science.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,24 +130,6 @@ void HAL_FDCAN_RxFifo0Callback(FDCAN_HandleTypeDef* hfdcan, uint32_t RxFifo0ITs)
}
}

//void HAL_I2C_MasterTXCpltCallback(I2C_HandleTypeDef *hi2c) {
// HAL_I2C_Master_Receive_IT(hi2c, (mrover::Spectral::SPECTRAL_7b_ADDRESS << 1 | 1), (uint8_t*)spectral_status_buffer, sizeof(spectral_status_buffer));
//}
//
//void HAL_I2C_MasterRXCpltCallback(I2C_HandleTypeDef *hi2c) {
// // If we want to use this for anything else than checking spectral status reg,
// // then this function needs additional logic
//
// if ((spectral_status_buffer[0] & mrover::Spectral::I2C_AS72XX_SLAVE_TX_VALID) == 0) {
// osSemaphoreRelease(spectral_write_status);
// }
//
// if ((spectral_status_buffer[0] & mrover::Spectral::I2C_AS72XX_SLAVE_RX_VALID) == 0) {
// osSemaphoreRelease(spectral_read_status);
// }
//
//}

void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c) {
// Something is most likely wrong with the I2C bus
// if we get to this point
Expand Down
13 changes: 0 additions & 13 deletions src/esw/fw/science/Core/Src/spectral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ namespace mrover {
else {
m_error = true;
m_initialized = false;
// return;
}

osDelay(5); // Non blocking delay
}

//throw mrover::I2CRuntimeError("SPECTRAL");
m_error = true;
m_initialized = false;
}
Expand All @@ -66,8 +64,6 @@ namespace mrover {
// DATA_RDY is 0 and RSVD is 0
virtual_write(CONTROL_SETUP_REG, control_data);
osDelay(50);
// virtual_write(CONTROL_SETUP_REG, control_data);
// osDelay(50);

// Integration time = 2.8ms & 0xFF
uint8_t int_time_multiplier = 0xFF; //0xFF;
Expand Down Expand Up @@ -120,14 +116,11 @@ namespace mrover {
uint8_t buf[2];
buf[0] = I2C_AS72XX_WRITE_REG;
buf[1] = (virtual_reg | 0x80);
// m_i2c_bus->blocking_transmit(SPECTRAL_7b_ADDRESS, buf[0]);
// How to send multiple bytes?
HAL_I2C_Master_Transmit(&hi2c1, SPECTRAL_7b_ADDRESS << 1, buf, sizeof(buf), 100);

poll_status_reg(I2C_OP::WRITE);
buf[0] = I2C_AS72XX_WRITE_REG;
buf[1] = data;
// m_i2c_bus->blocking_transmit(SPECTRAL_7b_ADDRESS, buf[0]);

HAL_I2C_Master_Transmit(&hi2c1, SPECTRAL_7b_ADDRESS << 1, buf, sizeof(buf), 100);

Expand Down Expand Up @@ -158,10 +151,6 @@ namespace mrover {
buf[0] = I2C_AS72XX_WRITE_REG;
buf[1] = virtual_reg;
HAL_I2C_Master_Transmit(&hi2c1, SPECTRAL_7b_ADDRESS << 1, buf, sizeof(buf), 100);
// UNABLE TO USE this format because TSend is 1 byte, need to double up
// TODO resolve this somehow...
// m_i2c_bus->blocking_transmit(SPECTRAL_7b_ADDRESS, buf[0]);


poll_status_reg(I2C_OP::READ);

Expand All @@ -170,8 +159,6 @@ namespace mrover {
}

auto result = m_i2c_bus->blocking_transact(SPECTRAL_7b_ADDRESS, I2C_AS72XX_READ_REG);
// m_i2c_bus->blocking_transmit(SPECTRAL_7b_ADDRESS, I2C_AS72XX_READ_REG);
// auto result = m_i2c_bus->blocking_receive(SPECTRAL_7b_ADDRESS);
if(!result.has_value()){
m_error = true;
return 0;
Expand Down

0 comments on commit 0ad919c

Please sign in to comment.