One issue with the code was that it was to big for the flash in the spark Core.
We solved that issue for now by switching the firmware to the new feature/hal branch from Spark Core dev team, which is going to be the future code base for the photon as well. Configuring the code for this branch is in that way also future compatible.
To free up more flash space we deactivated the Spark Cloud support.
Steps to do that:
- build up a local build environment. See https://github.com/spark/firmware/tree/feature/hal22
- clone the feature/hal branch instead of master: git clone -b feature/hal https://github.com/spark/firmware3
- compile the OSBH code with make APP=OSBH SPARK_CLOUD=n
I needed to add following lines to the OneWire.cpp file:
#include "OneWire.h"
#include "gpio_hal.h"
#include "pinmap_impl.h"
#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif
Filesize is now about 70kb, which means we have 40kb for more Code!
We still need to do some tests with the new firmware as there seem to be some bugs around, but looks promising.