Optionally print debug information

This commit is contained in:
fruchti 2024-08-24 20:51:17 +02:00
parent 3f6016106b
commit dc61ac7f85
4 changed files with 24 additions and 2 deletions

View file

@ -1 +1 @@
562
615

View file

@ -16,3 +16,6 @@
// Maximum number of frames to wait. Capture even if it is not within tolerance.
#define CONFIG_MAX_FRAMES 15
// Print number of black pixels per captured frame
// #define CONFIG_PRINT_EXPOSURE_DEBUG_INFORMATION

View file

@ -22,6 +22,24 @@ int main(void)
extern uint8_t ImageBuffer[CAMERA_IMAGE_WIDTH * CAMERA_IMAGE_HEIGHT / 8];
Print_Image(ImageBuffer, CAMERA_IMAGE_WIDTH, CAMERA_IMAGE_HEIGHT, 2);
#ifdef CONFIG_PRINT_EXPOSURE_DEBUG_INFORMATION
char buffer[32] = "Finished after lines: ";
itoa(Camera_FinalFrameCount, buffer + strlen(buffer), 10);
Print_Text(buffer, &Arpegius_32);
Print_Text("Black pixel counts:", &Arpegius_32);
for(int i = 0; i < Camera_FinalFrameCount; i++)
{
if(i >= (int)(sizeof(Camera_BlackPixelCounts)
/ sizeof(Camera_BlackPixelCounts[0])))
{
break;
}
itoa(Camera_BlackPixelCounts[i], buffer, 10);
Print_Text(buffer, &Arpegius_32);
}
#endif
LTP1245_FeedPaper(100);
BMP_Save(ImageBuffer, CAMERA_IMAGE_WIDTH, CAMERA_IMAGE_HEIGHT);

View file

@ -16,6 +16,7 @@
#include "font_arpegius_16.h"
#include "font_arpegius_32.h"
#include "bmp.h"
#include "config.h"
int main(void);