Skip to content

Commit

Permalink
pbio/drv/ioport_debug: Drop it.
Browse files Browse the repository at this point in the history
This was mostly unused, so investing time in cleaning this up is currently not worth it.

This can be re-instated as part of the port mode that allows direct uart access when we suport it.
  • Loading branch information
laurensvalk committed Dec 24, 2024
1 parent da71e11 commit ffb60af
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 138 deletions.
1 change: 0 additions & 1 deletion bricks/_common/sources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ PBIO_SRC_C = $(addprefix lib/pbio/,\
drv/gpio/gpio_stm32l4.c \
drv/imu/imu_lsm6ds3tr_c_stm32.c \
drv/ioport/ioport_pup.c \
drv/ioport/ioport_debug_uart.c \
drv/led/led_array_pwm.c \
drv/led/led_array.c \
drv/led/led_core.c \
Expand Down
20 changes: 0 additions & 20 deletions lib/pbio/drv/bluetooth/bluetooth_stm32_cc2640.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,9 @@

PROCESS(pbdrv_bluetooth_spi_process, "Bluetooth SPI");

#define DEBUG_ON_LAST_UART_PORT (0)

#if DEBUG_ON_LAST_UART_PORT
#include <pbdrv/../../drv/ioport/ioport_debug_uart.h>
#define DBG(...)
#define DEBUG_PRINT(...)
#define DEBUG_PRINT_PT PBDRV_IOPORT_DEBUG_UART_PT_PRINTF
static void uart_poll_callback(pbdrv_uart_dev_t *uart) {
process_poll(&pbdrv_bluetooth_spi_process);
}
#else
#define DBG(...)
#define DEBUG_PRINT(...)
#define DEBUG_PRINT_PT(...)
#endif

// hub name goes in special section so that it can be modified when flashing firmware
__attribute__((section(".name")))
Expand Down Expand Up @@ -2271,14 +2259,6 @@ PROCESS_THREAD(pbdrv_bluetooth_spi_process, ev, data) {

PROCESS_BEGIN();

#if DEBUG_ON_LAST_UART_PORT
// Wait for the UART to be ready for debugging.
while (pbdrv_ioport_debug_uart_init(uart_poll_callback) != PBIO_SUCCESS) {
etimer_set(&timer, 100);
PROCESS_WAIT_EVENT_UNTIL(ev == PROCESS_EVENT_TIMER && etimer_expired(&timer));
}
#endif // DEBUG_ON_LAST_UART_PORT

start:
// take Bluetooth chip out of reset
bluetooth_reset(RESET_STATE_OUT_HIGH);
Expand Down
59 changes: 0 additions & 59 deletions lib/pbio/drv/ioport/ioport_debug_uart.c

This file was deleted.

48 changes: 0 additions & 48 deletions lib/pbio/drv/ioport/ioport_debug_uart.h

This file was deleted.

3 changes: 1 addition & 2 deletions lib/pbio/platform/city_hub/pbdrvconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#define PBDRV_CONFIG_IOPORT_PUP (1)
#define PBDRV_CONFIG_IOPORT_NUM_DEV (2)
#define PBDRV_CONFIG_IOPORT_PUP_QUIRK_POWER_CYCLE (1)
#define PBDRV_CONFIG_IOPORT_DEBUG_UART (0) // Doesn't work.

#define PBDRV_CONFIG_LED (1)
#define PBDRV_CONFIG_LED_NUM_DEV (1)
Expand All @@ -55,7 +54,7 @@
#define PBDRV_CONFIG_LEGODEV (1)
#define PBDRV_CONFIG_LEGODEV_PUP (1)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_INT_DEV (0)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV (2 - PBDRV_CONFIG_IOPORT_DEBUG_UART)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV (2)
#define PBDRV_CONFIG_LEGODEV_PUP_UART (1)
#define PBDRV_CONFIG_LEGODEV_MODE_INFO (1)
#define PBDRV_CONFIG_LEGODEV_PUP_UART_NUM_DEV (PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV)
Expand Down
3 changes: 1 addition & 2 deletions lib/pbio/platform/essential_hub/pbdrvconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
#define PBDRV_CONFIG_IOPORT_PUP (1)
#define PBDRV_CONFIG_IOPORT_NUM_DEV (2)
#define PBDRV_CONFIG_IOPORT_PUP_QUIRK_POWER_CYCLE (0)
#define PBDRV_CONFIG_IOPORT_DEBUG_UART (0)

#define PBDRV_CONFIG_LED (1)
#define PBDRV_CONFIG_LED_NUM_DEV (2)
Expand All @@ -79,7 +78,7 @@
#define PBDRV_CONFIG_LEGODEV (1)
#define PBDRV_CONFIG_LEGODEV_PUP (1)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_INT_DEV (0)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV (2 - PBDRV_CONFIG_IOPORT_DEBUG_UART)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV (2)
#define PBDRV_CONFIG_LEGODEV_PUP_UART (1)
#define PBDRV_CONFIG_LEGODEV_MODE_INFO (1)
#define PBDRV_CONFIG_LEGODEV_PUP_UART_NUM_DEV (PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV)
Expand Down
3 changes: 1 addition & 2 deletions lib/pbio/platform/move_hub/pbdrvconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#define PBDRV_CONFIG_IOPORT_PUP (1)
#define PBDRV_CONFIG_IOPORT_NUM_DEV (2)
#define PBDRV_CONFIG_IOPORT_PUP_QUIRK_POWER_CYCLE (0)
#define PBDRV_CONFIG_IOPORT_DEBUG_UART (0) // Doesn't work.

#define PBDRV_CONFIG_LED (1)
#define PBDRV_CONFIG_LED_NUM_DEV (1)
Expand All @@ -54,7 +53,7 @@
#define PBDRV_CONFIG_LEGODEV (1)
#define PBDRV_CONFIG_LEGODEV_PUP (1)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_INT_DEV (2)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV (2 - PBDRV_CONFIG_IOPORT_DEBUG_UART)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV (2)
#define PBDRV_CONFIG_LEGODEV_PUP_UART (1)
#define PBDRV_CONFIG_LEGODEV_MODE_INFO (0) // Reduces build size by disabling some unused features of the protocol.
#define PBDRV_CONFIG_LEGODEV_PUP_UART_NUM_DEV (PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV)
Expand Down
3 changes: 1 addition & 2 deletions lib/pbio/platform/prime_hub/pbdrvconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
#define PBDRV_CONFIG_IOPORT_PUP (1)
#define PBDRV_CONFIG_IOPORT_NUM_DEV (6)
#define PBDRV_CONFIG_IOPORT_PUP_QUIRK_POWER_CYCLE (0)
#define PBDRV_CONFIG_IOPORT_DEBUG_UART (0)

#define PBDRV_CONFIG_LED (1)
#define PBDRV_CONFIG_LED_NUM_DEV (5)
Expand All @@ -87,7 +86,7 @@
#define PBDRV_CONFIG_LEGODEV (1)
#define PBDRV_CONFIG_LEGODEV_PUP (1)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_INT_DEV (0)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV (6 - PBDRV_CONFIG_IOPORT_DEBUG_UART)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV (6)
#define PBDRV_CONFIG_LEGODEV_PUP_UART (1)
#define PBDRV_CONFIG_LEGODEV_MODE_INFO (1)
#define PBDRV_CONFIG_LEGODEV_PUP_UART_NUM_DEV (PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV)
Expand Down
3 changes: 1 addition & 2 deletions lib/pbio/platform/technic_hub/pbdrvconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
#define PBDRV_CONFIG_IOPORT_PUP (1)
#define PBDRV_CONFIG_IOPORT_NUM_DEV (4)
#define PBDRV_CONFIG_IOPORT_PUP_QUIRK_POWER_CYCLE (1)
#define PBDRV_CONFIG_IOPORT_DEBUG_UART (0)

#define PBDRV_CONFIG_LED (1)
#define PBDRV_CONFIG_LED_NUM_DEV (1)
Expand All @@ -65,7 +64,7 @@
#define PBDRV_CONFIG_LEGODEV (1)
#define PBDRV_CONFIG_LEGODEV_PUP (1)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_INT_DEV (0)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV (4 - PBDRV_CONFIG_IOPORT_DEBUG_UART)
#define PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV (4)
#define PBDRV_CONFIG_LEGODEV_PUP_UART (1)
#define PBDRV_CONFIG_LEGODEV_MODE_INFO (1)
#define PBDRV_CONFIG_LEGODEV_PUP_UART_NUM_DEV (PBDRV_CONFIG_LEGODEV_PUP_NUM_EXT_DEV)
Expand Down

0 comments on commit ffb60af

Please sign in to comment.