Skip to content

Commit d436ba7

Browse files
committed
pbio/drv/usb_nxt: Move driver from NxOS.
We have adapted the NxOS USB driver for Pybricks, so now we can move it to the common pbio/drv/usb directory. While moving, the code style is automatically formatted and pbio naming conventions are applied.
1 parent d384640 commit d436ba7

File tree

10 files changed

+1093
-1201
lines changed

10 files changed

+1093
-1201
lines changed

bricks/_common/arm_none_eabi.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,6 @@ NXOS_SRC_C = $(addprefix lib/pbio/platform/nxt/nxos/,\
515515
drivers/radar.c \
516516
drivers/rs485.c \
517517
drivers/sensors.c \
518-
drivers/usb.c \
519518
interrupts.c \
520519
lock.c \
521520
util.c \

bricks/_common/sources.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ PBIO_SRC_C = $(addprefix lib/pbio/,\
187187
drv/uart/uart_stm32f4_ll_irq.c \
188188
drv/uart/uart_stm32l4_ll_dma.c \
189189
drv/usb/usb_ev3.c \
190+
drv/usb/usb_nxt.c \
190191
drv/usb/usb_stm32.c \
191192
drv/watchdog/watchdog_ev3.c \
192193
drv/watchdog/watchdog_stm32.c \

lib/pbio/drv/reset/reset_nxt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
#include <at91sam7s256.h>
1111
#include <nxos/drivers/_avr.h>
1212
#include <nxos/drivers/_lcd.h>
13-
#include <nxos/drivers/_usb.h>
1413
#include <nxos/drivers/bt.h>
1514

1615
#include <pbdrv/reset.h>
1716

17+
#include "../usb/usb_nxt.h"
18+
1819
void pbdrv_reset_init(void) {
1920
}
2021

@@ -70,7 +71,7 @@ void pbdrv_reset_power_off(void) {
7071
}
7172

7273
nx__lcd_shutdown();
73-
nx__usb_disable();
74+
pbdrv_usb_nxt_deinit();
7475
nx__avr_power_down();
7576
}
7677

0 commit comments

Comments
 (0)