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)); } }
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)); } }
/*= 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); } }
/********************************************************************** * 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++ ); }
void putrsUSART(const rom char *data) { do { // Transmit a byte while(BusyUSART()); putcUART(*data); } while( *data++ ); }
/*= 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"); }
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; }
/*= 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 }
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])); }
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])); } }
/*= 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 }
void putrsUSART(const rom char *data) { while( *data ) putcUART(*data++); }
/* 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++); }