From 90adb5f42627bc2ac8584ab8a3e360593c8d7cf0 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Sat, 1 Jun 2019 10:46:04 -0500 Subject: [PATCH] pbioconfig: Introduce pbioconfig.h This adds a new pbioconfig.h file to allow configuration the PBIO library on a per-application basis. Using header files is more consistent with MicroPython and more versitale than relying on using Makefiles to select configuration. --- bricks/HUB4/pbioconfig.h | 5 +++++ bricks/MOVEHUB/pbioconfig.h | 5 +++++ bricks/NXT/pbioconfig.h | 4 ++++ bricks/debug/pbioconfig.h | 4 ++++ bricks/ev3dev/Makefile | 4 +--- bricks/ev3dev/pbioconfig.h | 3 +++ bricks/stm32.mk | 4 +--- lib/pbio/drv/adc/adc_stm32f0.c | 5 +++-- lib/pbio/drv/debug/button.c | 3 ++- lib/pbio/drv/debug/light.c | 5 +++-- lib/pbio/drv/ev3dev_stretch/button.c | 3 ++- lib/pbio/drv/ev3dev_stretch/light.c | 5 +++-- lib/pbio/drv/ev3dev_stretch/motor.c | 3 ++- lib/pbio/drv/hub4/bluetooth.c | 3 ++- lib/pbio/drv/hub4/button.c | 3 ++- lib/pbio/drv/hub4/light.c | 5 +++-- lib/pbio/drv/hub4/motor.c | 5 +++-- lib/pbio/drv/move_hub/bluetooth.c | 3 ++- lib/pbio/drv/move_hub/button.c | 3 ++- lib/pbio/drv/move_hub/light.c | 5 +++-- lib/pbio/drv/move_hub/motor.c | 3 ++- lib/pbio/include/pbdrv/button.h | 3 ++- lib/pbio/include/pbdrv/light.h | 3 ++- lib/pbio/include/pbdrv/motor.h | 3 ++- lib/pbio/include/pbio/config.h | 22 ++++++++++++++++++++++ lib/pbio/include/pbio/main.h | 4 +++- lib/pbio/include/pbsys/sys.h | 3 ++- lib/pbio/src/main.c | 13 +++++++------ 28 files changed, 97 insertions(+), 37 deletions(-) create mode 100644 bricks/HUB4/pbioconfig.h create mode 100644 bricks/MOVEHUB/pbioconfig.h create mode 100644 bricks/NXT/pbioconfig.h create mode 100644 bricks/debug/pbioconfig.h create mode 100644 bricks/ev3dev/pbioconfig.h create mode 100644 lib/pbio/include/pbio/config.h diff --git a/bricks/HUB4/pbioconfig.h b/bricks/HUB4/pbioconfig.h new file mode 100644 index 000000000..e1d51d1d2 --- /dev/null +++ b/bricks/HUB4/pbioconfig.h @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: MIT +// Copyright (c) 2019 David Lechner + +#define PBIO_CONFIG_ENABLE_DEINIT (0) +#define PBIO_CONFIG_ENABLE_SYS (1) diff --git a/bricks/MOVEHUB/pbioconfig.h b/bricks/MOVEHUB/pbioconfig.h new file mode 100644 index 000000000..e1d51d1d2 --- /dev/null +++ b/bricks/MOVEHUB/pbioconfig.h @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: MIT +// Copyright (c) 2019 David Lechner + +#define PBIO_CONFIG_ENABLE_DEINIT (0) +#define PBIO_CONFIG_ENABLE_SYS (1) diff --git a/bricks/NXT/pbioconfig.h b/bricks/NXT/pbioconfig.h new file mode 100644 index 000000000..1e96cf570 --- /dev/null +++ b/bricks/NXT/pbioconfig.h @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: MIT +// Copyright (c) 2019 David Lechner + +#define PBIO_CONFIG_ENABLE_SYS (1) diff --git a/bricks/debug/pbioconfig.h b/bricks/debug/pbioconfig.h new file mode 100644 index 000000000..1e96cf570 --- /dev/null +++ b/bricks/debug/pbioconfig.h @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: MIT +// Copyright (c) 2019 David Lechner + +#define PBIO_CONFIG_ENABLE_SYS (1) diff --git a/bricks/ev3dev/Makefile b/bricks/ev3dev/Makefile index 9cddfaf94..6e1be3a86 100644 --- a/bricks/ev3dev/Makefile +++ b/bricks/ev3dev/Makefile @@ -27,12 +27,10 @@ INC += -I$(TOP)/ports/pybricks/lib/pbio/platform/ev3dev_stretch INC += -I$(TOP)/ports/pybricks/extmod INC += -I$(TOP)/ports/unix -PBIO_OPT = -DPBIO_CONFIG_ENABLE_DEINIT - # compiler settings CWARN = -Wall -Werror CWARN += -Wpointer-arith -Wuninitialized -CFLAGS = $(INC) $(CWARN) -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT) $(CFLAGS_EXTRA) $(PBIO_OPT) +CFLAGS = $(INC) $(CWARN) -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT) $(CFLAGS_EXTRA) # Debugging/Optimization ifdef DEBUG diff --git a/bricks/ev3dev/pbioconfig.h b/bricks/ev3dev/pbioconfig.h new file mode 100644 index 000000000..a304dffa2 --- /dev/null +++ b/bricks/ev3dev/pbioconfig.h @@ -0,0 +1,3 @@ +// SPDX-License-Identifier: MIT +// Copyright (c) 2019 David Lechner + diff --git a/bricks/stm32.mk b/bricks/stm32.mk index f7f646922..01395778c 100644 --- a/bricks/stm32.mk +++ b/bricks/stm32.mk @@ -53,11 +53,9 @@ OPENOCD ?= openocd OPENOCD_CONFIG ?= openocd_stm32f$(CPU_FAMILY).cfg TEXT0_ADDR ?= 0x08000000 -PBIO_OPT = -DPBIO_CONFIG_ENABLE_SYS - CFLAGS_CORTEX_M0 = -mthumb -mtune=cortex-m0 -mcpu=cortex-m0 -msoft-float CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion -CFLAGS = $(INC) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M$(CPU_FAMILY)) $(COPT) $(PBIO_OPT) +CFLAGS = $(INC) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M$(CPU_FAMILY)) $(COPT) LDFLAGS = -nostdlib -T $(PBIO_PLATFORM).ld -Map=$@.map --cref --gc-sections # Tune for Debugging or Optimization diff --git a/lib/pbio/drv/adc/adc_stm32f0.c b/lib/pbio/drv/adc/adc_stm32f0.c index d17bfd568..92719109b 100644 --- a/lib/pbio/drv/adc/adc_stm32f0.c +++ b/lib/pbio/drv/adc/adc_stm32f0.c @@ -8,6 +8,7 @@ #include #include +#include #include #include "sys/process.h" @@ -73,7 +74,7 @@ pbio_error_t pbdrv_adc_get_ch(uint8_t ch, uint16_t *value) { return PBIO_SUCCESS; } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT static void pbdrv_adc_exit() { // REVISIT: do we need timeouts here? ADC1->CR |= ADC_CR_ADSTP; @@ -87,7 +88,7 @@ static void pbdrv_adc_exit() { PROCESS_THREAD(pbdrv_adc_process, ev, data) { // TODO: use DMA for background updates and add filtering // PROCESS_POLLHANDLER(pbdrv_adc_poll()); -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT PROCESS_EXITHANDLER(pbdrv_adc_exit()); #endif diff --git a/lib/pbio/drv/debug/button.c b/lib/pbio/drv/debug/button.c index b452761f5..5c42f71cc 100644 --- a/lib/pbio/drv/debug/button.c +++ b/lib/pbio/drv/debug/button.c @@ -2,6 +2,7 @@ // Copyright (c) 2018 David Lechner #include +#include #include #include @@ -13,7 +14,7 @@ void _pbdrv_button_init(void) { GPIOC->MODER = (GPIOC->MODER & ~GPIO_MODER_MODER13_Msk) | (0 << GPIO_MODER_MODER13_Pos); } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT void _pbdrv_button_deinit(void) { } #endif diff --git a/lib/pbio/drv/debug/light.c b/lib/pbio/drv/debug/light.c index 461e3f2ab..239c46835 100644 --- a/lib/pbio/drv/debug/light.c +++ b/lib/pbio/drv/debug/light.c @@ -2,8 +2,9 @@ // Copyright (c) 2018 David Lechner #include -#include +#include #include +#include #include "stm32f446xx.h" @@ -52,7 +53,7 @@ void _pbdrv_light_init(void) { TIM4->CCR2 = 0; } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT // turn off the light void _pbdrv_light_deinit(void) { TIM12->CR1 &= ~TIM_CR1_CEN; diff --git a/lib/pbio/drv/ev3dev_stretch/button.c b/lib/pbio/drv/ev3dev_stretch/button.c index f77907e75..f8737d913 100644 --- a/lib/pbio/drv/ev3dev_stretch/button.c +++ b/lib/pbio/drv/ev3dev_stretch/button.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -15,7 +16,7 @@ void _pbdrv_button_init(void) { f_btn = open("/dev/input/by-path/platform-gpio_keys-event", O_RDONLY); } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT void _pbdrv_button_deinit(void) { close(f_btn); f_btn = -1; diff --git a/lib/pbio/drv/ev3dev_stretch/light.c b/lib/pbio/drv/ev3dev_stretch/light.c index da20cede3..c8e390c40 100644 --- a/lib/pbio/drv/ev3dev_stretch/light.c +++ b/lib/pbio/drv/ev3dev_stretch/light.c @@ -4,8 +4,9 @@ #include #include -#include +#include #include +#include #define NLEDS 4 @@ -38,7 +39,7 @@ void _pbdrv_light_init(void) { } } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT void _pbdrv_light_deinit(void) { for (int led = 0; led < NLEDS; led++) { if (f_brightness[led]) { diff --git a/lib/pbio/drv/ev3dev_stretch/motor.c b/lib/pbio/drv/ev3dev_stretch/motor.c index 2a3bbe835..9849ec753 100644 --- a/lib/pbio/drv/ev3dev_stretch/motor.c +++ b/lib/pbio/drv/ev3dev_stretch/motor.c @@ -8,6 +8,7 @@ #include #include +#include #define MAX_PATH_LENGTH 120 @@ -166,7 +167,7 @@ void _pbdrv_motor_init(void) { } } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT void _pbdrv_motor_deinit(void) { for(pbio_port_t port = PBDRV_CONFIG_FIRST_MOTOR_PORT; port <= PBDRV_CONFIG_LAST_MOTOR_PORT; port++) { sysfs_close_and_reset(port); diff --git a/lib/pbio/drv/hub4/bluetooth.c b/lib/pbio/drv/hub4/bluetooth.c index e66e51ba6..1d11b4a3f 100644 --- a/lib/pbio/drv/hub4/bluetooth.c +++ b/lib/pbio/drv/hub4/bluetooth.c @@ -6,6 +6,7 @@ #include #include +#include "pbio/config.h" #include "pbio/error.h" #include "pbio/event.h" #include "pbsys/sys.h" @@ -151,7 +152,7 @@ static void spi_init() { NVIC_EnableIRQ(EXTI2_3_IRQn); } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT static void bluetooth_deinit() { // nRESET // set PB6 output low diff --git a/lib/pbio/drv/hub4/button.c b/lib/pbio/drv/hub4/button.c index 9b194d543..09b1f3add 100644 --- a/lib/pbio/drv/hub4/button.c +++ b/lib/pbio/drv/hub4/button.c @@ -2,6 +2,7 @@ // Copyright (c) 2018 David Lechner #include +#include #include #include @@ -15,7 +16,7 @@ void _pbdrv_button_init(void) { GPIOC->MODER = (GPIOC->MODER & ~GPIO_MODER_MODER13_Msk) | (0 << GPIO_MODER_MODER13_Pos); } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT void _pbdrv_button_deinit(void) { } #endif diff --git a/lib/pbio/drv/hub4/light.c b/lib/pbio/drv/hub4/light.c index 46d1afa31..34a372a15 100644 --- a/lib/pbio/drv/hub4/light.c +++ b/lib/pbio/drv/hub4/light.c @@ -2,8 +2,9 @@ // Copyright (c) 2018 David Lechner #include -#include +#include #include +#include #include "stm32f030xc.h" @@ -49,7 +50,7 @@ void _pbdrv_light_init(void) { TIM15->CCR2 = 0; } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT // turn off the light void _pbdrv_light_deinit(void) { TIM15->CR1 &= ~TIM_CR1_CEN; diff --git a/lib/pbio/drv/hub4/motor.c b/lib/pbio/drv/hub4/motor.c index 257c249e5..4aa353ca4 100644 --- a/lib/pbio/drv/hub4/motor.c +++ b/lib/pbio/drv/hub4/motor.c @@ -8,6 +8,7 @@ #include "stm32f030xc.h" #include +#include void _pbdrv_motor_init(void) { // it isn't clear what PB2 does yet, but tacho doesn't work without setting it high. @@ -242,11 +243,11 @@ pbio_error_t pbdrv_motor_get_id(pbio_port_t port, pbio_iodev_type_id_t *id) { } *id = iodev->info->type_id; - + return PBIO_SUCCESS; } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT void _pbdrv_motor_deinit(void) { // disable the PWM timers TIM3->CR1 &= TIM_CR1_CEN; diff --git a/lib/pbio/drv/move_hub/bluetooth.c b/lib/pbio/drv/move_hub/bluetooth.c index 197838354..9c12d3dbb 100644 --- a/lib/pbio/drv/move_hub/bluetooth.c +++ b/lib/pbio/drv/move_hub/bluetooth.c @@ -6,6 +6,7 @@ #include #include +#include "pbio/config.h" #include "pbio/error.h" #include "pbio/event.h" #include "pbsys/sys.h" @@ -151,7 +152,7 @@ static void spi_init() { NVIC_EnableIRQ(EXTI2_3_IRQn); } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT static void bluetooth_deinit() { // nRESET // set PB6 output low diff --git a/lib/pbio/drv/move_hub/button.c b/lib/pbio/drv/move_hub/button.c index f7221d600..688efd97e 100644 --- a/lib/pbio/drv/move_hub/button.c +++ b/lib/pbio/drv/move_hub/button.c @@ -2,6 +2,7 @@ // Copyright (c) 2018 David Lechner #include +#include #include #include @@ -15,7 +16,7 @@ void _pbdrv_button_init(void) { GPIOC->MODER = (GPIOC->MODER & ~GPIO_MODER_MODER13_Msk) | (0 << GPIO_MODER_MODER13_Pos); } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT void _pbdrv_button_deinit(void) { } #endif diff --git a/lib/pbio/drv/move_hub/light.c b/lib/pbio/drv/move_hub/light.c index d4d83a68d..09343f17b 100644 --- a/lib/pbio/drv/move_hub/light.c +++ b/lib/pbio/drv/move_hub/light.c @@ -2,8 +2,9 @@ // Copyright (c) 2018 David Lechner #include -#include +#include #include +#include #include "stm32f070xb.h" @@ -49,7 +50,7 @@ void _pbdrv_light_init(void) { TIM15->CCR2 = 0; } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT // turn off the light void _pbdrv_light_deinit(void) { TIM15->CR1 &= ~TIM_CR1_CEN; diff --git a/lib/pbio/drv/move_hub/motor.c b/lib/pbio/drv/move_hub/motor.c index ad237f172..d960b2725 100644 --- a/lib/pbio/drv/move_hub/motor.c +++ b/lib/pbio/drv/move_hub/motor.c @@ -8,6 +8,7 @@ #include "stm32f070xb.h" #include +#include #define PBIO_MOTOR_BUF_SIZE 32 // must be power of 2! @@ -515,7 +516,7 @@ pbio_error_t pbdrv_motor_get_id(pbio_port_t port, pbio_iodev_type_id_t *id) { return PBIO_ERROR_INVALID_PORT; } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT void _pbdrv_motor_deinit(void) { // disable the PWM timers TIM1->CR1 &= TIM_CR1_CEN; diff --git a/lib/pbio/include/pbdrv/button.h b/lib/pbio/include/pbdrv/button.h index 0ba2ba1f0..1b9608bcd 100644 --- a/lib/pbio/include/pbdrv/button.h +++ b/lib/pbio/include/pbdrv/button.h @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -32,7 +33,7 @@ void _pbdrv_button_init(void); * Releases the low level button driver. No button functions can be called after * calling this function. */ -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT void _pbdrv_button_deinit(void); #else static inline void _pbdrv_button_deinit(void) { } diff --git a/lib/pbio/include/pbdrv/light.h b/lib/pbio/include/pbdrv/light.h index d9142e63f..fc4666ee3 100644 --- a/lib/pbio/include/pbdrv/light.h +++ b/lib/pbio/include/pbdrv/light.h @@ -13,6 +13,7 @@ #include +#include #include #include #include @@ -31,7 +32,7 @@ void _pbdrv_light_init(void); * Releases the low level light driver. No light functions can be called after * calling this function. */ -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT void _pbdrv_light_deinit(void); #else static inline void _pbdrv_light_deinit(void) { } diff --git a/lib/pbio/include/pbdrv/motor.h b/lib/pbio/include/pbdrv/motor.h index eec08a489..3f962ff39 100644 --- a/lib/pbio/include/pbdrv/motor.h +++ b/lib/pbio/include/pbdrv/motor.h @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -35,7 +36,7 @@ void _pbdrv_motor_init(void); * Releases the low level motor driver. No motor functions can be called after * calling this function. */ -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT void _pbdrv_motor_deinit(void); #else static inline void _pbdrv_motor_deinit(void) { } diff --git a/lib/pbio/include/pbio/config.h b/lib/pbio/include/pbio/config.h new file mode 100644 index 000000000..b8519011e --- /dev/null +++ b/lib/pbio/include/pbio/config.h @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT +// Copyright (c) 2019 David Lechner + +#ifndef _PBIO_CONFIG_H_ +#define _PBIO_CONFIG_H_ + +// This file should be defined by applications that use the PBIO library. +#include "pbioconfig.h" + +#ifndef PBIO_CONFIG_ENABLE_SYS +#define PBIO_CONFIG_ENABLE_SYS (0) +#endif + +#ifndef PBIO_CONFIG_ENABLE_DEINIT +#define PBIO_CONFIG_ENABLE_DEINIT (1) +#endif + +#ifndef PBIO_CONFIG_DISABLE_UARTDEV +#define PBIO_CONFIG_DISABLE_UARTDEV (0) +#endif + +#endif // _PBIO_CONFIG_H_ diff --git a/lib/pbio/include/pbio/main.h b/lib/pbio/include/pbio/main.h index 57e05b48a..c4b3b33e4 100644 --- a/lib/pbio/include/pbio/main.h +++ b/lib/pbio/include/pbio/main.h @@ -4,10 +4,12 @@ #ifndef _PBIO_MAIN_H_ #define _PBIO_MAIN_H_ +#include "pbio/config.h" + void pbio_init(void); int pbio_do_one_event(void); -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT void pbio_deinit(void); #else static inline void pbio_deinit(void) { } diff --git a/lib/pbio/include/pbsys/sys.h b/lib/pbio/include/pbsys/sys.h index 7c81472f9..e6df11d22 100644 --- a/lib/pbio/include/pbsys/sys.h +++ b/lib/pbio/include/pbsys/sys.h @@ -19,6 +19,7 @@ #include #include +#include "pbio/config.h" #include "pbio/error.h" #include "sys/process.h" @@ -54,7 +55,7 @@ typedef struct { pbsys_stdin_event_callback_t stdin_event; } pbsys_user_program_callbacks_t; -#ifdef PBIO_CONFIG_ENABLE_SYS +#if PBIO_CONFIG_ENABLE_SYS /** * Performs platform-specific preperation for running a user program. diff --git a/lib/pbio/src/main.c b/lib/pbio/src/main.c index ac05cee72..e91e1303f 100644 --- a/lib/pbio/src/main.c +++ b/lib/pbio/src/main.c @@ -17,6 +17,7 @@ #include "pbdrv/motor.h" #include "pbdrv/uart.h" #include "pbsys/sys.h" +#include "pbio/config.h" #include "pbio/motor.h" #include "pbio/uartdev.h" @@ -49,7 +50,7 @@ AUTOSTART_PROCESSES( #ifndef PBIO_CONFIG_DISABLE_UARTDEV ,&pbio_uartdev_process #endif -#ifdef PBIO_CONFIG_ENABLE_SYS +#if PBIO_CONFIG_ENABLE_SYS ,&pbsys_process #endif ); @@ -61,14 +62,14 @@ AUTOSTART_PROCESSES( */ void pbio_init(void) { clock_init(); -#ifdef PBIO_CONFIG_ENABLE_SYS +#if PBIO_CONFIG_ENABLE_SYS process_init(); #endif _pbdrv_button_init(); _pbdrv_light_init(); _pbdrv_motor_init(); _pbio_motorcontroll_init(); -#ifdef PBIO_CONFIG_ENABLE_SYS +#if PBIO_CONFIG_ENABLE_SYS autostart_start(autostart_processes); #endif } @@ -93,21 +94,21 @@ int pbio_do_one_event(void) { _pbio_light_poll(now); prev_slow_poll_time = now; } -#ifdef PBIO_CONFIG_ENABLE_SYS +#if PBIO_CONFIG_ENABLE_SYS return process_run(); #else return 0; #endif } -#ifdef PBIO_CONFIG_ENABLE_DEINIT +#if PBIO_CONFIG_ENABLE_DEINIT /** * Releases all resources used by the library. Calling this function is * optional. It should be called once at the end of a program. No other * functions may be called after this. */ void pbio_deinit(void) { -#ifdef PBIO_CONFIG_ENABLE_SYS +#if PBIO_CONFIG_ENABLE_SYS autostart_exit(autostart_processes); #endif _pbdrv_motor_deinit();