We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am using the RTX mailbox and a lot of it's usage uses casting of the mailbox message to other types - a really quick and clever way to use it(thanks Keil :). When I cast a void * vPointer to a unigned int - like (uint32_t)vPointer - the compiler is happy - but when I cast to a signed char - like (int8_t)vPointer the compiler complains and says:
Source_App\TerminalDrv.c(56): warning: #767-D: conversion from pointer to smaller integer
Now it all works fine ... but what do I do to stop it complaining?
uint32_t TerminalControllerGetChar(int8_t *pcRxedChar ) { void * pvmbxTerminalRx; uint32_t ulNoRxMessage,ulI; ulNoRxMessage = SIZEOF_OS_MBX_RXTERMINAL - os_mbx_check(mbxHandleTerminalRx); if(ulNoRxMessage == 0) return 0 ; else { for(ulI = 0;ulI < ulNoRxMessage ; ulI++) { if(os_mbx_wait(mbxHandleTerminalRx,(void **)&pvmbxTerminalRx,0x0000) == OS_R_OK) { *pcRxedChar = (int8_t)pvmbxTerminalRx; pcRxedChar++; } else { break; } } } return ulNoRxMessage; }
"... if your mailbox contains pointers to characters"
Agreed.