void temperature_init(void) { temperature_value=0.0; uart_puts("-- Temperature: INIT\r\n"); initTempSensors(); loopTempSensors(); temperature_value=getTemperatureFloat(); _update_temp_string(); }
float temperature_get(void) { //getTemperatureFloat(); //TODO: Fixes really strange linker error, somebody needs to look into this. (loopTempSensors, getTemperatureFloat or read_pressure_temp must be executed to be able to compile. Possible bug with avr-binutils) //TODO: Now fixed by adding -lc -lm to linker flags, needs further testing //uart_puts("-- Temperature: Get value\r\n"); loopTempSensors(); temperature_value=getTemperatureFloat(); _update_temp_string(); //printf("Current temp: %s deg C\r\n", temperature_string_buffer); return temperature_value; }
void temperature_init(void) { #if TEMPERATURE_SENSOR == 0 PRINTF("-- Temperature: INIT\r\n"); initTempSensors(); loopTempSensors(); temperature_value=getTemperatureFloat(); _update_temp_string(); // PRINTF("Current temp: %s deg C\r\n", temperature_string_buffer); #endif }
float temperature_get(void) { //getTemperatureFloat(); //TODO: Fixes really strange linker error, somebody needs to look into this. (loopTempSensors, getTemperatureFloat or read_pressure_temp must be executed to be able to compile. Possible bug with avr-binutils) //TODO: Now fixed by adding -lc -lm to linker flags, needs further testing #if TEMPERATURE_SENSOR == 0 PRINTF("-- Temperature: Get value\r\n"); loopTempSensors(); temperature_value=getTemperatureFloat(); _update_temp_string(); PRINTF("Current temp: %s deg C\r\n", temperature_string_buffer); return temperature_value; #elif TEMPERATURE_SENSOR == 1 return read_humidity_temp(); #elif TEMPERATURE_SENSOR == 2 return read_pressure_temp(); #else return -1; #endif }