add fancy hardfault handler, increase heater stack size
This commit is contained in:
+24
-4
@@ -29,6 +29,10 @@
|
||||
#define my_malloc(len) pvPortMalloc((len))
|
||||
#define my_free(p) vPortFree((p))
|
||||
|
||||
// Use a static buffer to avoid allocating for every printf!
|
||||
#define S_PRINTF_BUF_LEN 200
|
||||
static char s_printf_buf[S_PRINTF_BUF_LEN];
|
||||
|
||||
// Toggle features
|
||||
#define size_t size_t /* normally: int, unsigned */
|
||||
#undef HAVE_LONG_DOUBLE
|
||||
@@ -733,9 +737,11 @@ static void fmtfp(char *buffer, size_t *currlen, size_t maxlen,
|
||||
// leading zeros in the fractional part
|
||||
fzeropad = 0;
|
||||
fzerocnt = max - 1;
|
||||
while (fracpart < POW10(fzerocnt)) {
|
||||
fzeropad++;
|
||||
fzerocnt--;
|
||||
if (fzerocnt > 0) {
|
||||
while (fracpart < POW10(fzerocnt)) {
|
||||
fzeropad++;
|
||||
fzerocnt--;
|
||||
}
|
||||
}
|
||||
do {
|
||||
temp = fracpart;
|
||||
@@ -800,8 +806,9 @@ static void fmtfp(char *buffer, size_t *currlen, size_t maxlen,
|
||||
zpadlen = 0;
|
||||
}
|
||||
|
||||
while (fzeropad-- > 0) {
|
||||
while (fzeropad > 0) {
|
||||
dopr_outch(buffer, currlen, maxlen, '0');
|
||||
fzeropad--;
|
||||
}
|
||||
|
||||
while (fplace > 0) {
|
||||
@@ -892,6 +899,18 @@ int printf(const char *format, ...)
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
||||
va_start(ap, format);
|
||||
ret = vsnprintf(s_printf_buf, S_PRINTF_BUF_LEN, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
PUTS(s_printf_buf);
|
||||
|
||||
return ret;
|
||||
|
||||
#if 0
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
||||
char *ptr = NULL;
|
||||
|
||||
va_start(ap, format);
|
||||
@@ -906,6 +925,7 @@ int printf(const char *format, ...)
|
||||
my_free(ptr);
|
||||
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
int vprintf(const char *format, va_list ap)
|
||||
|
||||
Reference in New Issue
Block a user