Clean up temperature assignment when sending data

This commit is contained in:
Rihards Skuja 2018-01-22 21:34:02 +02:00
parent e62c361970
commit 0d5d439ce1
No known key found for this signature in database
GPG Key ID: 53FA13A3F7F8571B

View File

@ -62,16 +62,10 @@ int main(void)
void send_sensor_data(const int32_t *distance_in_cm)
{
double temp;
temp = ds18b20_gettemp();
/* if (temp >= 23) */
// Prepare the data to be sent
memset(&tx_data, 0, sizeof(data_packet_t));
tx_data.distance = *distance_in_cm;
tx_data.temp = temp;
tx_data.temp = ds18b20_gettemp();
memcpy(tx_raw, &tx_data, sizeof(data_packet_t));
nrf24_send(tx_raw);