Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/build-each-commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
pybricks.git.submodule(
"update", "--init", "--checkout", "lib/STM32_USB_Device_Library"
)
if args.hub == "ev3":
if args.hub == "ev3" or args.hub == "nxt":
pybricks.git.submodule("update", "--init", "--checkout", "lib/umm_malloc")

if args.hub == "buildhat":
Expand Down
3 changes: 2 additions & 1 deletion .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@
"${workspaceFolder}/bricks/nxt/build",
"${workspaceFolder}/lib/pbio/include",
"${workspaceFolder}",
"${workspaceFolder}/micropython"
"${workspaceFolder}/micropython",
"${workspaceFolder}/lib/umm_malloc/src"
],
"defines": [
"MICROPY_MODULE_FROZEN_MPY",
Expand Down
2 changes: 0 additions & 2 deletions bricks/_common/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,7 @@ endif
NXOS_SRC_C = $(addprefix lib/pbio/platform/nxt/nxos/,\
_abort.c \
assert.c \
display.c \
drivers/_efc.c \
drivers/_lcd.c \
drivers/_twi.c \
drivers/_uart.c \
drivers/aic.c \
Expand Down
1 change: 1 addition & 0 deletions bricks/_common/sources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ PBIO_SRC_C = $(addprefix lib/pbio/,\
drv/counter/counter_nxt.c \
drv/counter/counter_stm32f0_gpio_quad_enc.c \
drv/display/display_ev3.c \
drv/display/display_nxt.c \
drv/display/display_virtual.c \
drv/gpio/gpio_ev3.c \
drv/gpio/gpio_nxt.c \
Expand Down
2 changes: 2 additions & 0 deletions bricks/nxt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
PBIO_PLATFORM = nxt
PB_MCU_FAMILY = AT91SAM7

PB_LIB_UMM_MALLOC = 1

include ../_common/common.mk
11 changes: 11 additions & 0 deletions bricks/nxt/dbglog/dbglog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2025 The Pybricks Authors
//
// Hack to allow umm_info() to print in MicroPython.

#include "py/mpprint.h"

#undef DBGLOG_FORCE
#define DBGLOG_FORCE(force, fmt, ...) mp_printf(&mp_plat_print, fmt,##__VA_ARGS__)

#define DBGLOG_32_BIT_PTR(p) (p)
2 changes: 1 addition & 1 deletion bricks/nxt/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#define PYBRICKS_PY_PARAMETERS (1)
#define PYBRICKS_PY_PARAMETERS_BUTTON (1)
#define PYBRICKS_PY_PARAMETERS_ICON (0)
#define PYBRICKS_PY_PARAMETERS_IMAGE (0)
#define PYBRICKS_PY_PARAMETERS_IMAGE (1)
#define PYBRICKS_PY_DEVICES (1)
#define PYBRICKS_PY_ROBOTICS (1)
#define PYBRICKS_PY_ROBOTICS_DRIVEBASE_GYRO (0)
Expand Down
6 changes: 0 additions & 6 deletions lib/pbio/drv/clock/clock_nxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <nxos/nxt.h>
#include <nxos/interrupts.h>
#include <nxos/drivers/aic.h>
#include <nxos/drivers/_lcd.h>

/* The main clock is at 48MHz, and the PIT divides that by 16 to get
* its base timer frequency.
Expand All @@ -41,11 +40,6 @@ static void systick_isr(void) {
/* Do the system timekeeping. */
pbdrv_clock_ticks++;
pbio_os_request_poll();

/* The LCD dirty display routine can be done here too, since it is
* very short.
*/
nx__lcd_fast_update();
}

void pbdrv_clock_init(void) {
Expand Down
1 change: 1 addition & 0 deletions lib/pbio/drv/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ void pbdrv_init(void) {
void pbdrv_deinit(void) {

pbdrv_imu_deinit();
pbdrv_display_deinit();
pbdrv_bluetooth_deinit();
pbdrv_usb_deinit();

Expand Down
4 changes: 4 additions & 0 deletions lib/pbio/drv/display/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@
#if PBDRV_CONFIG_DISPLAY

void pbdrv_display_init(void);
void pbdrv_display_deinit(void);

#else // PBDRV_CONFIG_DISPLAY

static inline void pbdrv_display_init(void) {
}

static inline void pbdrv_display_deinit(void) {
}

#endif // PBDRV_CONFIG_DISPLAY

#endif // _INTERNAL_PBDRV_DISPLAY_H_
3 changes: 3 additions & 0 deletions lib/pbio/drv/display/display_ev3.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,4 +519,7 @@ void pbdrv_display_update(void) {
pbio_os_request_poll();
}

void pbdrv_display_deinit(void) {
}

#endif // PBDRV_CONFIG_DISPLAY_EV3
Loading