Skip to content

Commit d16a98f

Browse files
committed
platform/ev3: Use common printf.
1 parent ca16393 commit d16a98f

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

bricks/ev3/mphalport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static void debug(pb_hal_uart_t *uart, const char *s) {
9292

9393
void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) {
9494
debug(&UART0, str);
95-
MICROPY_EVENT_POLL_HOOK
95+
// MICROPY_EVENT_POLL_HOOK
9696
}
9797

9898
void mp_hal_stdout_tx_flush(void) {

lib/pbio/platform/ev3/platform.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
11
// SPDX-License-Identifier: MIT
22
// Copyright (c) 2024 The Pybricks Authors
33

4-
5-
#include <stdint.h>
6-
7-
typedef struct {
8-
volatile uint8_t *thr;
9-
volatile uint8_t *lsr;
10-
} debug_uart_t;
11-
12-
// Sensor port 1
13-
static debug_uart_t UART0 = { .thr = (volatile uint8_t *)0x01D0C000, .lsr = (volatile uint8_t *)0x01D0C014 };
14-
15-
static void debug(debug_uart_t *uart, const char *s) {
16-
while (*s) {
17-
while ((*uart->lsr & (1 << 5)) == 0) {
18-
}
19-
*uart->thr = *s++;
20-
}
21-
}
4+
#include <stdio.h>
225

236
// Called from assembly code in startup.s. After this, the "main" function in
247
// lib/pbio/sys/main.c is called. That contains all calls to the driver
258
// initialization (low level in pbdrv, high level in pbio), and system level
269
// functions for running user code (currently a hardcoded MicroPython script).
2710
void SystemInit(void) {
28-
debug(&UART0, "System init in platform.c called from startup.s\n\n");
11+
printf("System init in platform.c called from startup.s\n\n");
12+
2913
// TODO: TIAM1808 system init
3014
}

0 commit comments

Comments
 (0)