improve logging
This commit is contained in:
@@ -48,18 +48,18 @@ typedef struct {
|
|||||||
} DisplayMessage;
|
} DisplayMessage;
|
||||||
|
|
||||||
static void init_epaper_display() {
|
static void init_epaper_display() {
|
||||||
printf("Initializing 7.5\" e-Paper display (B V2)...\r\n");
|
printf("[Core 1] Initializing 7.5\" e-Paper display (B V2)...\r\n");
|
||||||
|
|
||||||
// Initialize the hardware
|
// Initialize the hardware
|
||||||
if (DEV_Module_Init() != 0) {
|
if (DEV_Module_Init() != 0) {
|
||||||
printf("Failed to initialize e-Paper hardware!\r\n");
|
printf("[Core 1] Failed to initialize e-Paper hardware!\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize the display
|
// Initialize the display
|
||||||
printf("EPD_7IN5B_V2_Init()\r\n");
|
printf("[Core 1] EPD_7IN5B_V2_Init()\r\n");
|
||||||
EPD_7IN5B_V2_Init_Fast();
|
EPD_7IN5B_V2_Init_Fast();
|
||||||
printf("EPD_7IN5B_V2_Clear()\r\n");
|
printf("[Core 1] EPD_7IN5B_V2_Clear()\r\n");
|
||||||
|
|
||||||
// Create image buffers for black and red content
|
// Create image buffers for black and red content
|
||||||
// 7.5" display: 800x480, 8 pixels per byte, so (800/8) * 480 = 48000 bytes each
|
// 7.5" display: 800x480, 8 pixels per byte, so (800/8) * 480 = 48000 bytes each
|
||||||
@@ -69,7 +69,7 @@ static void init_epaper_display() {
|
|||||||
g_epd_red = (UBYTE *)malloc(imagesize);
|
g_epd_red = (UBYTE *)malloc(imagesize);
|
||||||
|
|
||||||
if (g_epd_image == NULL || g_epd_red == NULL) {
|
if (g_epd_image == NULL || g_epd_red == NULL) {
|
||||||
printf("Failed to allocate memory for e-Paper image buffers!\r\n");
|
printf("[Core 1] Failed to allocate memory for e-Paper image buffers!\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ static void init_epaper_display() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setup paint buffer for black content
|
// Setup paint buffer for black content
|
||||||
printf("White background\r\n");
|
printf("[Core 1] White background\r\n");
|
||||||
Paint_NewImage(g_epd_image, EPD_7IN5B_V2_WIDTH, EPD_7IN5B_V2_HEIGHT, 0, WHITE);
|
Paint_NewImage(g_epd_image, EPD_7IN5B_V2_WIDTH, EPD_7IN5B_V2_HEIGHT, 0, WHITE);
|
||||||
Paint_SelectImage(g_epd_image);
|
Paint_SelectImage(g_epd_image);
|
||||||
Paint_Clear(WHITE);
|
Paint_Clear(WHITE);
|
||||||
@@ -90,12 +90,13 @@ static void init_epaper_display() {
|
|||||||
EPD_7IN5B_V2_Display_Partial(g_epd_image, 0, 0, EPD_7IN5B_V2_WIDTH, EPD_7IN5B_V2_HEIGHT);
|
EPD_7IN5B_V2_Display_Partial(g_epd_image, 0, 0, EPD_7IN5B_V2_WIDTH, EPD_7IN5B_V2_HEIGHT);
|
||||||
EPD_7IN5B_V2_Display_Partial(g_epd_image, 0, 0, EPD_7IN5B_V2_WIDTH, EPD_7IN5B_V2_HEIGHT);
|
EPD_7IN5B_V2_Display_Partial(g_epd_image, 0, 0, EPD_7IN5B_V2_WIDTH, EPD_7IN5B_V2_HEIGHT);
|
||||||
|
|
||||||
printf("Trying to connect to wifi\r\n");
|
printf("[Core 1] Trying to connect to wifi\r\n");
|
||||||
bool connected = wifi_try_auto_connect();
|
bool connected = wifi_try_auto_connect();
|
||||||
|
printf("[Core 1] Connected: %d\r\n", connected);
|
||||||
|
|
||||||
|
|
||||||
Paint_SelectImage(g_epd_red);
|
Paint_SelectImage(g_epd_red);
|
||||||
printf("Drawing header\r\n");
|
printf("[Core 1] Drawing header\r\n");
|
||||||
if (connected) {
|
if (connected) {
|
||||||
Paint_DrawString_EN(10, 10, "What's new today: ...", &Font24, WHITE, RED);
|
Paint_DrawString_EN(10, 10, "What's new today: ...", &Font24, WHITE, RED);
|
||||||
} else {
|
} else {
|
||||||
@@ -106,7 +107,7 @@ static void init_epaper_display() {
|
|||||||
// Display the image with both black and red buffers
|
// Display the image with both black and red buffers
|
||||||
EPD_7IN5B_V2_Display_Partial(g_epd_red, 0, 0, EPD_7IN5B_V2_WIDTH, EPD_7IN5B_V2_HEIGHT);
|
EPD_7IN5B_V2_Display_Partial(g_epd_red, 0, 0, EPD_7IN5B_V2_WIDTH, EPD_7IN5B_V2_HEIGHT);
|
||||||
|
|
||||||
printf("e-Paper display ready!\r\n");
|
printf("[Core 1] e-Paper display ready!\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -172,7 +173,7 @@ static void core1_display_init() {
|
|||||||
Paint_DrawString_EN(20, 50 + i*25, msg->entries.entries[i], &Font16, WHITE, BLACK);
|
Paint_DrawString_EN(20, 50 + i*25, msg->entries.entries[i], &Font16, WHITE, BLACK);
|
||||||
y_pos += 25; // Space between entries
|
y_pos += 25; // Space between entries
|
||||||
} else {
|
} else {
|
||||||
printf("Skipping entry to avoid overflow\n");
|
printf("[Core 1] Skipping entry to avoid overflow\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Use partial or full refresh
|
// Use partial or full refresh
|
||||||
@@ -192,7 +193,7 @@ void epaper_start_background_thread() {
|
|||||||
// Initialize the queue before starting the thread
|
// Initialize the queue before starting the thread
|
||||||
queue_init(&g_display_queue, sizeof(DisplayMessage*), QUEUE_LENGTH);
|
queue_init(&g_display_queue, sizeof(DisplayMessage*), QUEUE_LENGTH);
|
||||||
|
|
||||||
printf("Launching e-Paper display init on core 1...\n");
|
printf("[Core 0] Launching e-Paper display init on core 1...\n");
|
||||||
multicore_launch_core1(core1_display_init);
|
multicore_launch_core1(core1_display_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,7 +216,7 @@ void epaper_send_update(const char *entry, bool finish_line) {
|
|||||||
// Allocate message structure
|
// Allocate message structure
|
||||||
DisplayMessage *msg = (DisplayMessage *)malloc(sizeof(DisplayMessage));
|
DisplayMessage *msg = (DisplayMessage *)malloc(sizeof(DisplayMessage));
|
||||||
if (msg == NULL) {
|
if (msg == NULL) {
|
||||||
printf("Failed to allocate display message!\n");
|
printf("[Core 0] Failed to allocate display message!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user