From ceeb97f38cfe61660d8d734796ff062ae51df636 Mon Sep 17 00:00:00 2001 From: Petr Ledvina Date: Tue, 17 Jul 2018 17:40:42 +0200 Subject: [PATCH] Parentheses around macro argument Not triggering error in this case --- Firmware/tmc2130.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/tmc2130.cpp b/Firmware/tmc2130.cpp index 989f6f8f..4d993436 100644 --- a/Firmware/tmc2130.cpp +++ b/Firmware/tmc2130.cpp @@ -129,7 +129,7 @@ void tmc2130_wr_TPWMTHRS(uint8_t axis, uint32_t val32); void tmc2130_wr_THIGH(uint8_t axis, uint32_t val32); #define tmc2130_rd(axis, addr, rval) tmc2130_rx(axis, addr, rval) -#define tmc2130_wr(axis, addr, wval) tmc2130_tx(axis, addr | 0x80, wval) +#define tmc2130_wr(axis, addr, wval) tmc2130_tx(axis, (addr) | 0x80, wval) uint8_t tmc2130_tx(uint8_t axis, uint8_t addr, uint32_t wval); uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval);