some more stack shrinking

This commit is contained in:
2018-01-13 21:33:19 +01:00
parent 8a28395102
commit 69443613fc
8 changed files with 59 additions and 46 deletions
+9 -8
View File
@@ -106,18 +106,19 @@ void DebugUart_PreInit(void)
LL_USART_Enable(DEBUG_USART);
}
void debug_write(const char *buf, uint16_t len)
{
for (uint16_t i = 0; i < len; i++) {
while (!LL_USART_IsActiveFlag_TC(DEBUG_USART));
LL_USART_TransmitData8(DEBUG_USART, (uint8_t) *buf++);
}
}
/** Debug print, used by debug / newlib */
ssize_t _write_r(struct _reent *rptr, int fd, const void *buf, size_t len)
{
(void)rptr;
uint8_t *buff = buf;
for (uint32_t i = 0; i < len; i++) {
while (!LL_USART_IsActiveFlag_TC(DEBUG_USART));
LL_USART_TransmitData8(DEBUG_USART, *buff++);
}
debug_write(buf, len);
return len;
}
+2
View File
@@ -8,4 +8,6 @@
void DebugUart_PreInit(void);
void DebugUart_Init(void);
void debug_write(const char *buf, uint16_t len);
#endif //GEX_DEBUG_UART_H