BrewPi / firmware

Brewing temperature control firmware for the BrewPi Spark (Particle Photon inside)
http://www.brewpi.com
GNU Affero General Public License v3.0
98 stars 55 forks source link

Digital actuator pins on the Spark as system blocks that cannot be deleted #98

Closed elcojacobs closed 6 years ago

elcojacobs commented 6 years ago

Digital output pins are board specific, should be not user configurable, but the available ones should be easily listed for the user.

By adding the blocks for the pins as hardcoded system objects, they exist as preconfigured blocks and cannot be deleted. ActuatorPin was removed as a factory, because the user should not be able to set a random pin number as output. It could be used for internals like the display.

To help the devcon service give the devices useful names, they have different object IDs for different boards. On the v3, 10-14 map onto [bottom 1, bottom 2, top 1, top 2, top 3]. On the v2, 15-18 map onto [actuator 0, actuator 1, actuator 2, actuator 3]. On the v1, 16-18 map onto [actuator 1, actuator 2, actuator 3].

This PR also adds board init and some refactoring of the pin definitions.