# HG changeset patch # User kripperger@CL-SEC241-09.cedarville.edu # Date 2012-11-28 11:58:22 # Node ID e26676bc539c706b5caeee35e92b6317f0eb3f3c # Parent dc6296adf348d548d0915c20a181ad8f437d3ca9 Optimization (temp sense) diff --git a/slave/slave/lib/sensors.c b/slave/slave/lib/sensors.c --- a/slave/slave/lib/sensors.c +++ b/slave/slave/lib/sensors.c @@ -33,14 +33,13 @@ int16_t readSpiTemp() uint8_t four = send_spi(0xFF); DESELECT_TEMP; - uint8_t error = (two & 0x01); int16_t temperature = ((one<<4)|(two>>4)); temperature = (temperature & (0x0800)) ? (temperature & 0xF000) : temperature; // Sign extend - temperature = error ? 0x00DE : temperature; // Error Condition. If error is detected output is set to 222 degrees (0x00DE) + temperature = (two & 0x01) ? 0x00DE : temperature; // Error Condition. If error is detected output is set to 222 degrees (0x00DE) - sprintf(buff, "Temperature: %d Error: %u\r\n", temperature,error); //DEBUG///////////////////////////// + sprintf(buff, "Temperature: %d Error: %u\r\n", temperature,(two & 0x01)); //DEBUG///////////////////////////// serial0_sendString(buff); //DEBUG///////////////////////////// return temperature;