Skip to content

Commit

Permalink
tree-wide: include contriki.h instead of sys/*.h
Browse files Browse the repository at this point in the history
Since we are treating contiki as more of an external library now, use
the provided contiki.h instead of including individual header files.

A few items in contiki.h had to be disabled since they are not
implemented or otherwise shouldn't be needed.
  • Loading branch information
dlech committed Dec 17, 2019
1 parent d784184 commit 8c88b77
Show file tree
Hide file tree
Showing 38 changed files with 81 additions and 99 deletions.
2 changes: 1 addition & 1 deletion bricks/cityhub/mphalport.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2018 David Lechner

#include "sys/clock.h"
#include <contiki.h>

void mp_hal_set_interrupt_char(int c);
#define mp_hal_ticks_ms clock_time
Expand Down
2 changes: 1 addition & 1 deletion bricks/cplushub/mphalport.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2018 David Lechner

#include "sys/clock.h"
#include <contiki.h>

void mp_hal_set_interrupt_char(int c);
#define mp_hal_ticks_ms clock_time
Expand Down
2 changes: 1 addition & 1 deletion bricks/debug/mphalport.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2018 David Lechner

#include "sys/clock.h"
#include <contiki.h>

void mp_hal_set_interrupt_char(int c);
#define mp_hal_ticks_ms clock_time
Expand Down
2 changes: 1 addition & 1 deletion bricks/movehub/mphalport.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2018 David Lechner

#include "sys/clock.h"
#include <contiki.h>

void mp_hal_set_interrupt_char(int c);
#define mp_hal_ticks_ms clock_time
Expand Down
2 changes: 1 addition & 1 deletion bricks/nxt/mphalport.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2018 David Lechner

#include "sys/clock.h"
#include <contiki.h>

void mp_hal_set_interrupt_char(int c);
#define mp_hal_ticks_ms clock_time
Expand Down
8 changes: 4 additions & 4 deletions lib/contiki-core/contiki.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@

#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"

#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_ */
3 changes: 2 additions & 1 deletion lib/pbio/drv/adc/adc_stm32_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
#include <stdbool.h>
#include <stdint.h>

#include <contiki.h>

#include <pbio/error.h>
#include <pbio/util.h>
#include "sys/process.h"

#include STM32_HAL_H

Expand Down
3 changes: 2 additions & 1 deletion lib/pbio/drv/adc/adc_stm32f0.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
#include <stdbool.h>
#include <stdint.h>

#include <contiki.h>

#include <pbio/config.h>
#include <pbio/error.h>
#include "sys/process.h"

#include "stm32f0xx.h"

Expand Down
4 changes: 2 additions & 2 deletions lib/pbio/drv/battery/battery_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

#include <stdbool.h>

#include <pbdrv/adc.h>
#include <contiki.h>

#include <pbdrv/adc.h>
#include <pbio/error.h>
#include <sys/process.h>

PROCESS(pbdrv_battery_process, "battery");

Expand Down
3 changes: 2 additions & 1 deletion lib/pbio/drv/battery/battery_linux_ev3.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
#include <stdbool.h>
#include <stdio.h>

#include <contiki.h>

#include <pbio/error.h>
#include <sys/process.h>

PROCESS(pbdrv_battery_process, "battery");

Expand Down
5 changes: 3 additions & 2 deletions lib/pbio/drv/battery/battery_nxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
#include <stdbool.h>
#include <stdio.h>

#include <contiki.h>
#include <nxt/nxt_avr.h>

#include <pbio/error.h>
#include <sys/process.h>

#include <nxt/nxt_avr.h>

PROCESS(pbdrv_battery_process, "battery");

Expand Down
3 changes: 2 additions & 1 deletion lib/pbio/drv/counter/counter_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
#include <stdbool.h>
#include <stdio.h>

#include <contiki.h>

#include <pbdrv/counter.h>
#include <pbio/error.h>
#include "sys/process.h"
#include "counter.h"
#include "counter_nxt.h"
#include "counter_ev3dev_stretch_iio.h"
Expand Down
4 changes: 2 additions & 2 deletions lib/pbio/drv/ev3dev_stretch/nxtcolor.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <stdio.h>
#include <string.h>

#include <contiki.h>

#include <pbdrv/ev3sensor.h>
#include <pbdrv/ev3devsysfs.h>
#include <pbio/ev3device.h>
Expand All @@ -14,8 +16,6 @@
#include <pbio/iodev.h>
#include <pbio/light.h>

#include "sys/clock.h"

#define IN (0)
#define OUT (1)

