|
@@ -26,19 +26,19 @@
|
|
|
void HSA_LCD_Shield::_sendMessage(byte* bytes, byte sizeBytes){
|
|
|
|
|
|
// Small timeout before access the I²C-Bus
|
|
|
- delayMicroseconds(100);
|
|
|
+ delayMicroseconds(DELAY_TRANS_US);
|
|
|
|
|
|
// Start I²C transmission
|
|
|
Wire.beginTransmission(this->__i2cAddress);
|
|
|
|
|
|
// Send an array of Bytes over I²C, depending of its size
|
|
|
- for(byte i = 0;i < sizeBytes;i++) Wire.write(bytes[i]);
|
|
|
+ for(byte i = 0x00; i < sizeBytes; i++) Wire.write(bytes[i]);
|
|
|
|
|
|
// Stop I²C transmission
|
|
|
Wire.endTransmission();
|
|
|
|
|
|
// Small timeout after access the I²C-Bus
|
|
|
- delayMicroseconds(100);
|
|
|
+ delayMicroseconds(DELAY_TRANS_US);
|
|
|
|
|
|
// Exit function
|
|
|
return;
|
|
@@ -51,7 +51,7 @@ void HSA_LCD_Shield::_sendMessage(byte* bytes, byte sizeBytes){
|
|
|
|
|
|
//////////////////// Constructor ////////////////////
|
|
|
|
|
|
-HSA_LCD_Shield::HSA_LCD_Shield(char address, const char config[5]) {
|
|
|
+HSA_LCD_Shield::HSA_LCD_Shield(char address, const char config[0x05]) {
|
|
|
|
|
|
// Save I²C-Address
|
|
|
this->__i2cAddress = address;
|
|
@@ -77,7 +77,7 @@ HSA_LCD_Shield::HSA_LCD_Shield(char address) {
|
|
|
|
|
|
}
|
|
|
|
|
|
-HSA_LCD_Shield::HSA_LCD_Shield(const char config[5]){
|
|
|
+HSA_LCD_Shield::HSA_LCD_Shield(const char config[0x05]){
|
|
|
|
|
|
// Save I²C-Address
|
|
|
this->__i2cAddress = I2C_ADDRESS;
|
|
@@ -105,15 +105,20 @@ HSA_LCD_Shield::HSA_LCD_Shield(){
|
|
|
|
|
|
//////////////////// Deconstructor ////////////////////
|
|
|
|
|
|
-HSA_LCD_Shield::~HSA_LCD_Shield(void) {}
|
|
|
+HSA_LCD_Shield::~HSA_LCD_Shield(void) {
|
|
|
+
|
|
|
+ // Exit function
|
|
|
+ return;
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
//////////////////// Start Configuration ////////////////////
|
|
|
|
|
|
bool HSA_LCD_Shield::begin(void) {
|
|
|
|
|
|
// Check config-value and setup the LEDs, depending of config-value
|
|
|
- if(strcmp(this->__config,CONFIG_L1B0) == 0 ||
|
|
|
- strcmp(this->__config,CONFIG_L1B1) == 0) {
|
|
|
+ if(strcmp(this->__config,CONFIG_L1B0) == false ||
|
|
|
+ strcmp(this->__config,CONFIG_L1B1) == false) {
|
|
|
|
|
|
// Setup LEDs
|
|
|
pinMode(LED_GREEN,OUTPUT);
|
|
@@ -133,8 +138,8 @@ bool HSA_LCD_Shield::begin(void) {
|
|
|
}
|
|
|
|
|
|
// Check config-value and setup the Buttons depending of config-value
|
|
|
- if(strcmp(this->__config,CONFIG_L0B1) == 0 ||
|
|
|
- strcmp(this->__config,CONFIG_L1B1) == 0) {
|
|
|
+ if(strcmp(this->__config,CONFIG_L0B1) == false ||
|
|
|
+ strcmp(this->__config,CONFIG_L1B1) == false) {
|
|
|
|
|
|
// Setup Buttons
|
|
|
pinMode(BUTTON_UP,INPUT);
|
|
@@ -154,10 +159,10 @@ bool HSA_LCD_Shield::begin(void) {
|
|
|
}
|
|
|
|
|
|
// If config-value is unknown, quit configuration, otherwise configure I²C
|
|
|
- if(strcmp(this->__config,CONFIG_L1B1) != 0 &&
|
|
|
- strcmp(this->__config,CONFIG_L0B1) != 0 &&
|
|
|
- strcmp(this->__config,CONFIG_L1B0) != 0 &&
|
|
|
- strcmp(this->__config,CONFIG_L0B0) != 0) {
|
|
|
+ if(strcmp(this->__config,CONFIG_L1B1) != false &&
|
|
|
+ strcmp(this->__config,CONFIG_L0B1) != false &&
|
|
|
+ strcmp(this->__config,CONFIG_L1B0) != false &&
|
|
|
+ strcmp(this->__config,CONFIG_L0B0) != false) {
|
|
|
|
|
|
// Store the value false for buttons and LEDs are not configured
|
|
|
this->__buttons = false;
|
|
@@ -262,7 +267,7 @@ char HSA_LCD_Shield::getButton() {
|
|
|
!digitalRead(BUTTON_DOWN) &&
|
|
|
!digitalRead(BUTTON_LEFT) &&
|
|
|
this->__buttons)
|
|
|
- return 1;
|
|
|
+ return 0x01;
|
|
|
|
|
|
// return 2, if only button "Right" is pressed and configured
|
|
|
if(!digitalRead(BUTTON_UP) &&
|
|
@@ -270,7 +275,7 @@ char HSA_LCD_Shield::getButton() {
|
|
|
!digitalRead(BUTTON_DOWN) &&
|
|
|
!digitalRead(BUTTON_LEFT) &&
|
|
|
this->__buttons)
|
|
|
- return 2;
|
|
|
+ return 0x02;
|
|
|
|
|
|
// return 3, if only button "Down" is pressed and configured
|
|
|
if(!digitalRead(BUTTON_UP) &&
|
|
@@ -278,7 +283,7 @@ char HSA_LCD_Shield::getButton() {
|
|
|
digitalRead(BUTTON_DOWN) &&
|
|
|
!digitalRead(BUTTON_LEFT) &&
|
|
|
this->__buttons)
|
|
|
- return 3;
|
|
|
+ return 0x03;
|
|
|
|
|
|
// return 4, if only button "Left" is pressed and configured
|
|
|
if(!digitalRead(BUTTON_UP) &&
|
|
@@ -286,12 +291,439 @@ char HSA_LCD_Shield::getButton() {
|
|
|
!digitalRead(BUTTON_DOWN) &&
|
|
|
digitalRead(BUTTON_LEFT) &&
|
|
|
this->__buttons)
|
|
|
- return 4;
|
|
|
+ return 0x04;
|
|
|
|
|
|
// return 0, if no button or more than one button is pressed
|
|
|
- return 0;
|
|
|
+ return 0x00;
|
|
|
|
|
|
}
|
|
|
|
|
|
-//////////////////// Get the pressed Button ////////////////////
|
|
|
-//////////////////// Get the pressed Button ////////////////////
|
|
|
+//////////////////// Write Row 1 ////////////////////
|
|
|
+
|
|
|
+void HSA_LCD_Shield::writeRow1(const char* bytes) {
|
|
|
+
|
|
|
+ // Define buffer for test Message
|
|
|
+ byte buffer[ARRAY_SIZE_ROW] = "";
|
|
|
+
|
|
|
+ // Define variable to store a boolean value, if a control-byte was found
|
|
|
+ bool controlByte = false;
|
|
|
+
|
|
|
+ // Create data-array with message and send the message at the end
|
|
|
+ for(byte i = 0x00; i <= ARRAY_SIZE_ROW; i++){
|
|
|
+
|
|
|
+ // Set control-byte for changing parameter in the first iteration
|
|
|
+ if(i == 0x00) buffer[i] = CONTROL_BYTE_CB;
|
|
|
+
|
|
|
+ // Change the cursor position to row 1 in the second iteration
|
|
|
+ if(i == 0x01) buffer[i] = LCD_PARA_DIS_ROW1;
|
|
|
+
|
|
|
+ // Set control-byte for writing to the display in the third iteration
|
|
|
+ if(i == 0x02) buffer[i] = CONTROL_BYTE_DCB;
|
|
|
+
|
|
|
+ // Copy bytes into the buffer between iteration 2 to 13
|
|
|
+ if(i > 0x02 && i < ARRAY_SIZE_ROW) {
|
|
|
+
|
|
|
+ // If no control-byte was found, copy byte into buffer
|
|
|
+ if(!controlByte) {
|
|
|
+
|
|
|
+ // Check byte for control-byte, if not, copy byte into buffer
|
|
|
+ if(isControl(bytes[i - 0x03])) controlByte = true;
|
|
|
+ else buffer[i] = bytes[i - 0x03];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // If control-byte was found, fill message with free space
|
|
|
+ if(controlByte) {
|
|
|
+
|
|
|
+ // Fill Buffer with free space
|
|
|
+ buffer[i] = FREE_SPACE;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // Send message in the last iteration
|
|
|
+ if(i == ARRAY_SIZE_ROW) _sendMessage(buffer,sizeof(buffer));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // Exit function
|
|
|
+ return;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//////////////////// Write Row 2 ////////////////////
|
|
|
+
|
|
|
+void HSA_LCD_Shield::writeRow2(const char* bytes) {
|
|
|
+
|
|
|
+ // Define buffer for test Message
|
|
|
+ byte buffer[ARRAY_SIZE_ROW] = "";
|
|
|
+
|
|
|
+ // Define variable to store a boolean value, if a control-byte was found
|
|
|
+ bool controlByte = false;
|
|
|
+
|
|
|
+ // Create data-array with message and send the message at the end
|
|
|
+ for(byte i = 0x00; i <= ARRAY_SIZE_ROW; i++){
|
|
|
+
|
|
|
+ // Set control-byte for changing parameter in the first iteration
|
|
|
+ if(i == 0x00) buffer[i] = CONTROL_BYTE_CB;
|
|
|
+
|
|
|
+ // Change the cursor position to row 2 in the second iteration
|
|
|
+ if(i == 0x01) buffer[i] = LCD_PARA_DIS_ROW2;
|
|
|
+
|
|
|
+ // Set control-byte for writing to the display in the third iteration
|
|
|
+ if(i == 0x02) buffer[i] = CONTROL_BYTE_DCB;
|
|
|
+
|
|
|
+ // Copy bytes into the buffer between iteration 2 to 13
|
|
|
+ if(i > 0x02 && i < ARRAY_SIZE_ROW) {
|
|
|
+
|
|
|
+ // If no control-byte was found, copy byte into buffer
|
|
|
+ if(!controlByte) {
|
|
|
+
|
|
|
+ // Check byte for control-byte, if not, copy byte into buffer
|
|
|
+ if(isControl(bytes[i - 0x03])) controlByte = true;
|
|
|
+ else buffer[i] = bytes[i - 0x03];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // If control-byte was found, fill message with free space
|
|
|
+ if(controlByte) {
|
|
|
+
|
|
|
+ // Fill Buffer with free space
|
|
|
+ buffer[i] = FREE_SPACE;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // Send message in the last iteration
|
|
|
+ if(i == ARRAY_SIZE_ROW) _sendMessage(buffer,sizeof(buffer));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // Exit function
|
|
|
+ return;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//////////////////// Write Row 3 ////////////////////
|
|
|
+
|
|
|
+void HSA_LCD_Shield::writeRow3(const char* bytes) {
|
|
|
+
|
|
|
+ // Define buffer for test Message
|
|
|
+ byte buffer[ARRAY_SIZE_ROW] = "";
|
|
|
+
|
|
|
+ // Define variable to store a boolean value, if a control-byte was found
|
|
|
+ bool controlByte = false;
|
|
|
+
|
|
|
+ // Create data-array with message and send the message at the end
|
|
|
+ for(byte i = 0x00; i <= ARRAY_SIZE_ROW; i++){
|
|
|
+
|
|
|
+ // Set control-byte for changing parameter in the first iteration
|
|
|
+ if(i == 0x00) buffer[i] = CONTROL_BYTE_CB;
|
|
|
+
|
|
|
+ // Change the cursor position to row 3 in the second iteration
|
|
|
+ if(i == 0x01) buffer[i] = LCD_PARA_DIS_ROW3;
|
|
|
+
|
|
|
+ // Set control-byte for writing to the display in the third iteration
|
|
|
+ if(i == 0x02) buffer[i] = CONTROL_BYTE_DCB;
|
|
|
+
|
|
|
+ // Copy bytes into the buffer between iteration 2 to 13
|
|
|
+ if(i > 0x02 && i < ARRAY_SIZE_ROW) {
|
|
|
+
|
|
|
+ // If no control-byte was found, copy byte into buffer
|
|
|
+ if(!controlByte) {
|
|
|
+
|
|
|
+ // Check byte for control-byte
|
|
|
+ if(isControl(bytes[i - 0x03])) controlByte = true;
|
|
|
+
|
|
|
+ // If not, copy byte into buffer
|
|
|
+ else buffer[i] = bytes[i - 0x03];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // If control-byte was found, fill message with free space
|
|
|
+ if(controlByte) {
|
|
|
+
|
|
|
+ // Fill Buffer with free space
|
|
|
+ buffer[i] = FREE_SPACE;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // Send message in the last iteration
|
|
|
+ if(i == ARRAY_SIZE_ROW) _sendMessage(buffer,sizeof(buffer));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // Exit function
|
|
|
+ return;
|
|
|
+}
|
|
|
+
|
|
|
+//////////////////// Write Row 4 ////////////////////
|
|
|
+
|
|
|
+void HSA_LCD_Shield::writeRow4(const char* bytes) {
|
|
|
+
|
|
|
+ // Define buffer for test Message
|
|
|
+ byte buffer[ARRAY_SIZE_ROW] = "";
|
|
|
+
|
|
|
+ // Define variable to store a boolean value, if a control-byte was found
|
|
|
+ bool controlByte = false;
|
|
|
+
|
|
|
+ // Create data-array with message and send the message at the end
|
|
|
+ for(byte i = 0x00; i <= ARRAY_SIZE_ROW; i++){
|
|
|
+
|
|
|
+ // Set control-byte for changing parameter in the first iteration
|
|
|
+ if(i == 0x00) buffer[i] = CONTROL_BYTE_CB;
|
|
|
+
|
|
|
+ // Change the cursor position to row 4 in the second iteration
|
|
|
+ if(i == 0x01) buffer[i] = LCD_PARA_DIS_ROW4;
|
|
|
+
|
|
|
+ // Set control-byte for writing to the display in the third iteration
|
|
|
+ if(i == 0x02) buffer[i] = CONTROL_BYTE_DCB;
|
|
|
+
|
|
|
+ // Copy bytes into the buffer between iteration 2 to 13
|
|
|
+ if(i > 0x02 && i < ARRAY_SIZE_ROW) {
|
|
|
+
|
|
|
+ // If no control-byte was found, copy byte into buffer
|
|
|
+ if(!controlByte) {
|
|
|
+
|
|
|
+ // Check byte for control-byte
|
|
|
+ if(isControl(bytes[i - 0x03])) controlByte = true;
|
|
|
+
|
|
|
+ // if not, copy byte into buffer
|
|
|
+ else buffer[i] = bytes[i - 0x03];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // If control-byte was found, fill message with free space
|
|
|
+ if(controlByte) {
|
|
|
+
|
|
|
+ // Fill Buffer with free space
|
|
|
+ buffer[i] = FREE_SPACE;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // Send message in the last iteration
|
|
|
+ if(i == ARRAY_SIZE_ROW) _sendMessage(buffer,sizeof(buffer));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // Exit function
|
|
|
+ return;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//////////////////// Write 4 Rows ////////////////////
|
|
|
+
|
|
|
+void HSA_LCD_Shield::write4Rows(const char* bytes) {
|
|
|
+
|
|
|
+ // Define buffer for test Message
|
|
|
+ char buffer[ARRAY_SIZE_ROW] = "";
|
|
|
+
|
|
|
+ // Define variable to store the actual row position
|
|
|
+ byte rowPosition = LCD_PARA_DIS_ROW1;
|
|
|
+
|
|
|
+ // Define variable, which count the copied bytes
|
|
|
+ byte countBytes = 0x00;
|
|
|
+
|
|
|
+ // Create data-array with messages for 4 rows and send the messages
|
|
|
+ for(byte i = 0x00; i < 0x28; i++){
|
|
|
+
|
|
|
+ // If the position of the row is not selected, skip following code
|
|
|
+ if(rowPosition == false) continue;
|
|
|
+
|
|
|
+ // If first row is selected
|
|
|
+ if(rowPosition == LCD_PARA_DIS_ROW1) {
|
|
|
+
|
|
|
+ // If counted bytes has not reach max value, copy byte into buffer
|
|
|
+ if(countBytes < 0x0A) buffer[countBytes] = bytes[i];
|
|
|
+
|
|
|
+ // Check, if copied byte was control-byte
|
|
|
+ if(isControl(bytes[i])) {
|
|
|
+
|
|
|
+ // Check if control-byte was \n or \r or end of string,
|
|
|
+ // set counted bytes to max value
|
|
|
+ if(bytes[i] == BACKSLASH_N ||
|
|
|
+ bytes[i] == BACKSLASH_R ||
|
|
|
+ bytes[i] == STRING_END)
|
|
|
+ countBytes = 0x0A;
|
|
|
+
|
|
|
+ // Check if control-byte was end of the string, deactivate row position
|
|
|
+ if(bytes[i] == STRING_END) rowPosition = false;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // Otherwise increase counted bytes
|
|
|
+ else countBytes++;
|
|
|
+
|
|
|
+ // If count bytes is max value
|
|
|
+ if(countBytes == 0x0A) {
|
|
|
+
|
|
|
+ // Reset count bytes
|
|
|
+ countBytes = 0x00;
|
|
|
+
|
|
|
+ // write first row
|
|
|
+ writeRow1(buffer);
|
|
|
+
|
|
|
+ // If row position is deactivated
|
|
|
+ if(rowPosition == false) {
|
|
|
+
|
|
|
+ // clear following rows
|
|
|
+ writeRow2(&bytes[i]);
|
|
|
+ writeRow3(&bytes[i]);
|
|
|
+ writeRow4(&bytes[i]);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // Otherwise set row position the row 2
|
|
|
+ else rowPosition = LCD_PARA_DIS_ROW2;
|
|
|
+
|
|
|
+ // skip the rest of the code in this iteration
|
|
|
+ continue;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // If second row is selected
|
|
|
+ if(rowPosition == LCD_PARA_DIS_ROW2) {
|
|
|
+
|
|
|
+ // If counted bytes has not reach max value, copy byte into buffer
|
|
|
+ if(countBytes < 0x0A) buffer[countBytes] = bytes[i];
|
|
|
+
|
|
|
+ // Check, if copied byte was control-byte
|
|
|
+ if(isControl(bytes[i])) {
|
|
|
+
|
|
|
+ // Check if control-byte was \n or \r or end of string,
|
|
|
+ // set counted bytes to max value
|
|
|
+ if(bytes[i] == BACKSLASH_N ||
|
|
|
+ bytes[i] == BACKSLASH_R ||
|
|
|
+ bytes[i] == STRING_END)
|
|
|
+ countBytes = 0x0A;
|
|
|
+
|
|
|
+ // Check if control-byte was end of the string, deactivate row position
|
|
|
+ if(bytes[i] == STRING_END) rowPosition = false;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // Otherwise increase counted bytes
|
|
|
+ else countBytes++;
|
|
|
+
|
|
|
+ // If count bytes is max value
|
|
|
+ if(countBytes == 0x0A) {
|
|
|
+
|
|
|
+ // Reset count bytes
|
|
|
+ countBytes = 0x00;
|
|
|
+
|
|
|
+ // write second row
|
|
|
+ writeRow2(buffer);
|
|
|
+
|
|
|
+ // If row position is deactivated
|
|
|
+ if(rowPosition == false) {
|
|
|
+
|
|
|
+ // clear following rows
|
|
|
+ writeRow3(&bytes[i]);
|
|
|
+ writeRow4(&bytes[i]);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // Otherwise set row position the row 3
|
|
|
+ else rowPosition = LCD_PARA_DIS_ROW3;
|
|
|
+
|
|
|
+ // skip the rest of the code in this iteration
|
|
|
+ continue;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // If third row is selected
|
|
|
+ if(rowPosition == LCD_PARA_DIS_ROW3) {
|
|
|
+
|
|
|
+ // If counted bytes has not reach max value, copy byte into buffer
|
|
|
+ if(countBytes < 0x0A) buffer[countBytes] = bytes[i];
|
|
|
+
|
|
|
+ // Check, if copied byte was control-byte
|
|
|
+ if(isControl(bytes[i])) {
|
|
|
+
|
|
|
+ // Check if control-byte was \n or \r or end of string,
|
|
|
+ // set counted bytes to max value
|
|
|
+ if(bytes[i] == BACKSLASH_N ||
|
|
|
+ bytes[i] == BACKSLASH_R ||
|
|
|
+ bytes[i] == STRING_END)
|
|
|
+ countBytes = 0x0A;
|
|
|
+
|
|
|
+ // Check if control-byte was end of the string, deactivate row position
|
|
|
+ if(bytes[i] == STRING_END) rowPosition = false;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // Otherwise increase counted bytes
|
|
|
+ else countBytes++;
|
|
|
+
|
|
|
+ // If count bytes is max value
|
|
|
+ if(countBytes == 0x0A) {
|
|
|
+
|
|
|
+ // Reset count bytes
|
|
|
+ countBytes = 0x00;
|
|
|
+
|
|
|
+ // write third row
|
|
|
+ writeRow3(buffer);
|
|
|
+
|
|
|
+ // If row position is deactivated, clear following row
|
|
|
+ if(rowPosition == false) writeRow4(&bytes[i]);
|
|
|
+
|
|
|
+ // Otherwise set row position the row 4
|
|
|
+ else rowPosition = LCD_PARA_DIS_ROW4;
|
|
|
+
|
|
|
+ // skip the rest of the code in this iteration
|
|
|
+ continue;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // If fourth row is selected
|
|
|
+ if(rowPosition == LCD_PARA_DIS_ROW4) {
|
|
|
+
|
|
|
+ // If counted bytes has not reach max value, copy byte into buffer
|
|
|
+ if(countBytes < 0x0A) buffer[countBytes] = bytes[i];
|
|
|
+
|
|
|
+ // Check, if copied byte was control-byte
|
|
|
+ if(isControl(bytes[i])) {
|
|
|
+
|
|
|
+ // Check if control-byte was \n or \r or end of string,
|
|
|
+ // set counted bytes to max value
|
|
|
+ if(bytes[i] == BACKSLASH_N ||
|
|
|
+ bytes[i] == BACKSLASH_R ||
|
|
|
+ bytes[i] == STRING_END)
|
|
|
+ countBytes = 0x0A;
|
|
|
+
|
|
|
+ // Check if control-byte was end of the string, deactivate row position
|
|
|
+ if(bytes[i] == STRING_END) rowPosition = false;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // Otherwise increase counted bytes
|
|
|
+ else countBytes++;
|
|
|
+
|
|
|
+ // If count bytes is max value
|
|
|
+ if(countBytes == 0x0A) {
|
|
|
+
|
|
|
+ // Reset count bytes
|
|
|
+ countBytes = 0x00;
|
|
|
+
|
|
|
+ // write fourth row
|
|
|
+ writeRow4(buffer);
|
|
|
+
|
|
|
+ // If row position is not deactivated, deaktivate row position
|
|
|
+ if(rowPosition != false) rowPosition = false;
|
|
|
+
|
|
|
+ // skip the rest of the code in this iteration
|
|
|
+ continue;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // Exit function
|
|
|
+ return;
|
|
|
+
|
|
|
+}
|