/*!\brief Print to the LCD on both lines. * *\details Clears the LCD, then prints the two C strings given. Each string * should be equal or less than 16 characters to fit on the LCD. We print * str_top on the first line of the LCD, and str_bottom on the second line. * * @param str_top C string, 16 characters or less, to print on the first line * of the LCD. * @param str_bottom C string, 16 characters or less, to print on the bottom * line of the LCD. */ void printLCD (char *str_top, char *str_bottom) { lcdCommand(CLEAR_LCD); // Start by clearing the LCD. lcdCommand(FIRST_LINE); // Go to the first line. // Print out the string for the top: usart_fprint(LCD_ADDRESS, (uint8_t *) str_top); lcdCommand(SECOND_LINE); // Go to the second line. // Print out the string for the bottom: usart_fprint(LCD_ADDRESS, (uint8_t *) str_bottom); }
void usart_fprintf_arg(USART_ID usartId, const char * format, va_list arg) { while(usartComBuf[usartId].workBufferInUse == USART_ENGAGED ) _delay_us(25); usartComBuf[usartId].workBufferInUse = USART_ENGAGED; vsnprintf((char *)(usartComBuf[usartId].workBuffer), usartComBuf[usartId].workBufferSize, (const char *)format, arg); usart_fprint(defaultUSART, (usartComBuf[usartId].workBuffer)); usartComBuf[usartId].workBufferInUse = USART_VACANT; }
void usart_fprintf_P_arg(USART_ID usartId, PGM_P format, va_list arg) { while(usartComBuf[usartId].workBufferInUse == USART_ENGAGED ) _delay_us(25); usartComBuf[usartId].workBufferInUse = USART_ENGAGED; vsnprintf_P((char *)(usartComBuf[usartId].workBuffer), usartComBuf[usartId].workBufferSize, format, arg); usart_fprint(usartId,usartComBuf[usartId].workBuffer); usartComBuf[usartId].workBufferInUse = USART_VACANT; }
/*************************************************************************************//*! * \brief Print string on default USART * * The function transmits the given string to the default USART defined by defaultUSART * with a call to usart_fprint(). * @param str - The string to transmit. ******************************************************************************************/ void usart_print(uint8_t * str) { usart_fprint(defaultUSART, str); }