diff --git a/bricks/cityhub/mphalport.h b/bricks/cityhub/mphalport.h index ae6a7d8ad..fafc4c18c 100644 --- a/bricks/cityhub/mphalport.h +++ b/bricks/cityhub/mphalport.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2018 David Lechner -#include "sys/clock.h" +#include void mp_hal_set_interrupt_char(int c); #define mp_hal_ticks_ms clock_time diff --git a/bricks/cplushub/mphalport.h b/bricks/cplushub/mphalport.h index ae6a7d8ad..fafc4c18c 100644 --- a/bricks/cplushub/mphalport.h +++ b/bricks/cplushub/mphalport.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2018 David Lechner -#include "sys/clock.h" +#include void mp_hal_set_interrupt_char(int c); #define mp_hal_ticks_ms clock_time diff --git a/bricks/debug/mphalport.h b/bricks/debug/mphalport.h index ae6a7d8ad..fafc4c18c 100644 --- a/bricks/debug/mphalport.h +++ b/bricks/debug/mphalport.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2018 David Lechner -#include "sys/clock.h" +#include void mp_hal_set_interrupt_char(int c); #define mp_hal_ticks_ms clock_time diff --git a/bricks/movehub/mphalport.h b/bricks/movehub/mphalport.h index ae6a7d8ad..fafc4c18c 100644 --- a/bricks/movehub/mphalport.h +++ b/bricks/movehub/mphalport.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2018 David Lechner -#include "sys/clock.h" +#include void mp_hal_set_interrupt_char(int c); #define mp_hal_ticks_ms clock_time diff --git a/bricks/nxt/mphalport.h b/bricks/nxt/mphalport.h index ae6a7d8ad..fafc4c18c 100644 --- a/bricks/nxt/mphalport.h +++ b/bricks/nxt/mphalport.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2018 David Lechner -#include "sys/clock.h" +#include void mp_hal_set_interrupt_char(int c); #define mp_hal_ticks_ms clock_time diff --git a/lib/contiki-core/contiki.h b/lib/contiki-core/contiki.h index 804c3dab0..a39a5ed68 100644 --- a/lib/contiki-core/contiki.h +++ b/lib/contiki-core/contiki.h @@ -36,7 +36,7 @@ #include "contiki-version.h" #include "contiki-conf.h" -#include "contiki-default-conf.h" +// #include "contiki-default-conf.h" #include "sys/process.h" #include "sys/autostart.h" @@ -44,15 +44,15 @@ #include "sys/timer.h" #include "sys/ctimer.h" #include "sys/etimer.h" -#include "sys/rtimer.h" +// #include "sys/rtimer.h" #include "sys/pt.h" #include "sys/procinit.h" -#include "sys/loader.h" +// #include "sys/loader.h" #include "sys/clock.h" -#include "sys/energest.h" +// #include "sys/energest.h" #endif /* CONTIKI_H_ */ diff --git a/lib/pbio/drv/adc/adc_stm32_hal.c b/lib/pbio/drv/adc/adc_stm32_hal.c index 17e548d82..fe5632608 100644 --- a/lib/pbio/drv/adc/adc_stm32_hal.c +++ b/lib/pbio/drv/adc/adc_stm32_hal.c @@ -26,9 +26,10 @@ #include #include +#include + #include #include -#include "sys/process.h" #include STM32_HAL_H diff --git a/lib/pbio/drv/adc/adc_stm32f0.c b/lib/pbio/drv/adc/adc_stm32f0.c index d358d5deb..0150f32df 100644 --- a/lib/pbio/drv/adc/adc_stm32f0.c +++ b/lib/pbio/drv/adc/adc_stm32f0.c @@ -8,9 +8,10 @@ #include #include +#include + #include #include -#include "sys/process.h" #include "stm32f0xx.h" diff --git a/lib/pbio/drv/battery/battery_adc.c b/lib/pbio/drv/battery/battery_adc.c index 72c4fafae..73e3563c3 100644 --- a/lib/pbio/drv/battery/battery_adc.c +++ b/lib/pbio/drv/battery/battery_adc.c @@ -9,10 +9,10 @@ #include -#include +#include +#include #include -#include PROCESS(pbdrv_battery_process, "battery"); diff --git a/lib/pbio/drv/battery/battery_linux_ev3.c b/lib/pbio/drv/battery/battery_linux_ev3.c index c64c62ed7..f287eee0b 100644 --- a/lib/pbio/drv/battery/battery_linux_ev3.c +++ b/lib/pbio/drv/battery/battery_linux_ev3.c @@ -11,8 +11,9 @@ #include #include +#include + #include -#include PROCESS(pbdrv_battery_process, "battery"); diff --git a/lib/pbio/drv/battery/battery_nxt.c b/lib/pbio/drv/battery/battery_nxt.c index 0cde35d35..08c5918ad 100644 --- a/lib/pbio/drv/battery/battery_nxt.c +++ b/lib/pbio/drv/battery/battery_nxt.c @@ -10,10 +10,11 @@ #include #include +#include +#include + #include -#include -#include PROCESS(pbdrv_battery_process, "battery"); diff --git a/lib/pbio/drv/counter/counter_core.c b/lib/pbio/drv/counter/counter_core.c index 942328aba..b62269c7b 100644 --- a/lib/pbio/drv/counter/counter_core.c +++ b/lib/pbio/drv/counter/counter_core.c @@ -8,9 +8,10 @@ #include #include +#include + #include #include -#include "sys/process.h" #include "counter.h" #include "counter_nxt.h" #include "counter_ev3dev_stretch_iio.h" diff --git a/lib/pbio/drv/ev3dev_stretch/nxtcolor.c b/lib/pbio/drv/ev3dev_stretch/nxtcolor.c index 2c01d9065..ff14477ce 100644 --- a/lib/pbio/drv/ev3dev_stretch/nxtcolor.c +++ b/lib/pbio/drv/ev3dev_stretch/nxtcolor.c @@ -6,6 +6,8 @@ #include #include +#include + #include #include #include @@ -14,8 +16,6 @@ #include #include -#include "sys/clock.h" - #define IN (0) #define OUT (1) diff --git a/lib/pbio/drv/ioport/ioport_ev3dev_stretch.c b/lib/pbio/drv/ioport/ioport_ev3dev_stretch.c index 298f14784..17ff17629 100644 --- a/lib/pbio/drv/ioport/ioport_ev3dev_stretch.c +++ b/lib/pbio/drv/ioport/ioport_ev3dev_stretch.c @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -19,9 +20,6 @@ #include #include -#include "sys/etimer.h" -#include "sys/process.h" - typedef struct { const char *name; struct udev_device *device; diff --git a/lib/pbio/drv/ioport/ioport_lpf2.c b/lib/pbio/drv/ioport/ioport_lpf2.c index 3711af950..98375f15f 100644 --- a/lib/pbio/drv/ioport/ioport_lpf2.c +++ b/lib/pbio/drv/ioport/ioport_lpf2.c @@ -10,14 +10,14 @@ #include #include +#include + #include #include #include #include #include "ioport_lpf2.h" -#include "sys/etimer.h" -#include "sys/process.h" typedef enum _dev_id1_group_t { DEV_ID1_GROUP_GND, diff --git a/lib/pbio/drv/move_hub/bluetooth.c b/lib/pbio/drv/move_hub/bluetooth.c index 80659fbd9..acde8f53a 100644 --- a/lib/pbio/drv/move_hub/bluetooth.c +++ b/lib/pbio/drv/move_hub/bluetooth.c @@ -6,14 +6,12 @@ #include #include +#include + #include "pbio/config.h" #include "pbio/error.h" #include "pbio/event.h" #include "pbsys/sys.h" -#include "sys/autostart.h" -#include "sys/etimer.h" -#include "sys/process.h" -#include "sys/pt.h" #include "../../src/processes.h" #include "bluenrg_aci.h" diff --git a/lib/pbio/drv/uart/uart_stm32_hal.c b/lib/pbio/drv/uart/uart_stm32_hal.c index 81303fe7c..0f0bb8232 100644 --- a/lib/pbio/drv/uart/uart_stm32_hal.c +++ b/lib/pbio/drv/uart/uart_stm32_hal.c @@ -9,12 +9,12 @@ #include #include +#include + #include #include #include -#include "sys/etimer.h" -#include "sys/process.h" #include "../../src/processes.h" #include STM32_HAL_H diff --git a/lib/pbio/drv/uart/uart_stm32f0.c b/lib/pbio/drv/uart/uart_stm32f0.c index c2ba12f33..c65f2ca2d 100644 --- a/lib/pbio/drv/uart/uart_stm32f0.c +++ b/lib/pbio/drv/uart/uart_stm32f0.c @@ -15,12 +15,12 @@ #include #include +#include + #include #include #include -#include "sys/etimer.h" -#include "sys/process.h" #include "../../src/processes.h" #include "stm32f0xx.h" diff --git a/lib/pbio/platform/city_hub/clock.c b/lib/pbio/platform/city_hub/clock.c index 6d4380f30..41818843a 100644 --- a/lib/pbio/platform/city_hub/clock.c +++ b/lib/pbio/platform/city_hub/clock.c @@ -1,10 +1,9 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2013, 2014 Damien P. George -#include +#include -#include "sys/clock.h" -#include "sys/etimer.h" +#include #include "stm32f030xc.h" diff --git a/lib/pbio/platform/city_hub/sys.c b/lib/pbio/platform/city_hub/sys.c index b571e0a5b..a9f07485c 100644 --- a/lib/pbio/platform/city_hub/sys.c +++ b/lib/pbio/platform/city_hub/sys.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2018 David Lechner +#include + #include "pbdrv/battery.h" #include "pbdrv/bluetooth.h" #include "pbdrv/config.h" @@ -13,10 +15,6 @@ #include "pbsys/sys.h" -#include "sys/clock.h" -#include "sys/etimer.h" -#include "sys/process.h" - #include "stm32f030xc.h" // workaround upstream NVIC_SystemReset() not decorated with noreturn diff --git a/lib/pbio/platform/cplus_hub/clock.c b/lib/pbio/platform/cplus_hub/clock.c index cfb3900b5..4e2973c0c 100644 --- a/lib/pbio/platform/cplus_hub/clock.c +++ b/lib/pbio/platform/cplus_hub/clock.c @@ -1,10 +1,9 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2013, 2014 Damien P. George -#include +#include -#include "sys/clock.h" -#include "sys/etimer.h" +#include #include "stm32l431xx.h" diff --git a/lib/pbio/platform/cplus_hub/sys.c b/lib/pbio/platform/cplus_hub/sys.c index 21e68c65b..cf14cfbf1 100644 --- a/lib/pbio/platform/cplus_hub/sys.c +++ b/lib/pbio/platform/cplus_hub/sys.c @@ -1,8 +1,9 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2019 David Lechner -#include +#include +#include "pbdrv/bluetooth.h" #include "pbdrv/config.h" #include "pbdrv/light.h" @@ -13,10 +14,6 @@ #include "pbsys/sys.h" -#include "sys/clock.h" -#include "sys/etimer.h" -#include "sys/process.h" - #include "stm32l4xx.h" // workaround upstream NVIC_SystemReset() not decorated with noreturn diff --git a/lib/pbio/platform/debug/clock.c b/lib/pbio/platform/debug/clock.c index 6fdd481a8..8419a4384 100644 --- a/lib/pbio/platform/debug/clock.c +++ b/lib/pbio/platform/debug/clock.c @@ -1,10 +1,9 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2013, 2014 Damien P. George -#include +#include -#include "sys/clock.h" -#include "sys/etimer.h" +#include #include "stm32f446xx.h" diff --git a/lib/pbio/platform/debug/sys.c b/lib/pbio/platform/debug/sys.c index 868c187c5..5fcec877f 100644 --- a/lib/pbio/platform/debug/sys.c +++ b/lib/pbio/platform/debug/sys.c @@ -3,6 +3,8 @@ #include +#include + #include "pbdrv/config.h" #include "pbdrv/light.h" @@ -12,10 +14,6 @@ #include "pbsys/sys.h" -#include "sys/clock.h" -#include "sys/etimer.h" -#include "sys/process.h" - #include "stm32f4xx.h" // workaround upstream NVIC_SystemReset() not decorated with noreturn diff --git a/lib/pbio/platform/ev3dev_stretch/clock.c b/lib/pbio/platform/ev3dev_stretch/clock.c index 3e0e38620..7f2621e5e 100644 --- a/lib/pbio/platform/ev3dev_stretch/clock.c +++ b/lib/pbio/platform/ev3dev_stretch/clock.c @@ -5,7 +5,7 @@ #include #include -#include "sys/clock.h" +#include void clock_init(void) { } diff --git a/lib/pbio/platform/move_hub/clock.c b/lib/pbio/platform/move_hub/clock.c index 8490ba579..712fa1556 100644 --- a/lib/pbio/platform/move_hub/clock.c +++ b/lib/pbio/platform/move_hub/clock.c @@ -1,10 +1,9 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2013, 2014 Damien P. George -#include +#include -#include "sys/clock.h" -#include "sys/etimer.h" +#include #include "stm32f070xb.h" diff --git a/lib/pbio/platform/move_hub/sys.c b/lib/pbio/platform/move_hub/sys.c index a2605c4fc..439988f89 100644 --- a/lib/pbio/platform/move_hub/sys.c +++ b/lib/pbio/platform/move_hub/sys.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2018 David Lechner +#include + #include "pbdrv/battery.h" #include "pbdrv/bluetooth.h" #include "pbdrv/config.h" @@ -13,10 +15,6 @@ #include "pbsys/sys.h" -#include "sys/clock.h" -#include "sys/etimer.h" -#include "sys/process.h" - #include "stm32f070xb.h" // workaround upstream NVIC_SystemReset() not decorated with noreturn diff --git a/lib/pbio/platform/nxt/clock.c b/lib/pbio/platform/nxt/clock.c index 39c7ee4e6..60f34d4a0 100644 --- a/lib/pbio/platform/nxt/clock.c +++ b/lib/pbio/platform/nxt/clock.c @@ -1,14 +1,13 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2013, 2014 Damien P. George -#include - -#include "sys/clock.h" -#include "sys/etimer.h" +#include #include #include +#include + #if CLOCK_CONF_SECOND != 1000 #error Clock must be set to 1 msec ticks #endif diff --git a/lib/pbio/platform/nxt/sys.c b/lib/pbio/platform/nxt/sys.c index a7b1f5e6f..f41e0b8d4 100644 --- a/lib/pbio/platform/nxt/sys.c +++ b/lib/pbio/platform/nxt/sys.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2018 David Lechner +#include + #include "pbdrv/battery.h" #include "pbdrv/bluetooth.h" #include "pbdrv/config.h" @@ -12,10 +14,6 @@ #include "pbsys/sys.h" -#include "sys/clock.h" -#include "sys/etimer.h" -#include "sys/process.h" - // workaround upstream NVIC_SystemReset() not decorated with noreturn void NVIC_SystemReset(void) __attribute__((noreturn)); void NVIC_SystemReset(void) { diff --git a/lib/pbio/src/ioport/ioport_lpf2.c b/lib/pbio/src/ioport/ioport_lpf2.c index bc5352e43..bf8f7c693 100644 --- a/lib/pbio/src/ioport/ioport_lpf2.c +++ b/lib/pbio/src/ioport/ioport_lpf2.c @@ -10,12 +10,12 @@ #include #include +#include + #include "pbdrv/config.h" #include "pbdrv/gpio.h" #include "pbio/error.h" #include "pbio/iodev.h" -#include "sys/etimer.h" -#include "sys/process.h" typedef enum _dev_id1_group_t { DEV_ID1_GROUP_GND, diff --git a/lib/pbio/src/logger.c b/lib/pbio/src/logger.c index 495a4c509..4db8b883c 100644 --- a/lib/pbio/src/logger.c +++ b/lib/pbio/src/logger.c @@ -6,11 +6,11 @@ #include #include +#include + #include #include -#include "sys/clock.h" - static void pbio_logger_delete(pbio_log_t *log) { // Free log if any if (log->len > 0) { @@ -68,7 +68,7 @@ pbio_error_t pbio_logger_update(pbio_log_t *log, int32_t *buf) { if (log->sampled > log->len) { log->active = false; return PBIO_ERROR_FAILED; - } + } // Stop successfully when done if (log->sampled == log->len) { diff --git a/lib/pbio/src/main.c b/lib/pbio/src/main.c index 44f064c41..4974fb1bb 100644 --- a/lib/pbio/src/main.c +++ b/lib/pbio/src/main.c @@ -8,6 +8,8 @@ #include +#include + #include "pbdrv/button.h" #include "pbdrv/config.h" #include "pbdrv/light.h" @@ -17,10 +19,6 @@ #include "pbio/servo.h" #include "pbio/uartdev.h" -#include "sys/autostart.h" -#include "sys/clock.h" -#include "sys/etimer.h" -#include "sys/process.h" #include "processes.h" static uint32_t prev_fast_poll_time; diff --git a/lib/pbio/src/processes.h b/lib/pbio/src/processes.h index 071c4066c..c3cab893b 100644 --- a/lib/pbio/src/processes.h +++ b/lib/pbio/src/processes.h @@ -4,9 +4,9 @@ #ifndef _PBIO_PROCESSES_H_ #define _PBIO_PROCESSES_H_ -#include +#include -#include "sys/process.h" +#include // All of the contiki processes diff --git a/lib/pbio/src/serial.c b/lib/pbio/src/serial.c index 6c331e096..cc2e15f0f 100644 --- a/lib/pbio/src/serial.c +++ b/lib/pbio/src/serial.c @@ -12,13 +12,13 @@ #include #include +#include + #include #include #include #include -#include "sys/clock.h" - struct _pbio_serial_t { pbdrv_serial_t *dev; int timeout; diff --git a/lib/pbio/src/servo.c b/lib/pbio/src/servo.c index 4545813e9..8ad09799f 100644 --- a/lib/pbio/src/servo.c +++ b/lib/pbio/src/servo.c @@ -5,13 +5,13 @@ #include #include +#include + #include #include #include #include -#include "sys/clock.h" - #if PBDRV_CONFIG_NUM_MOTOR_CONTROLLER != 0 // TODO: Generalize and move to config: @@ -27,7 +27,7 @@ pbio_error_t pbio_config_get_defaults_servo(pbio_iodev_type_id_t id, int32_t *tight_loop_time, int32_t *position_tolerance, int32_t *speed_tolerance, - int32_t *stall_speed_limit, + int32_t *stall_speed_limit, int32_t *stall_time) { // Default counts per degree *counts_per_degree = F16C(PBDRV_CONFIG_COUNTER_COUNTS_PER_DEGREE, 0); @@ -160,7 +160,7 @@ static pbio_error_t pbio_servo_setup(pbio_servo_t *srv, pbio_direction_t directi return err; } - // Configure the logs for a servo + // Configure the logs for a servo srv->log.num_values = SERVO_LOG_NUM_VALUES; return PBIO_SUCCESS; @@ -312,7 +312,7 @@ static pbio_error_t control_update_actuate(pbio_servo_t *srv, pbio_actuation_t a err = pbio_hbridge_set_duty_cycle_sys(srv->hbridge, control); break; } - + // Handle errors during actuation if (err != PBIO_SUCCESS) { // Attempt lowest level coast: turn off power @@ -337,7 +337,7 @@ static pbio_error_t pbio_servo_log_update(pbio_servo_t *srv, ustime_t time_now, // Not applicable for passive motors buf[0] = 0; } - + // Log the physical state of the motor buf[1] = count_now; buf[2] = rate_now; @@ -387,11 +387,11 @@ pbio_error_t pbio_servo_control_update(pbio_servo_t *srv) { err = control_update_time_target(&srv->control, time_now, count_now, rate_now, &actuation, &control); } else { - return PBIO_ERROR_INVALID_OP; + return PBIO_ERROR_INVALID_OP; } if (err != PBIO_SUCCESS) { return err; - } + } // Apply the control type and signal err = control_update_actuate(srv, actuation, control); if (err != PBIO_SUCCESS) { diff --git a/lib/pbio/src/sound.c b/lib/pbio/src/sound.c index 326e160d6..359023a5c 100644 --- a/lib/pbio/src/sound.c +++ b/lib/pbio/src/sound.c @@ -10,13 +10,13 @@ #include #include -#include -#include +#include #include #include +#include +#include -#include "sys/clock.h" struct _pbio_sound_t { pbdrv_beep_dev_t *beep_dev; diff --git a/lib/pbio/src/trajectory.c b/lib/pbio/src/trajectory.c index ac4b1dac9..d6650e03c 100644 --- a/lib/pbio/src/trajectory.c +++ b/lib/pbio/src/trajectory.c @@ -6,12 +6,11 @@ #include #include -#include +#include +#include #include -#include "sys/clock.h" - void reverse_trajectory(pbio_control_trajectory_t *ref) { // Mirror angles about initial angle th0 ref->th1 = 2*ref->th0 - ref->th1; diff --git a/lib/pbio/src/uartdev.c b/lib/pbio/src/uartdev.c index a878eaeff..8ed230597 100644 --- a/lib/pbio/src/uartdev.c +++ b/lib/pbio/src/uartdev.c @@ -36,6 +36,8 @@ #include #include +#include + #include "pbdrv/config.h" #include "pbdrv/ioport.h" #include "pbdrv/uart.h" @@ -46,8 +48,6 @@ #include "pbio/uartdev.h" #include "pbio/util.h" #include "../drv/counter/counter.h" -#include "sys/etimer.h" -#include "sys/process.h" #define EV3_UART_MAX_MESSAGE_SIZE (PBIO_IODEV_MAX_DATA_SIZE + 2)