From 473828ca6aef18c574b8665ae484513e5592af03 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 29 Oct 2020 23:54:17 -0400 Subject: command: Add command_decode_ptr() helper Add a helper function to convert from a string buffer passed in the args[] parameter to an actual pointer. This avoids all the callers needing to perfrom pointer manipulation. Signed-off-by: Kevin O'Connor --- src/tmcuart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tmcuart.c') diff --git a/src/tmcuart.c b/src/tmcuart.c index 50f05122..a2f5f8fc 100644 --- a/src/tmcuart.c +++ b/src/tmcuart.c @@ -195,7 +195,7 @@ command_tmcuart_send(uint32_t *args) // Uart is busy - silently drop this request (host should retransmit) return; uint8_t write_len = args[1]; - uint8_t *write = (void*)(size_t)args[2]; + uint8_t *write = command_decode_ptr(args[2]); uint8_t read_len = args[3]; if (write_len > sizeof(t->data) || read_len > sizeof(t->data)) shutdown("tmcuart data too large"); -- cgit v1.2.3-70-g09d2