sonoff -> tasmota

blakadder 2019-11-08 14:58:25 +01:00
parent 5328a72b2f
commit 9189f22772
1 changed files with 4 additions and 4 deletions

@ -1,4 +1,4 @@
This wiki page is an attempt to document the Tasmota sensor API for sensor driver development.
Tasmota sensor API documentation for sensor driver development.
* [**Important things to consider**](#important-things-to-consider)
* [**API Structure**](#api-structure)
@ -42,7 +42,7 @@ When you think it is ready to merge and submit a PR:
Now you have a clean single commit from which you can create the PR on the Tasmota Github.
# Directory/file structure
Sensor libraries are located in the `lib/` directory. Sensor drivers are located in the `sonoff/` directory. The filename of the sensor driver is `xsns_<driver_ID>_<driver_name>.ino`, e.g. `xsns_05_ds18b20.ino` where `<driver_ID>` is a _unique_ number between 01 and 90 and `<driver_name>` is a human-readable name of the driver.
Sensor libraries are located in the `lib/` directory. Sensor drivers are located in the `tasmota/` directory. The filename of the sensor driver is `xsns_<driver_ID>_<driver_name>.ino`, e.g. `xsns_05_ds18b20.ino` where `<driver_ID>` is a _unique_ number between 01 and 90 and `<driver_name>` is a human-readable name of the driver.
Using generic libraries from external sources for sensors should be avoided as far as possible as they usually include code for other platforms and are not always written in an optimized way.
@ -225,7 +225,7 @@ It should be wrapped in `#ifdef USE_WEBSERVER ... #endif // USE_WEBSERVER`
`FUNC_SAVE_BEFORE_RESTART`
This callback ID is called to allow a sensor to prepare for saving configuration changes. To be used to save volatile data just before a restart. Variables can be appended to `struct SYSCFG {} Settings` in file `sonoff/settings.h`.
This callback ID is called to allow a sensor to prepare for saving configuration changes. To be used to save volatile data just before a restart. Variables can be appended to `struct SYSCFG {} Settings` in file `tasmota/settings.h`.
`FUNC_COMMAND`
@ -397,7 +397,7 @@ You may then reference them directly (if the type matches the parameter required
# Keeping ESP8266 code compact
Below are various tips and tricks to keep ESP8266 code compact and save both Flash and Memory. Flash code is limited to 1024k but keep in mind that to allow OTA upgrade, you need Flash memory to contain two firmwares at the same time. To go beyond 512k, you typically use `sonoff-minimal` as an intermediate firmware. `sonoff-minimal` takes roughly 360k, so it's safe not to go `uint32_t` beyond 620k of Flash. Memory is even more limited: 80k. With Arduino Core and basic Tasmota, there are 25k-30k left of heap space. Heap memory is very precious, running out of memory will generally cause a crash.
Below are various tips and tricks to keep ESP8266 code compact and save both Flash and Memory. Flash code is limited to 1024k but keep in mind that to allow OTA upgrade, you need Flash memory to contain two firmwares at the same time. To go beyond 512k, you typically use `tasmota-minimal` as an intermediate firmware. `tasmota-minimal` takes roughly 360k, so it's safe not to go `uint32_t` beyond 620k of Flash. Memory is even more limited: 80k. With Arduino Core and basic Tasmota, there are 25k-30k left of heap space. Heap memory is very precious, running out of memory will generally cause a crash.
## About ESP8266