diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-10-29 23:54:17 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-10-30 14:04:08 -0400 |
commit | 473828ca6aef18c574b8665ae484513e5592af03 (patch) | |
tree | 74d6b8f205ce92282475ad0f6575ea0c5af01fc2 /src/tmcuart.c | |
parent | aaf3dc6ac3e3a38b0dd3508d72594214ede27c5c (diff) | |
download | kutter-473828ca6aef18c574b8665ae484513e5592af03.tar.gz kutter-473828ca6aef18c574b8665ae484513e5592af03.tar.xz kutter-473828ca6aef18c574b8665ae484513e5592af03.zip |
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 <kevin@koconnor.net>
Diffstat (limited to 'src/tmcuart.c')
-rw-r--r-- | src/tmcuart.c | 2 |
1 files changed, 1 insertions, 1 deletions
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"); |