Skip to content

Commit

Permalink
pbdrv/config: remove unused config option
Browse files Browse the repository at this point in the history
These are redundant and not used anywhere.
  • Loading branch information
dlech committed Feb 19, 2021
1 parent 284b484 commit c4af5d7
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 41 deletions.
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 @@ -268,7 +268,7 @@ pbio_error_t pbdrv_ioport_get_iodev(pbio_port_t port, pbio_iodev_t **iodev) {
void pbio_ioport_reset_passive_devices(void) {
for (int i = 0; i < PBDRV_CONFIG_IOPORT_LPF2_NUM_PORTS; i++) {
if (ioport_devs[i].connected_type_id != PBIO_IODEV_TYPE_ID_LPF2_UNKNOWN_UART) {
pbdrv_motor_coast(i + PBDRV_CONFIG_FIRST_IO_PORT);
pbdrv_motor_coast(i + PBDRV_CONFIG_IOPORT_LPF2_FIRST_PORT);
}
}
}
Expand Down Expand Up @@ -516,7 +516,7 @@ PROCESS_THREAD(pbdrv_ioport_lpf2_process, ev, data) {
if (ioport->connected_type_id == PBIO_IODEV_TYPE_ID_LPF2_UNKNOWN_UART) {
ioport_enable_uart(ioport);
pbio_uartdev_get(i, &ioport->iodev);
ioport->iodev->port = i + PBDRV_CONFIG_FIRST_IO_PORT;
ioport->iodev->port = i + PBDRV_CONFIG_IOPORT_LPF2_FIRST_PORT;
} else if (ioport->connected_type_id == PBIO_IODEV_TYPE_ID_NONE) {
ioport->iodev = NULL;
} else {
Expand Down
19 changes: 0 additions & 19 deletions lib/pbio/include/pbdrv/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,6 @@
#define PBDRV_CONFIG_HAS_PORT_4 (0)
#endif

// the number of I/O ports in the programmable brick
#ifndef PBDRV_CONFIG_NUM_IO_PORT
#define PBDRV_CONFIG_NUM_IO_PORT (0)
#elif PBDRV_CONFIG_NUM_IO_PORT != 0

// the pbio_port_t enum value of the first I/O port
#ifndef PBDRV_CONFIG_FIRST_IO_PORT
#error PBDRV_CONFIG_NUM_IO_PORT requires that PBDRV_CONFIG_FIRST_IO_PORT is defined
#endif

// the pbio_port_t enum value of the last I/O port
#ifndef PBDRV_CONFIG_LAST_IO_PORT
#error PBDRV_CONFIG_NUM_IO_PORT requires that PBDRV_CONFIG_LAST_IO_PORT is defined
#endif
#endif

// the number of built-in motor controllers in the programmable brick
#ifndef PBDRV_CONFIG_NUM_MOTOR_CONTROLLER
#define PBDRV_CONFIG_NUM_MOTOR_CONTROLLER (0)
Expand All @@ -83,9 +67,6 @@
#define PBDRV_CONFIG_COUNTER_COUNTS_PER_DEGREE (1)
#endif

// The maximum number of motor pairs
#define PBDRV_CONFIG_NUM_MOTOR_PAIRS (PBDRV_CONFIG_NUM_MOTOR_CONTROLLER / 2)

// the pbio_port_t enum value of the first motor port
#ifndef PBDRV_CONFIG_FIRST_MOTOR_PORT
#error PBDRV_CONFIG_NUM_MOTOR_CONTROLLER requires that PBDRV_CONFIG_FIRST_MOTOR_PORT is defined
Expand Down
4 changes: 0 additions & 4 deletions lib/pbio/platform/city_hub/pbdrvconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@
#define PBDRV_CONFIG_HAS_PORT_A (1)
#define PBDRV_CONFIG_HAS_PORT_B (1)

#define PBDRV_CONFIG_FIRST_IO_PORT PBIO_PORT_A
#define PBDRV_CONFIG_LAST_IO_PORT PBIO_PORT_B
#define PBDRV_CONFIG_NUM_IO_PORT (2)

#define PBDRV_CONFIG_FIRST_MOTOR_PORT PBIO_PORT_A
#define PBDRV_CONFIG_LAST_MOTOR_PORT PBIO_PORT_B
#define PBDRV_CONFIG_NUM_MOTOR_CONTROLLER (2)
Expand Down
4 changes: 0 additions & 4 deletions lib/pbio/platform/debug/pbdrvconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@

#define PBDRV_CONFIG_HAS_PORT_1 (1)

#define PBDRV_CONFIG_FIRST_IO_PORT PBIO_PORT_1
#define PBDRV_CONFIG_LAST_IO_PORT PBIO_PORT_1
#define PBDRV_CONFIG_NUM_IO_PORT (1)

#define PBDRV_CONFIG_SYS_CLOCK_RATE 48000000

#endif // _PBDRVCONFIG_H_
4 changes: 0 additions & 4 deletions lib/pbio/platform/move_hub/pbdrvconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@
#define PBDRV_CONFIG_HAS_PORT_C (1)
#define PBDRV_CONFIG_HAS_PORT_D (1)

#define PBDRV_CONFIG_FIRST_IO_PORT PBIO_PORT_C
#define PBDRV_CONFIG_LAST_IO_PORT PBIO_PORT_D
#define PBDRV_CONFIG_NUM_IO_PORT (2)

#define PBDRV_CONFIG_FIRST_MOTOR_PORT PBIO_PORT_A
#define PBDRV_CONFIG_LAST_MOTOR_PORT PBIO_PORT_D
#define PBDRV_CONFIG_NUM_MOTOR_CONTROLLER (4)
Expand Down
4 changes: 0 additions & 4 deletions lib/pbio/platform/prime_hub/pbdrvconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@
#define PBDRV_CONFIG_HAS_PORT_E (1)
#define PBDRV_CONFIG_HAS_PORT_F (1)

#define PBDRV_CONFIG_FIRST_IO_PORT PBIO_PORT_A
#define PBDRV_CONFIG_LAST_IO_PORT PBIO_PORT_F
#define PBDRV_CONFIG_NUM_IO_PORT (6)

#define PBDRV_CONFIG_FIRST_MOTOR_PORT PBIO_PORT_A
#define PBDRV_CONFIG_LAST_MOTOR_PORT PBIO_PORT_F
#define PBDRV_CONFIG_NUM_MOTOR_CONTROLLER (6)
Expand Down
4 changes: 0 additions & 4 deletions lib/pbio/platform/technic_hub/pbdrvconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@
#define PBDRV_CONFIG_HAS_PORT_C (1)
#define PBDRV_CONFIG_HAS_PORT_D (1)

#define PBDRV_CONFIG_FIRST_IO_PORT PBIO_PORT_A
#define PBDRV_CONFIG_LAST_IO_PORT PBIO_PORT_D
#define PBDRV_CONFIG_NUM_IO_PORT (4)

#define PBDRV_CONFIG_FIRST_MOTOR_PORT PBIO_PORT_A
#define PBDRV_CONFIG_LAST_MOTOR_PORT PBIO_PORT_D
#define PBDRV_CONFIG_NUM_MOTOR_CONTROLLER (4)
Expand Down

0 comments on commit c4af5d7

Please sign in to comment.