示例#1
0
		void BigIntPrintROM(BIGINT_ROM *a)
		{
		  	ROM BIGINT_DATA_TYPE *ptr;
		  	
		  	for(ptr = a->ptrMSB; ptr >= a->ptrLSB; ptr--)
		  	{
				while(BusyUART());
				putcUART(btohexa_high(*ptr));
				while(BusyUART());
				putcUART(btohexa_low(*ptr));
			}
		}
示例#2
0
		void BigIntPrint(const BIGINT *a)
		{
		  	BIGINT_DATA_TYPE *ptr;
		  	
		  	for(ptr = a->ptrMSBMax; ptr >= a->ptrLSB; ptr--)
		  	{
				while(BusyUART());
				putcUART(btohexa_high(*ptr));
				while(BusyUART());
				putcUART(btohexa_low(*ptr));
			}
		}
示例#3
0
/*= EchoCharacter ===========================================================
Purpose: Echoes a character to the terminal.

Inputs:  new_char -- character to echo

Returns: none
============================================================================*/
static void EchoCharacter(INT8 c)
{
    if (IS_ECHO_ON())
    {
       /* output cr then lf for lf */
       if (c == (INT8)'\n')
       {
          putcUART('\r');
       }

       putcUART(c);
    }
}
示例#4
0
/**********************************************************************
*    Function Name:  putsUART                                         *
*    Return Value:   void                                             *
*    Parameters:     data: pointer to string of data                  *
*    Description:    This routine transmits a string of characters    *
*                    to the UART data byte including the null.        *
**********************************************************************/
void putsUART( char *data)
{
  do
  {    // Transmit a byte
    putcUART(*data);
  } while( *data++ );
}
示例#5
0
	void putrsUSART(const rom char *data)
	{
	  do
	  {  // Transmit a byte
	    while(BusyUSART());
	    putcUART(*data);
	  } while( *data++ );
	}
示例#6
0
/*= OutputLine ===============================================================
Purpose: Outputs a line of the specified character

Inputs:  lineChar -- character the comprises the line
         count    -- number of characters in the line

Returns: None
============================================================================*/
static void OutputLine(INT8 lineChar, UINT8 count)
{
    UINT8 i;

    for (i = 0; i < count; ++i)
    {
        while(BusyUART());
        putcUART(lineChar);
    }
    putrsUART("\n\r");
}
示例#7
0
BYTE enviarPacotePC(BYTE * buffer, BYTE len ){
  
  BYTE crc = 0;
  BYTE bData;
  BYTE i;

  putcUART( STX );
  for( i = 0 ; i < len; i++ ){
    bData = buffer[i];
    
    if ( i >= DATA_FIELD ){
      if ( ( bData == STX ) || ( bData == ETX ) || ( bData == DLE )){
        putcUART( DLE );
        putcUART( bData ^ DLE_CHAR );
        crc ^= bData;
        continue;
      }
    }

    putcUART( bData );
    crc ^= bData;
  }
  putcUART( crc );
  putcUART( ETX );
  return TRUE;
}
示例#8
0
/*= OutputLine ===============================================================
Purpose: Outputs a line of the specified character

Inputs:  lineChar -- character the comprises the line
         count    -- number of characters in the line

Returns: None
============================================================================*/
static tZGVoidReturn OutputLine(tZGS8 lineChar, tZGU8 count)
{
#if defined( STACK_USE_UART )
    tZGU8 i;

    for (i = 0; i < count; ++i)
    {
        while(BusyUART());
        putcUART(lineChar);
    }
    ZG_PUTRSUART("\n\r");
#endif
}
/*= OutputLine ===============================================================
Purpose: Outputs a line of the specified character

Inputs:  lineChar -- character the comprises the line
         count    -- number of characters in the line

Returns: None
============================================================================*/
static void OutputLine(INT8 lineChar, UINT8 count)
{
#if defined( STACK_USE_UART )
    UINT8 i;

    for (i = 0; i < count; ++i)
    {
        while(BusyUART());
        putcUART(lineChar);
    }
    putrsUART("\n\r");
#endif
}
示例#10
0
	void putulhexUART(DWORD dw)
	{
		while(BusyUART());
		putcUART('0');
		while(BusyUART());
		putcUART('x');
		while(BusyUART());
		putcUART(btohexa_high(((BYTE*)&dw)[3]));
		while(BusyUART());
		putcUART(btohexa_low(((BYTE*)&dw)[3]));
		while(BusyUART());
		putcUART(btohexa_high(((BYTE*)&dw)[2]));
		while(BusyUART());
		putcUART(btohexa_low(((BYTE*)&dw)[2]));
		while(BusyUART());
		putcUART(btohexa_high(((BYTE*)&dw)[1]));
		while(BusyUART());
		putcUART(btohexa_low(((BYTE*)&dw)[1]));
		while(BusyUART());
		putcUART(btohexa_high(((BYTE*)&dw)[0]));
		while(BusyUART());
		putcUART(btohexa_low(((BYTE*)&dw)[0]));
	}
示例#11
0
		void BigIntPrint(const BIGINT *a)
		{
		  	WORD w;
		  	BYTE v;
		  	
		  	BIGINT_DATA_TYPE *ptr;
		  	
		  	for(ptr = a->ptrMSBMax; ptr >= a->ptrLSB; ptr--)
		  	{
			  	WORD_VAL wv;
			  	
			  	wv.Val = *ptr;
			  	
				while(BusyUART());
				putcUART(btohexa_high(wv.v[1]));
				while(BusyUART());
				putcUART(btohexa_low(wv.v[1]));
				while(BusyUART());
				putcUART(btohexa_high(wv.v[0]));
				while(BusyUART());
				putcUART(btohexa_low(wv.v[0]));
			}
		}
示例#12
0
/*= OutputLine ===============================================================
Purpose: Outputs a line of the specified character

Inputs:  lineChar -- character the comprises the line
         count    -- number of characters in the line

Returns: None
============================================================================*/
static void OutputLine(INT8 lineChar, UINT8 count)
{
#if defined( STACK_USE_UART )
    UINT8 i;

    for (i = 0; i < count; ++i)
    {
        while(BusyUART());
        putcUART(lineChar);
    }
    putrsUART("\n\r");
#endif

#if defined(WIFI_USB_DBG)//DIA 28_6_11
    for (i = 0; i < count; ++i)
    {
		copyArrayToUSBBuffer((char *) &lineChar, 1);//DIA 12_7_11
    }
    copyArrayToUSBBuffer("\n\r", sizeof("\n\r"));
#endif
}
示例#13
0
void putrsUSART(const rom char *data)	{ while( *data ) putcUART(*data++); }
示例#14
0
/*	
void getsUSART(char *buffer, unsigned char len)	{
	  char i;    // Length counter
	  unsigned char data;
	
	  for(i=0;i<len;i++)  // Only retrieve len characters
	  {
	    while(!DataRdyUSART());// Wait for data to be received
	
	    data = getcUART();    // Get a character from the USART
	                           // and save in the string
	    *buffer++ = data;
	    					// Increment the string pointer
	  }
}
*/	
void putsUSART( char *data)	{ while( *data )  putcUART(*data++); }