-// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the
-// distribution.
-// * All advertising materials mentioning features or use of this
-// software must display the following acknowledgement: This product
-// includes software developed by tm3d.de and its contributors.
-// * Neither the name of tm3d.de nor the names of its contributors may
-// be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifdef __4MHZ__
-#define F_CPU 4000000UL
-#else
-#define F_CPU 8000000UL
-#endif
-#include <avr/io.h>
-
-
-/** Array Index to Field data mapping for Calibration Data*/
-#define BME680_T2_LSB_REG (1)
-#define BME680_T2_MSB_REG (2)
-#define BME680_T3_REG (3)
-#define BME680_P1_LSB_REG (5)
-#define BME680_P1_MSB_REG (6)
-#define BME680_P2_LSB_REG (7)
-#define BME680_P2_MSB_REG (8)
-#define BME680_P3_REG (9)
-#define BME680_P4_LSB_REG (11)
-#define BME680_P4_MSB_REG (12)
-#define BME680_P5_LSB_REG (13)
-#define BME680_P5_MSB_REG (14)
-#define BME680_P7_REG (15)
-#define BME680_P6_REG (16)
-#define BME680_P8_LSB_REG (19)
-#define BME680_P8_MSB_REG (20)
-#define BME680_P9_LSB_REG (21)
-#define BME680_P9_MSB_REG (22)
-#define BME680_P10_REG (23)
-#define BME680_H2_MSB_REG (25)
-#define BME680_H2_LSB_REG (26)
-#define BME680_H1_LSB_REG (26)
-#define BME680_H1_MSB_REG (27)
-#define BME680_H3_REG (28)
-#define BME680_H4_REG (29)
-#define BME680_H5_REG (30)
-#define BME680_H6_REG (31)
-#define BME680_H7_REG (32)
-#define BME680_T1_LSB_REG (33)
-#define BME680_T1_MSB_REG (34)
-#define BME680_GH2_LSB_REG (35)
-#define BME680_GH2_MSB_REG (36)
-#define BME680_GH1_REG (37)
-#define BME680_GH3_REG (38)
-
-
-#include <util/delay.h>
-#include <avr/pgmspace.h>
-
-#include "USI_TWI_Master.h"
-#include "BME680.h"
-
-#define WC 0b11101100
-#define RC 0b11101101
-typedef union {
- volatile uint8_t d[41];
- struct {
- uint8_t fr1;
- int16_t t2;
- int8_t t3;
- uint8_t fr2; //4
- uint16_t p1;
- int16_t p2; //7
- int8_t p3;
- uint8_t fr3; //10
- int16_t p4;
- int16_t p5;
- int8_t p7;
- int8_t p6;
- uint8_t fr4[2]; //17-18
- int16_t p8;
- int16_t p9;
- uint8_t p10;
- uint8_t fr5; //24
- uint16_t h2_; //25 +26
- uint8_t h1_; //halb und halb 26+27
- int8_t h3;
- int8_t h4;
- int8_t h5;
- uint8_t h6;
- int8_t h7;//32
- uint16_t t1;
- int16_t gh2;
- int8_t gh1;
- int8_t gh3; //38
- int8_t fr6;// 39;
- int8_t fr7; //40;
- uint16_t h2; //Berechnung
- uint16_t h1; //Berechnung
- int32_t t_fine; //Berechnung bei Temperaturmessung
+// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de\r
+// All rights reserved.\r
+//\r
+// Redistribution and use in source and binary forms, with or without\r
+// modification, are permitted provided that the following conditions are\r
+// met:\r
+//\r
+// * Redistributions of source code must retain the above copyright\r
+// notice, this list of conditions and the following disclaimer.\r
+// * Redistributions in binary form must reproduce the above copyright\r
+// notice, this list of conditions and the following disclaimer in the\r
+// documentation and/or other materials provided with the\r
+// distribution.\r
+// * All advertising materials mentioning features or use of this\r
+// software must display the following acknowledgement: This product\r
+// includes software developed by tm3d.de and its contributors.\r
+// * Neither the name of tm3d.de nor the names of its contributors may\r
+// be used to endorse or promote products derived from this software\r
+// without specific prior written permission.\r
+//\r
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+#ifdef __4MHZ__\r
+#define F_CPU 4000000UL\r
+#else\r
+#define F_CPU 8000000UL\r
+#endif\r
+#include <avr/io.h>\r
+\r
+\r
+/** Array Index to Field data mapping for Calibration Data*/\r
+#define BME680_T2_LSB_REG (1)\r
+#define BME680_T2_MSB_REG (2)\r
+#define BME680_T3_REG (3)\r
+#define BME680_P1_LSB_REG (5)\r
+#define BME680_P1_MSB_REG (6)\r
+#define BME680_P2_LSB_REG (7)\r
+#define BME680_P2_MSB_REG (8)\r
+#define BME680_P3_REG (9)\r
+#define BME680_P4_LSB_REG (11)\r
+#define BME680_P4_MSB_REG (12)\r
+#define BME680_P5_LSB_REG (13)\r
+#define BME680_P5_MSB_REG (14)\r
+#define BME680_P7_REG (15)\r
+#define BME680_P6_REG (16)\r
+#define BME680_P8_LSB_REG (19)\r
+#define BME680_P8_MSB_REG (20)\r
+#define BME680_P9_LSB_REG (21)\r
+#define BME680_P9_MSB_REG (22)\r
+#define BME680_P10_REG (23)\r
+#define BME680_H2_MSB_REG (25)\r
+#define BME680_H2_LSB_REG (26)\r
+#define BME680_H1_LSB_REG (26)\r
+#define BME680_H1_MSB_REG (27)\r
+#define BME680_H3_REG (28)\r
+#define BME680_H4_REG (29)\r
+#define BME680_H5_REG (30)\r
+#define BME680_H6_REG (31)\r
+#define BME680_H7_REG (32)\r
+#define BME680_T1_LSB_REG (33)\r
+#define BME680_T1_MSB_REG (34)\r
+#define BME680_GH2_LSB_REG (35)\r
+#define BME680_GH2_MSB_REG (36)\r
+#define BME680_GH1_REG (37)\r
+#define BME680_GH3_REG (38)\r
+\r
+\r
+#include <util/delay.h>\r
+#include <avr/pgmspace.h>\r
+\r
+#include "USI_TWI_Master.h"\r
+#include "BME680.h"\r
+\r
+#define WC 0b11101100\r
+#define RC 0b11101101\r
+typedef union {\r
+ volatile uint8_t d[41];\r
+ struct {\r
+ uint8_t fr1;\r
+ int16_t t2;\r
+ int8_t t3;\r
+ uint8_t fr2; //4\r
+ uint16_t p1;\r
+ int16_t p2; //7\r
+ int8_t p3;\r
+ uint8_t fr3; //10\r
+ int16_t p4;\r
+ int16_t p5;\r
+ int8_t p7;\r
+ int8_t p6;\r
+ uint8_t fr4[2]; //17-18\r
+ int16_t p8;\r
+ int16_t p9;\r
+ uint8_t p10;\r
+ uint8_t fr5; //24\r
+ uint16_t h2_; //25 +26\r
+ uint8_t h1_; //halb und halb 26+27\r
+ int8_t h3;\r
+ int8_t h4;\r
+ int8_t h5;\r
+ uint8_t h6;\r
+ int8_t h7;//32\r
+ uint16_t t1;\r
+ int16_t gh2;\r
+ int8_t gh1;\r
+ int8_t gh3; //38\r
+ int8_t fr6;// 39;\r
+ int8_t fr7; //40;\r
+ uint16_t h2; //Berechnung\r
+ uint16_t h1; //Berechnung \r
+ int32_t t_fine; //Berechnung bei Temperaturmessung \r