|
|
@@ -18,6 +18,7 @@
|
|
|
#include "task.h"
|
|
|
#include "Com_cpld_protocol.h"
|
|
|
#include "Com_cpld_usart.h"
|
|
|
+#include "Com_usb_cdc.h"
|
|
|
#include "Mid_pid.h"
|
|
|
#include "Mid_temp.h"
|
|
|
|
|
|
@@ -50,7 +51,7 @@ static void App_Cpld_DumpSnapshot(void)
|
|
|
const mid_temp_snapshot_t *s = Mid_Temp_GetSnapshot();
|
|
|
uint8_t i;
|
|
|
|
|
|
- printf("[SNAP] mode=%d fault=%04X wd=%d/%d manual=%d "
|
|
|
+ TELEMETRY_PRINTF("[SNAP] mode=%d fault=%04X wd=%d/%d manual=%d "
|
|
|
"bmc(v%d st%d) ct(v%d st%d) hardprot=%d "
|
|
|
"ep(bmc=%u ct=%u ctrl=%u) age(bmc=%u ct=%u)\r\n",
|
|
|
(int)s->mode, (int)s->fault_flags,
|
|
|
@@ -63,39 +64,39 @@ static void App_Cpld_DumpSnapshot(void)
|
|
|
(unsigned)s->control_epoch,
|
|
|
(unsigned)s->bmc_age, (unsigned)s->ct_age);
|
|
|
|
|
|
- printf("[BMC 0-11] ");
|
|
|
+ TELEMETRY_PRINTF("[BMC 0-11] ");
|
|
|
for (i = 0; i < 12; i++)
|
|
|
{
|
|
|
- printf("%d=%d ", (int)i, (int)s->bmc[i]);
|
|
|
+ TELEMETRY_PRINTF("%d=%d ", (int)i, (int)s->bmc[i]);
|
|
|
}
|
|
|
- printf("\r\n[BMC 12-23] ");
|
|
|
+ TELEMETRY_PRINTF("\r\n[BMC 12-23] ");
|
|
|
for (i = 12; i < 24; i++)
|
|
|
{
|
|
|
- printf("%d=%d ", (int)i, (int)s->bmc[i]);
|
|
|
+ TELEMETRY_PRINTF("%d=%d ", (int)i, (int)s->bmc[i]);
|
|
|
}
|
|
|
|
|
|
- printf("\r\n[CT 0-13] ");
|
|
|
+ TELEMETRY_PRINTF("\r\n[CT 0-13] ");
|
|
|
for (i = 0; i < 14; i++)
|
|
|
{
|
|
|
- printf("%d=%d ", (int)i, (int)s->ct[i]);
|
|
|
+ TELEMETRY_PRINTF("%d=%d ", (int)i, (int)s->ct[i]);
|
|
|
}
|
|
|
- printf("\r\n[CT 14-26] ");
|
|
|
+ TELEMETRY_PRINTF("\r\n[CT 14-26] ");
|
|
|
for (i = 14; i < 27; i++)
|
|
|
{
|
|
|
- printf("%d=%d ", (int)i, (int)s->ct[i]);
|
|
|
+ TELEMETRY_PRINTF("%d=%d ", (int)i, (int)s->ct[i]);
|
|
|
}
|
|
|
|
|
|
- printf("\r\n[PTC] req:");
|
|
|
+ TELEMETRY_PRINTF("\r\n[PTC] req:");
|
|
|
for (i = 0; i < 24; i++)
|
|
|
{
|
|
|
- printf(" %d", (int)s->ptc_requested[i]);
|
|
|
+ TELEMETRY_PRINTF(" %d", (int)s->ptc_requested[i]);
|
|
|
}
|
|
|
- printf("\r\n app:");
|
|
|
+ TELEMETRY_PRINTF("\r\n app:");
|
|
|
for (i = 0; i < 24; i++)
|
|
|
{
|
|
|
- printf(" %d", (int)s->ptc_applied[i]);
|
|
|
+ TELEMETRY_PRINTF(" %d", (int)s->ptc_applied[i]);
|
|
|
}
|
|
|
- printf("\r\n[FAN] front req/app: %d/%d %d/%d %d/%d %d/%d | "
|
|
|
+ TELEMETRY_PRINTF("\r\n[FAN] front req/app: %d/%d %d/%d %d/%d %d/%d | "
|
|
|
"rear req/app: %d/%d %d/%d %d/%d %d/%d\r\n",
|
|
|
(int)s->front_requested[0], (int)s->front_applied[0],
|
|
|
(int)s->front_requested[1], (int)s->front_applied[1],
|
|
|
@@ -158,12 +159,12 @@ static void App_Cpld_PollRx(void)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- printf("[ERR] snapshot len=%d\r\n", (int)plen);
|
|
|
+ LOG_PRINTF("[ERR] CPLD: snapshot len=%d\r\n", (int)plen);
|
|
|
}
|
|
|
}
|
|
|
else if (type == COM_CPLD_TYPE_ACK_NACK)
|
|
|
{
|
|
|
- printf("[ACK] ok=%d req=0x%02X st=%d detail=%d\r\n",
|
|
|
+ TELEMETRY_PRINTF("[ACK] ok=%d req=0x%02X st=%d detail=%d\r\n",
|
|
|
(int)payload[0], (int)payload[1],
|
|
|
(int)payload[2], (int)payload[3]);
|
|
|
}
|
|
|
@@ -221,7 +222,7 @@ static void Task_CPLD_Process(void *argument)
|
|
|
uint8_t frame[COM_CPLD_FRAME_MAX_LEN];
|
|
|
uint16_t flen;
|
|
|
|
|
|
- printf("CPLD process task running...\r\n");
|
|
|
+ LOG_PRINTF("[INFO] CPLD: task running\r\n");
|
|
|
|
|
|
Mid_PID_Init();
|
|
|
Mid_Temp_Init();
|
|
|
@@ -264,6 +265,6 @@ void App_cpld_task_create(void)
|
|
|
NULL, TASK_CPLD_PRIORITY, &xCPLDProcessTaskHandle);
|
|
|
if (ret != pdPASS)
|
|
|
{
|
|
|
- printf("[ERR] CPLD process task create failed\r\n");
|
|
|
+ LOG_PRINTF("[ERR] CPLD: task create failed\r\n");
|
|
|
}
|
|
|
}
|