mirror of https://github.com/arendst/Tasmota.git
Minor improvements of code example.
parent
81c007ead4
commit
f32f00f8ae
|
@ -11,6 +11,9 @@ Conditional compiling of a sensor driver is achieved by commenting/uncommenting
|
||||||
|
|
||||||
Any sensor driver needs a callback function following the scheme
|
Any sensor driver needs a callback function following the scheme
|
||||||
```
|
```
|
||||||
|
// Conditional compilation of driver
|
||||||
|
#ifdef USE_<driver_name>
|
||||||
|
|
||||||
// Define driver ID
|
// Define driver ID
|
||||||
#define XSNS_<driver_ID>
|
#define XSNS_<driver_ID>
|
||||||
|
|
||||||
|
@ -27,7 +30,7 @@ Any sensor driver needs a callback function following the scheme
|
||||||
*/
|
*/
|
||||||
boolean Xsns<driverID>(byte callback_id) {
|
boolean Xsns<driverID>(byte callback_id) {
|
||||||
|
|
||||||
// ???
|
// Set return value to `false`
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
|
||||||
// Check if I2C interface mode
|
// Check if I2C interface mode
|
||||||
|
@ -72,11 +75,12 @@ boolean Xsns<driverID>(byte callback_id) {
|
||||||
case FUNC_FREE_MEM
|
case FUNC_FREE_MEM
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// } // i2c_flg
|
// } // if(i2c_flg)
|
||||||
|
|
||||||
// Return boolean result
|
// Return boolean result
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
#endif // USE_<driver_name>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue