|
|
@@ -131,82 +131,100 @@ void DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR
|
|
|
|
|
|
|
|
|
void DISPLAY_DEV_CTRL__println(DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A,
|
|
|
- DISPLAY_array16_T DISPLAY_array16_A ,
|
|
|
+ #if defined(DISPLAY_array16_T_is_DISPLAY_string_T)
|
|
|
+ DISPLAY_string_T DISPLAY_string_A,
|
|
|
+ #else
|
|
|
+ DISPLAY_array16_T DISPLAY_array16_A ,
|
|
|
+ #endif
|
|
|
+
|
|
|
+
|
|
|
DISPLAY_pos_seq_T DISPLAY_pos_seq_A
|
|
|
) {
|
|
|
DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ;
|
|
|
- // DISPLAY_DEV.print(DISPLAY_array16_A);
|
|
|
- // unsigned char LCDarray1buf[16];
|
|
|
- // DISPLAY_array16_A.toCharArray(LCDarray1buf, 16);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- String message(DISPLAY_array16_A);
|
|
|
-
|
|
|
- if(DISPLAY_pos_seq_A & DISPLAY_pos_seq_A_CLEARSCREEN) DISPLAY_DEV__CURSOR__clearScreen(DISPLAY_PHYSICAL_CHAR_A) ;
|
|
|
-
|
|
|
- int parts = floor(message.length()/ DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A ) ; //( message.length() + 100)
|
|
|
- if(message.length() >= DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A and parts == 1) parts ++;
|
|
|
- else if(parts == 0) parts = 1;
|
|
|
- int substr_begin = 0 ;
|
|
|
- int substr_end = 0 ;
|
|
|
- int i;
|
|
|
-
|
|
|
- #if defined(DEBUG)
|
|
|
- if(DEBUG > 6) {
|
|
|
- Serial.print("#34 arr16"); Serial.print(DISPLAY_array16_A);
|
|
|
- Serial.print("] #34 sizeof["); Serial.print(message.length());
|
|
|
- Serial.print("] #34 String["); Serial.print(message);
|
|
|
- Serial.print("] #34 frag"); Serial.print( message.substring(2, 5));
|
|
|
- Serial.print("] parts["); Serial.print( parts);
|
|
|
- Serial.print("] yC["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A);
|
|
|
- Serial.println("] ");
|
|
|
- }
|
|
|
- #endif
|
|
|
-
|
|
|
- int bufi;
|
|
|
- char buf[1];
|
|
|
- for(i = 1 ; i<= parts; i++) {
|
|
|
- //myString.substring(from, to)
|
|
|
- substr_end = substr_begin + DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A ;
|
|
|
- DISPLAY_DEV.print(message.substring(substr_begin, substr_end));
|
|
|
- /*BUG TODO ERROR IF UNCOMMENTED*/
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /* for(bufi = 0; bufi <= 16; bufi++) {
|
|
|
- message.substring(substr_begin + bufi, substr_begin + bufi + 1).toCharArray(buf,1);
|
|
|
- //DISPLAY_DEV.print(buf.substring(bufi, bufi+1));
|
|
|
- DISPLAY_DEV.print(buf[0]);
|
|
|
- }
|
|
|
- */
|
|
|
- #if defined(DEBUG)
|
|
|
- if(DEBUG > 6) {
|
|
|
- Serial.print("#112 msg part["); Serial.print(i);
|
|
|
- Serial.print("] beg["); Serial.print(substr_begin);
|
|
|
- Serial.print("] end["); Serial.print(substr_end);
|
|
|
- Serial.print("] frag["); Serial.print(message.substring(substr_begin, substr_end));
|
|
|
- Serial.print("] yC["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A);
|
|
|
- Serial.println("] ");
|
|
|
- }
|
|
|
- #endif
|
|
|
-
|
|
|
- substr_begin = substr_end + 1;
|
|
|
- if( parts >= 1 and not(parts == i)) {
|
|
|
-
|
|
|
- DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ;
|
|
|
- } //else if(i == parts) {
|
|
|
- // DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ;
|
|
|
- // }
|
|
|
- }
|
|
|
- /*BUG TODO ERROR IF UNCOMMENTED
|
|
|
- // Serial.end(); // Ends the serial communication once all data is received
|
|
|
- //Serial.begin(115200);
|
|
|
- // delay(400);
|
|
|
- // if (Serial.available()) Serial.write("aaaa49 ");
|
|
|
- //delay(100);
|
|
|
- // if (Serial.available()) Serial.println("bbbb49 ");
|
|
|
- // else Serial.println("cccc49 ");
|
|
|
- */
|
|
|
+ #if defined(DISPLAY_array16_T_is_DISPLAY_string_T)
|
|
|
+ DISPLAY_DEV.print(DISPLAY_string_A);
|
|
|
+ #else
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ String message(DISPLAY_array16_A);
|
|
|
+
|
|
|
+ if(DISPLAY_pos_seq_A & DISPLAY_pos_seq_A_CLEARSCREEN) DISPLAY_DEV__CURSOR__clearScreen(DISPLAY_PHYSICAL_CHAR_A) ;
|
|
|
+
|
|
|
+ int parts = floor(message.length()/ DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A ) ; //( message.length() + 100)
|
|
|
+ if(message.length() >= DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A and parts == 1) parts ++;
|
|
|
+ else if(parts == 0) parts = 1;
|
|
|
+ int substr_begin = 0 ;
|
|
|
+ int substr_end = 0 ;
|
|
|
+ int i;
|
|
|
+
|
|
|
+ #if defined(DEBUG)
|
|
|
+ if(DEBUG > 6) {
|
|
|
+ Serial.print("#34 arr16"); Serial.print(DISPLAY_array16_A);
|
|
|
+ Serial.print("] #34 sizeof["); Serial.print(message.length());
|
|
|
+ Serial.print("] #34 String["); Serial.print(message);
|
|
|
+ Serial.print("] #34 frag"); Serial.print( message.substring(2, 5));
|
|
|
+ Serial.print("] parts["); Serial.print( parts);
|
|
|
+ Serial.print("] yC["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A);
|
|
|
+ Serial.println("] ");
|
|
|
+ }
|
|
|
+ #endif
|
|
|
+
|
|
|
+ int bufi;
|
|
|
+ char buf[1];
|
|
|
+ for(i = 1 ; i<= parts; i++) {
|
|
|
+ //myString.substring(from, to)
|
|
|
+ substr_end = substr_begin + DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A ;
|
|
|
+ DISPLAY_DEV.print(message.substring(substr_begin, substr_end));
|
|
|
+ /*BUG TODO ERROR IF UNCOMMENTED*/
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /* for(bufi = 0; bufi <= 16; bufi++) {
|
|
|
+ message.substring(substr_begin + bufi, substr_begin + bufi + 1).toCharArray(buf,1);
|
|
|
+ //DISPLAY_DEV.print(buf.substring(bufi, bufi+1));
|
|
|
+ DISPLAY_DEV.print(buf[0]);
|
|
|
+ }
|
|
|
+ */
|
|
|
+ #if defined(DEBUG)
|
|
|
+ if(DEBUG > 6) {
|
|
|
+ Serial.print("#112 msg part["); Serial.print(i);
|
|
|
+ Serial.print("] beg["); Serial.print(substr_begin);
|
|
|
+ Serial.print("] end["); Serial.print(substr_end);
|
|
|
+ Serial.print("] frag["); Serial.print(message.substring(substr_begin, substr_end));
|
|
|
+ Serial.print("] yC["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A);
|
|
|
+ Serial.println("] ");
|
|
|
+ }
|
|
|
+ #endif
|
|
|
+
|
|
|
+ substr_begin = substr_end + 1;
|
|
|
+ if( parts >= 1 and not(parts == i)) {
|
|
|
+
|
|
|
+ DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ;
|
|
|
+ } //else if(i == parts) {
|
|
|
+ // DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ /*BUG TODO ERROR IF UNCOMMENTED
|
|
|
+ // Serial.end(); // Ends the serial communication once all data is received
|
|
|
+ //Serial.begin(115200);
|
|
|
+ // delay(400);
|
|
|
+ // if (Serial.available()) Serial.write("aaaa49 ");
|
|
|
+ //delay(100);
|
|
|
+ // if (Serial.available()) Serial.println("bbbb49 ");
|
|
|
+ // else Serial.println("cccc49 ");
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ #endif
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|