From 6172e8e83e14de6e14ce6aa019a88f17067e95db Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 27 Jul 2025 12:13:38 -0400 Subject: [PATCH 1/6] Update main.c getchars until empty --- main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index e1959111..0a62003d 100644 --- a/main.c +++ b/main.c @@ -2102,7 +2102,13 @@ int get_payload_serial(int debug_camera) { end_flag_detected = FALSE; jpeg_start = 0; - serialFlush (uart_fd); // flush serial buffer so latest payload is read +// serialFlush (uart_fd); // flush serial buffer so latest payload is read + + while (serialDataAvail(uart_fd)) { + (void) serialGetchar(uart_fd); +// printf("%c", octet); +// fflush(stdout); + } // #ifdef GET_IMAGE_DEBUG if (debug_camera) From 54e62eb1a7d57050b1ba03c4307060df037966c6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 27 Jul 2025 12:25:05 -0400 Subject: [PATCH 2/6] Update main.c count discards --- main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 0a62003d..ad650323 100644 --- a/main.c +++ b/main.c @@ -2103,13 +2103,15 @@ int get_payload_serial(int debug_camera) { jpeg_start = 0; // serialFlush (uart_fd); // flush serial buffer so latest payload is read - + int discard = 0; while (serialDataAvail(uart_fd)) { (void) serialGetchar(uart_fd); + discard++; // printf("%c", octet); // fflush(stdout); } - + printf("\ndiscard: %d \n\n", discard); + // #ifdef GET_IMAGE_DEBUG if (debug_camera) printf("Received from Payload:\n"); From 2df1e474d59eca9898b6d0631d65d4ca90432265 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 27 Jul 2025 12:38:08 -0400 Subject: [PATCH 3/6] Update main.c fix sensor XS1,2,3 min and max --- main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index ad650323..964e6e2f 100644 --- a/main.c +++ b/main.c @@ -1483,9 +1483,9 @@ void get_tlm_fox() { encodeB(b_max, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5)); encodeA(b_max, 45 + head_offset, (int)(sensor_max[HUMI] * 10 + 0.5)); - encodeB(b_max, 49 + head_offset, (int)(sensor[XS1])); - encodeA(b_max, 0 + head_offset, (int)(sensor[XS2])); - encodeB(b_max, 1 + head_offset, (int)(sensor[XS3])); + encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS1])); + encodeA(b_max, 0 + head_offset, (int)(sensor_max[XS2])); + encodeB(b_max, 1 + head_offset, (int)(sensor_max[XS3])); } else { @@ -1540,9 +1540,9 @@ void get_tlm_fox() { encodeB(b_min, 10 + head_offset, (int)(sensor_min[TEMP] * 10 + 0.5)); encodeA(b_min, 45 + head_offset, (int)(sensor_min[HUMI] * 10 + 0.5)); - encodeB(b_min, 49 + head_offset, (int)(sensor[XS1])); - encodeA(b_min, 0 + head_offset, (int)(sensor[XS2])); - encodeB(b_min, 1 + head_offset, (int)(sensor[XS3])); + encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS1])); + encodeA(b_min, 0 + head_offset, (int)(sensor_min[XS2])); + encodeB(b_min, 1 + head_offset, (int)(sensor_min[XS3])); } else { From ecaa6d51ac26b9ae76a7f8a3d178fa77f420af29 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 27 Jul 2025 12:44:22 -0400 Subject: [PATCH 4/6] Update main.c back to serialFlush --- main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main.c b/main.c index 964e6e2f..acb8b316 100644 --- a/main.c +++ b/main.c @@ -2102,15 +2102,15 @@ int get_payload_serial(int debug_camera) { end_flag_detected = FALSE; jpeg_start = 0; -// serialFlush (uart_fd); // flush serial buffer so latest payload is read - int discard = 0; - while (serialDataAvail(uart_fd)) { - (void) serialGetchar(uart_fd); - discard++; + serialFlush (uart_fd); // flush serial buffer so latest payload is read +// int discard = 0; +// while (serialDataAvail(uart_fd)) { +// (void) serialGetchar(uart_fd); +// discard++; // printf("%c", octet); // fflush(stdout); - } - printf("\ndiscard: %d \n\n", discard); +// } +// printf("\ndiscard: %d \n\n", discard); // #ifdef GET_IMAGE_DEBUG if (debug_camera) From db4adb772ef944172a978e988eda94e7b0ac4954 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 27 Jul 2025 12:49:05 -0400 Subject: [PATCH 5/6] Update main.c remove manual flush code --- main.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main.c b/main.c index acb8b316..8444f3da 100644 --- a/main.c +++ b/main.c @@ -2103,14 +2103,6 @@ int get_payload_serial(int debug_camera) { jpeg_start = 0; serialFlush (uart_fd); // flush serial buffer so latest payload is read -// int discard = 0; -// while (serialDataAvail(uart_fd)) { -// (void) serialGetchar(uart_fd); -// discard++; -// printf("%c", octet); -// fflush(stdout); -// } -// printf("\ndiscard: %d \n\n", discard); // #ifdef GET_IMAGE_DEBUG if (debug_camera) From e048259ef45128a2af9994403fd8c6faeec4bb3f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 27 Jul 2025 14:34:14 -0400 Subject: [PATCH 6/6] Update main.c remove extra space --- main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.c b/main.c index 8444f3da..ff1d3654 100644 --- a/main.c +++ b/main.c @@ -2102,8 +2102,7 @@ int get_payload_serial(int debug_camera) { end_flag_detected = FALSE; jpeg_start = 0; - serialFlush (uart_fd); // flush serial buffer so latest payload is read - + serialFlush (uart_fd); // flush serial buffer so latest payload is read // #ifdef GET_IMAGE_DEBUG if (debug_camera) printf("Received from Payload:\n");