formating

This commit is contained in:
philippe44
2020-01-07 14:58:50 -08:00
parent 4a08f1c5c5
commit b34b3ad08e

View File

@@ -43,7 +43,7 @@ unsigned char printable(unsigned char c) {
break;; break;;
case 152: /* bell */ case 152: /* bell */
return 'o'; return 'o';
break;; break;
default: default:
return c; return c;
} }
@@ -51,7 +51,7 @@ unsigned char printable(unsigned char c) {
// Replace unprintable symbols in line // Replace unprintable symbols in line
void makeprintable(unsigned char * line) { void makeprintable(unsigned char * line) {
for (int n=0; n < LINELEN; n++) line[n] = printable(line[n]); for (int n = 0; n < LINELEN; n++) line[n] = printable(line[n]);
} }
// Show the display // Show the display
@@ -67,6 +67,7 @@ void show_display_buffer(char *ddram) {
/* Convert special LCD chars */ /* Convert special LCD chars */
makeprintable((unsigned char *)line1); makeprintable((unsigned char *)line1);
makeprintable((unsigned char *)line2); makeprintable((unsigned char *)line2);
ESP_LOGI(TAG, "\n\t%.40s\n\t%.40s", line1, line2); ESP_LOGI(TAG, "\n\t%.40s\n\t%.40s", line1, line2);
} }
@@ -96,7 +97,8 @@ void vfd_data( unsigned short *data, int bytes_read) {
display_data = &(data[6]); /* display data starts at byte 12 */ display_data = &(data[6]); /* display data starts at byte 12 */
memset(ddram, ' ', LINELEN * 2); memset(ddram, ' ', LINELEN * 2);
for (n=0; n<(bytes_read/2); n++) {
for (n = 0; n < (bytes_read/2); n++) {
unsigned short d; /* data element */ unsigned short d; /* data element */
unsigned char t, c; unsigned char t, c;
@@ -124,5 +126,6 @@ void vfd_data( unsigned short *data, int bytes_read) {
} }
} }
} }
show_display_buffer(ddram); show_display_buffer(ddram);
} }