Expand Down
4 changes: 1 addition & 3 deletions lib/pbio/drv/ioport/ioport_ev3dev_stretch.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
#include <stdbool.h>
#include <stdio.h>

#include <contiki.h>
#include <libudev.h>
#include <uthash.h>

#include <pbio/error.h>
#include <pbio/iodev.h>
#include <pbio/port.h>

#include "sys/etimer.h"
#include "sys/process.h"

typedef struct {
const char *name;
struct udev_device *device;
Expand Down
4 changes: 2 additions & 2 deletions lib/pbio/drv/ioport/ioport_lpf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
#include <stdbool.h>
#include <stdio.h>

#include <contiki.h>

#include <pbdrv/gpio.h>
#include <pbio/error.h>
#include <pbio/iodev.h>
#include <pbio/uartdev.h>

#include "ioport_lpf2.h"
#include "sys/etimer.h"
#include "sys/process.h"

typedef enum _dev_id1_group_t {
DEV_ID1_GROUP_GND,
Expand Down
6 changes: 2 additions & 4 deletions lib/pbio/drv/move_hub/bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
#include <stdio.h>
#include <string.h>

#include <contiki.h>

#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"
Expand Down
4 changes: 2 additions & 2 deletions lib/pbio/drv/uart/uart_stm32_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#include <stdint.h>
#include <stdio.h>

#include <contiki.h>

#include <pbdrv/uart.h>
#include <pbio/error.h>
#include <pbio/util.h>

#include "sys/etimer.h"
#include "sys/process.h"
#include "../../src/processes.h"

#include STM32_HAL_H
Expand Down
4 changes: 2 additions & 2 deletions lib/pbio/drv/uart/uart_stm32f0.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#include <stdint.h>
#include <stdio.h>

#include <contiki.h>

#include <pbdrv/uart.h>
#include <pbio/error.h>
#include <pbio/util.h>

#include "sys/etimer.h"
#include "sys/process.h"
#include "../../src/processes.h"

#include "stm32f0xx.h"
Expand Down
5 changes: 2 additions & 3 deletions lib/pbio/platform/city_hub/clock.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2013, 2014 Damien P. George

#include <pbdrv/config.h>
#include <contiki.h>

#include "sys/clock.h"
#include "sys/etimer.h"
#include <pbdrv/config.h>

#include "stm32f030xc.h"

Expand Down
6 changes: 2 additions & 4 deletions lib/pbio/platform/city_hub/sys.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2018 David Lechner

#include <contiki.h>

#include "pbdrv/battery.h"
#include "pbdrv/bluetooth.h"
#include "pbdrv/config.h"
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions lib/pbio/platform/cplus_hub/clock.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2013, 2014 Damien P. George

#include <pbdrv/config.h>
#include <contiki.h>

#include "sys/clock.h"
#include "sys/etimer.h"
#include <pbdrv/config.h>

#include "stm32l431xx.h"

Expand Down
7 changes: 2 additions & 5 deletions lib/pbio/platform/cplus_hub/sys.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2019 David Lechner

#include <string.h>
#include <contiki.h>

#include "pbdrv/bluetooth.h"
#include "pbdrv/config.h"
#include "pbdrv/light.h"

Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions lib/pbio/platform/debug/clock.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2013, 2014 Damien P. George

#include <pbdrv/config.h>
#include <contiki.h>

#include "sys/clock.h"
#include "sys/etimer.h"
#include <pbdrv/config.h>

#include "stm32f446xx.h"

Expand Down
6 changes: 2 additions & 4 deletions lib/pbio/platform/debug/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <string.h>

#include <contiki.h>

#include "pbdrv/config.h"
#include "pbdrv/light.h"

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/pbio/platform/ev3dev_stretch/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <stdint.h>
#include <unistd.h>

#include "sys/clock.h"
#include <contiki.h>

void clock_init(void) {
}
Expand Down
5 changes: 2 additions & 3 deletions lib/pbio/platform/move_hub/clock.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2013, 2014 Damien P. George

#include <pbdrv/config.h>
#include <contiki.h>

#include "sys/clock.h"
#include "sys/etimer.h"
#include <pbdrv/config.h>

#include "stm32f070xb.h"

Expand Down
6 changes: 2 additions & 4 deletions lib/pbio/platform/move_hub/sys.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2018 David Lechner

#include <contiki.h>

#include "pbdrv/battery.h"
#include "pbdrv/bluetooth.h"
#include "pbdrv/config.h"
Expand All @@ -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
Expand Down
Loading

0 comments on commit 8c88b77

Please sign in to comment.