This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

void HalLcdWriteValue & TiMAC 1.5.0

Other Parts Discussed in Thread: TIMAC, CC2530

I am using TiMAC 1.5.0 I am trying to output data to the LCD screen on the smartrf06 board. the function HALlcdwritestring works normally but when I try to use the function Hallcdwritevalue I get the following error:

Error[e46]: Undefined external "_itoa" referred in OSAL ( C:\Texas Instruments\TIMAC 1.5.0\Projects\mac\Sample\cc2530\IAR Project\Normal\Obj\OSAL.r51 )

Error while running Linker

  • Hi Ali,

    You can use the following implementation for _itoa():

    void _itoa(uint16 num, uint8 *buf, uint8 radix)
    {
      char c,i;
      uint8 *p, rst[5];
    
      p = rst;
      for ( i=0; i<5; i++,p++ )
      {
        c = num % radix;  // Isolate a digit
        *p = c + (( c < 10 ) ? '0' : '7');  // Convert to Ascii
        num /= radix;
        if ( !num )
          break;
      }
    
      for ( c=0 ; c<=i; c++ )
        *buf++ = *p--;  // Reverse character order
    
      *buf = '\0';
    }

    Best regards,

    OD

  • Hi OD,

    Thanks very much OD now its working.

    Kind Regards,

    Ali