@@ -183,16 +183,16 @@ void update_temp() {
// This may not clock at all... might need to send 16 bits first
SPI_I2S_SendData(SPI2, 0xAAAA); // send dummy data
//SPI_I2S_SendData(SPI2, 0xAA); // send dummy data
uint16_t temp_pre = SPI_I2S_ReceiveData(SPI2);
if(temp_pre & 0b0000000000000010) {
ssd1306_DrawString("Fatal Error", 3, 35);
ssd1306_DrawString("Fatal Error", 2, 35);
}
else if(temp_pre & 0b0000000000000001) {
ssd1306_DrawString("TC Fault", 3, 35);
ssd1306_DrawString("TC Fault", 2, 35);
uint8_t sign = temp >> 15;// top bit is sign
temp_pre = temp_pre >> 2; // Drop 2 lowest bits
temp_frac = temp_pre & 0b11; // get fractional part
Status change: