void writeSerialPacket(int fd, FRGarminPacketRef outgoingPacket, int destroyPacket) { char outgoingByte; char checksum = 0; ssize_t bytesWritten = write(fd, &FR_DLE, 1); (void)bytesWritten; outgoingByte = outgoingPacket->typeID; writeDataByte(fd, outgoingByte, &checksum); outgoingByte = outgoingPacket->dataSize; writeDataByte(fd, outgoingByte, &checksum); size_t dataIdx; for (dataIdx = 0; dataIdx < outgoingPacket->dataSize; ++dataIdx) { outgoingByte = outgoingPacket->data[dataIdx]; writeDataByte(fd, outgoingByte, &checksum); } checksum = -checksum; //checksum = ~checksum + 1; bytesWritten = write(fd, &checksum, 1); (void)bytesWritten; bytesWritten = write(fd, &FR_DLE, 1); (void)bytesWritten; bytesWritten = write(fd, &FR_ETX, 1); (void)bytesWritten; if (destroyPacket) FRGarminPacketDestroy(outgoingPacket); }
void writeChar( char charToWrite ) { //LCDSEND = charToWrite; //LCD_write_8( LCDSEND ); //delayMilli(); writeDataByte( charToWrite ); }
//courtesy of C2C Steinmiller... void scrollString(char *string1, char *string2) { unsigned int i = 0; char *count1 = string1, *count2 = string2; while (1) { cursorToLineOne(); char *currentChar = count1; for (i = 0; i < 8; i++) { writeDataByte(*currentChar); //send data in the string to be written currentChar++; if (*currentChar == 0) currentChar = string1; } count1++; if (*count1 == 0) { count1 = string1; } cursorToLineTwo(); char *currentChar2 = count2; for (i = 0; i < 8; i++) { writeDataByte(*currentChar2); //send data in the string to be written currentChar2++; if (*currentChar2 == 0) currentChar2 = string2; } count2++; if (*count2 == 0) { count2 = string2; } __delay_cycles(600000); LCDclear(); } }
void writeString(char string[]) { unsigned int length, count = 0; length = getStringLength(string); while(count < length) { writeDataByte(string[count]); count++; } }
char * scroll_help(char * beginning, char * current){ if(*current == 0){ current = beginning; } char * display = current; char position = 0; for (position = 0; position < 8; position++){ writeDataByte(*display); display++; if(*display == 0){ display = beginning; } } return current + 1; }
//Unused function. void scrollMessage(char *string, char *count) { unsigned int i = 0; char *currentChar = count; for (i = 0; i < 8; i++) { writeDataByte(*currentChar); //send data in the string to be written currentChar++; if (*currentChar == 0) currentChar = string; } count++; if (*count == 0) { count = string; } }
void clearPlayer(unsigned char player) { writeCommandByte(player); writeDataByte(' '); }
void printPlayer(unsigned char player) { writeCommandByte(player); writeDataByte('*'); }
void writeChar(char char2Write){ writeDataByte(char2Write); }
void writeChar(char asciiChar) { writeCommandByte(0x06); //cursor increment writeDataByte(asciiChar); }
void writeChar(char asciiChar){ writeDataByte(asciiChar); }
void printCharacter(char asciiChar){ writeDataByte(asciiChar); }