From e95cd19292ebfa4873c5adaccd7bab8dc112e91b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 21 Aug 2022 07:24:54 -0400 Subject: [PATCH] added GET_IMAGE_DEBUG prints --- cubesatsim/pico-get-jpeg-serial.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cubesatsim/pico-get-jpeg-serial.cpp b/cubesatsim/pico-get-jpeg-serial.cpp index 5b517406..5975d7b2 100644 --- a/cubesatsim/pico-get-jpeg-serial.cpp +++ b/cubesatsim/pico-get-jpeg-serial.cpp @@ -14,6 +14,8 @@ int end_flag_detected = false; int jpeg_start = 0; FastCRC8 CRC8; +#define GET_IMAGE_DEBUG + //#define DEBUG //#define PICOW true @@ -139,6 +141,10 @@ void loop() { */ void get_image_file() { + +#ifdef GET_IMAGE_DEBUG + Serial.println("Starting get_image_file"); + #endif finished = false; while (!finished) { // put your main code here, to run repeatedly: @@ -151,7 +157,9 @@ void get_image_file() { if (octet == end_flag[flag_count]) { // looking for end flag // if (end_flag_detected) { flag_count++; -// Serial.println("Found part of end flag!"); +#ifdef GET_IMAGE_DEBUG + Serial.println("Found part of end flag!"); +#endif if (flag_count >= strlen(end_flag)) { // complete image /// buffer2[index1++] = octet; Serial.println("\nFound end flag"); @@ -172,7 +180,7 @@ void get_image_file() { // index1 -= 1; uint8_t * data = (uint8_t *) &buffer2[0]; -#ifdef DEBUG +#ifdef GET_IMAGE_DEBUG Serial.println("\nCRC cacluation data:"); Serial.println(buffer2[0], HEX); Serial.println(buffer2[index1 - 1], HEX); @@ -200,7 +208,7 @@ void get_image_file() { } /// buffer2[index1++] = octet; -#ifdef DEBUG +#ifdef GET_IMAGE_DEBUG char hexValue[5]; if (octet != 0x66) { sprintf(hexValue, "%02X", octet);