Skip to content

Commit 031aa95

Browse files
committed
bricks/_common_stm32/mphalport: Drop debug.
Debugging via UART is now supported as a non-blocking driver, so we can remove this.
1 parent 739d29d commit 031aa95

1 file changed

Lines changed: 0 additions & 41 deletions

File tree

bricks/_common_stm32/mphalport.c

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -40,45 +40,6 @@ void mp_hal_delay_ms(mp_uint_t Delay) {
4040
}
4141
}
4242

43-
#if PYBRICKS_HUB_DEBUG
44-
45-
#include "stm32f4xx.h"
46-
47-
uintptr_t mp_hal_stdio_poll(uintptr_t poll_flags) {
48-
uintptr_t ret = 0;
49-
50-
if ((poll_flags & MP_STREAM_POLL_RD) && USART6->SR & USART_SR_RXNE) {
51-
ret |= MP_STREAM_POLL_RD;
52-
}
53-
54-
return ret;
55-
}
56-
57-
// Receive single character
58-
int mp_hal_stdin_rx_chr(void) {
59-
while (!(USART6->SR & USART_SR_RXNE)) {
60-
MICROPY_VM_HOOK_LOOP
61-
}
62-
63-
return USART6->DR;
64-
}
65-
66-
// Send string of given length
67-
void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) {
68-
while (len--) {
69-
while (!(USART6->SR & USART_SR_TXE)) {
70-
MICROPY_VM_HOOK_LOOP
71-
}
72-
USART6->DR = *str++;
73-
}
74-
}
75-
76-
void mp_hal_stdout_tx_flush(void) {
77-
// currently not buffered
78-
}
79-
80-
#else // !PYBRICKS_HUB_DEBUG
81-
8243
uintptr_t mp_hal_stdio_poll(uintptr_t poll_flags) {
8344
uintptr_t ret = 0;
8445

@@ -129,5 +90,3 @@ void mp_hal_stdout_tx_flush(void) {
12990
MICROPY_EVENT_POLL_HOOK
13091
}
13192
}
132-
133-
#endif // PYBRICKS_HUB_DEBUG

0 commit comments

Comments
 (0)