Code: Select all
ioManager.c:52:13: note: in expansion of macro 'palWriteLine'
case 13 : palWriteLine(LINE_OP14, newValue); break;
^~~~~~~~~~~~
../../chibios_18.2.1_DD/os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.h:397:23: note: did you mean to use logical not?
((port)->BSRR.W = ((~(bits) & (mask)) << (16U + (offset))) | \
^
../../chibios_18.2.1_DD/os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.h:425:42: note: in expansion of macro 'pal_lld_writegroup'
#define pal_lld_writepad(port, pad, bit) pal_lld_writegroup(port, 1, pad, bit)
^~~~~~~~~~~~~~~~~~
../../chibios_18.2.1_DD/os/hal/include/hal_pal.h:590:37: note: in expansion of macro 'pal_lld_writepad'
#define palWritePad(port, pad, bit) pal_lld_writepad(port, pad, bit)
^~~~~~~~~~~~~~~~
../../chibios_18.2.1_DD/os/hal/include/hal_pal.h:705:33: note: in expansion of macro 'palWritePad'
#define palWriteLine(line, bit) palWritePad(PAL_PORT(line), PAL_PAD(line), bit)
^~~~~~~~~~~
ioManager.c:52:13: note: in expansion of macro 'palWriteLine'
case 13 : palWriteLine(LINE_OP14, newValue); break;
^~~~~~~~~~~~
../../chibios_18.2.1_DD/os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.h:397:23: warning: '~' on a boolean expression [-Wbool-operation]
((port)->BSRR.W = ((~(bits) & (mask)) << (16U + (offset))) | \
^
../../chibios_18.2.1_DD/os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.h:425:42: note: in expansion of macro 'pal_lld_writegroup'
#define pal_lld_writepad(port, pad, bit) pal_lld_writegroup(port, 1, pad, bit)
^~~~~~~~~~~~~~~~~~
../../chibios_18.2.1_DD/os/hal/include/hal_pal.h:590:37: note: in expansion of macro 'pal_lld_writepad'
#define palWritePad(port, pad, bit) pal_lld_writepad(port, pad, bit)
^~~~~~~~~~~~~~~~
../../chibios_18.2.1_DD/os/hal/include/hal_pal.h:705:33: note: in expansion of macro 'palWritePad'
#define palWriteLine(line, bit) palWritePad(PAL_PORT(line), PAL_PAD(line), bit)
The following typecasting in the macro gets rid of the errors:
Code: Select all
#define pal_lld_writegroup(port, mask, offset, bits) \
((port)->BSRR.W = ((~(uint16_t)(bits) & (mask)) << (16U + (offset))) | \
(((uint16_t)(bits) & (mask)) << (offset)))
(Line 396 in GPIOv2/hal_pal_lld.h)