Compare commits
3 Commits
66d6a76e1a
...
d85381e30e
Author | SHA1 | Date | |
---|---|---|---|
d85381e30e | |||
83978e8188 | |||
4e4dc8e16e |
@ -159,7 +159,7 @@ int calibration_sequence_shell_cmd(shellmatta_handle_t shell)
|
|||||||
|
|
||||||
/* Check noise values */
|
/* Check noise values */
|
||||||
if (dev > CALIBRATION_MAX_PEAK_PEAK_NOISE_OHM || dev2 > CALIBRATION_MAX_PEAK_PEAK_NOISE_OHM) {
|
if (dev > CALIBRATION_MAX_PEAK_PEAK_NOISE_OHM || dev2 > CALIBRATION_MAX_PEAK_PEAK_NOISE_OHM) {
|
||||||
shellmatta_printf(shell, "Calibration failed! Too much noise. Check you're hardware.\r\n");
|
shellmatta_printf(shell, "Calibration failed! Too much noise. Check your hardware.\r\n");
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <reflow-controller/adc-meas.h>
|
#include <reflow-controller/adc-meas.h>
|
||||||
#include <reflow-controller/digio.h>
|
#include <reflow-controller/digio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <malloc.h>
|
||||||
#include <helper-macros/helper-macros.h>
|
#include <helper-macros/helper-macros.h>
|
||||||
#include <reflow-controller/systick.h>
|
#include <reflow-controller/systick.h>
|
||||||
#include <stm-periph/unique-id.h>
|
#include <stm-periph/unique-id.h>
|
||||||
@ -200,12 +201,13 @@ static shellmatta_retCode_t shell_cmd_cal(const shellmatta_handle_t handle,
|
|||||||
return SHELLMATTA_OK;
|
return SHELLMATTA_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static shellmatta_retCode_t shell_get_sp(const shellmatta_handle_t handle,
|
static shellmatta_retCode_t shell_meminfo(const shellmatta_handle_t handle,
|
||||||
const char *arguments,
|
const char *arguments,
|
||||||
uint32_t length)
|
uint32_t length)
|
||||||
{
|
{
|
||||||
(void)arguments;
|
(void)arguments;
|
||||||
(void)length;
|
(void)length;
|
||||||
|
struct mallinfo mi;
|
||||||
|
|
||||||
shellmatta_printf(handle,
|
shellmatta_printf(handle,
|
||||||
"Stack pointer: %p\r\n"
|
"Stack pointer: %p\r\n"
|
||||||
@ -214,6 +216,15 @@ static shellmatta_retCode_t shell_get_sp(const shellmatta_handle_t handle,
|
|||||||
read_stack_pointer(),
|
read_stack_pointer(),
|
||||||
stack_check_get_usage(),
|
stack_check_get_usage(),
|
||||||
stack_check_get_free());
|
stack_check_get_free());
|
||||||
|
|
||||||
|
mi = mallinfo();
|
||||||
|
shellmatta_printf(handle, "\r\nDynamic Memory Management\r\n");
|
||||||
|
shellmatta_printf(handle, "Allocated bytes: %d\r\n", mi.arena, mi.arena);
|
||||||
|
shellmatta_printf(handle, "Number of free chunks: %d\r\n", mi.ordblks);
|
||||||
|
shellmatta_printf(handle, "Top-most, releasable space: %d\r\n", mi.keepcost);
|
||||||
|
shellmatta_printf(handle, "Total free space: %d\r\n", mi.fordblks);
|
||||||
|
shellmatta_printf(handle, "Total allocated space: %d\r\n", mi.uordblks);
|
||||||
|
|
||||||
return SHELLMATTA_OK;
|
return SHELLMATTA_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,11 +363,11 @@ static shellmatta_cmd_t cmd[10] = {
|
|||||||
.next = &cmd[8],
|
.next = &cmd[8],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.cmd = "get-stack-pointer",
|
.cmd = "meminfo",
|
||||||
.cmdAlias = "sp",
|
.cmdAlias = NULL,
|
||||||
.helpText = "Get the stack pointer",
|
.helpText = "Get information about memory usage",
|
||||||
.usageText = "",
|
.usageText = "",
|
||||||
.cmdFct = shell_get_sp,
|
.cmdFct = shell_meminfo,
|
||||||
.next = &cmd[9],
|
.next = &cmd[9],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -89,6 +89,12 @@ int _write(int fd, const void *buf, int count)
|
|||||||
{
|
{
|
||||||
if (fd == 1)
|
if (fd == 1)
|
||||||
uart_send_array_with_dma(&shell_uart, (char *)buf, count);
|
uart_send_array_with_dma(&shell_uart, (char *)buf, count);
|
||||||
|
else if (fd == 2) {
|
||||||
|
uart_send_string_with_dma(&shell_uart, "\e[31m");
|
||||||
|
uart_send_array_with_dma(&shell_uart, (char *)buf, count);
|
||||||
|
uart_send_string_with_dma(&shell_uart, "\e[m");
|
||||||
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user