This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with passing parameters

Hey guys,

I've got a huge problem with passing arguments to an invoked function. It just doesn't work, at least sometimes... I can't figure out why this could possibly happen, but it does. My application is very small, just a few KB, thats why I dont assume there is a stack overflow or something like that. Any other guesses or maybe even solutions?

Thanks

Parents
  • The called funcition is this one':

    void UART_vTransmitArrayASCII(ubyte *TxValue, ubyte TxByteCount)
    {
    
      ubyte idata i=0;
      for (i=0;i<TxByteCount;i++){
          UART_vTransmitASCII(*(TxValue+i));
      }
    
    } // uart_transmit
    

    and the calling function is this one

    void TIMERS_vISR(void) interrupt 1 using 1
    {
      ubyte DataPtr[3]={12,12,33};
      ubyte DataCount=3;
      // disable timer 0 interrupt
      ET0=0;
    
      UART_vTransmitArrayASCII(DataPtr,DataCount);
      // reinitialize
      TH0 = 0x63;
      TL0 = 0xC0;
    
      // enable timer 0 interrupt
      ET0=1;
    
    
    } // timers_isr0
    
    The problem is, that the value of TxByteCount is not the one of DataCount, but something else.
    
    
    

Reply
  • The called funcition is this one':

    void UART_vTransmitArrayASCII(ubyte *TxValue, ubyte TxByteCount)
    {
    
      ubyte idata i=0;
      for (i=0;i<TxByteCount;i++){
          UART_vTransmitASCII(*(TxValue+i));
      }
    
    } // uart_transmit
    

    and the calling function is this one

    void TIMERS_vISR(void) interrupt 1 using 1
    {
      ubyte DataPtr[3]={12,12,33};
      ubyte DataCount=3;
      // disable timer 0 interrupt
      ET0=0;
    
      UART_vTransmitArrayASCII(DataPtr,DataCount);
      // reinitialize
      TH0 = 0x63;
      TL0 = 0xC0;
    
      // enable timer 0 interrupt
      ET0=1;
    
    
    } // timers_isr0
    
    The problem is, that the value of TxByteCount is not the one of DataCount, but something else.
    
    
    

Children