fix: cleanup vendor
fix: only use piface when need by relay config
This commit is contained in:
parent
6e089fa265
commit
09a379ef9f
10 changed files with 219 additions and 153 deletions
src
|
@ -133,7 +133,8 @@ main(int argc, const char** argv)
|
|||
/******************** SETUP WIRINGPI ********************/
|
||||
|
||||
wiringPiSetup();
|
||||
piFaceSetup(PIFACE_GPIO_BASE);
|
||||
|
||||
int piface_setup = 0;
|
||||
|
||||
for(uint_fast8_t i = 0; i < global_controller->relay_count; ++i)
|
||||
{
|
||||
|
@ -142,6 +143,11 @@ main(int argc, const char** argv)
|
|||
pinMode(global_config.relay_configs[i].pin, OUTPUT);
|
||||
digitalWrite(global_config.relay_configs[i].pin, global_config.relay_configs[i].inverted);
|
||||
}
|
||||
if((global_config.relay_configs[i].driver == RELAY_DRIVER_PIFACE) && !piface_setup)
|
||||
{
|
||||
piFaceSetup(PIFACE_GPIO_BASE);
|
||||
piface_setup = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue