103
This commit is contained in:
parent
3bbb500a61
commit
d8558bd8d4
@ -346,12 +346,14 @@ static void parse_and_dispatch_tlv(TcpStreamCtx_t *ctx, const uint8_t *packet,
|
||||
cfg_updated = 1;
|
||||
qdx_port_mutex_unlock(g_TcpLogic.config_mutex);
|
||||
DBG_CFG("<< Config1D: En=%d RunMode=%d TrigType=%d "
|
||||
"BufSz=%d TempLim=%d NGio=%d\r\n",
|
||||
"BufSz=%d TempLim=%d L=%d R=%d NGio=%d\r\n",
|
||||
(int)g_TcpLogic.cached_cfg1d.Enabled,
|
||||
(int)g_TcpLogic.cached_cfg1d.RunMode,
|
||||
(int)g_TcpLogic.cached_cfg1d.TriggerType,
|
||||
(int)g_TcpLogic.cached_cfg1d.BufferSize,
|
||||
(int)g_TcpLogic.cached_cfg1d.TriggerTempLimit,
|
||||
(int)g_TcpLogic.cached_cfg1d.LSizeStart,
|
||||
(int)g_TcpLogic.cached_cfg1d.RSizeStart,
|
||||
(int)g_TcpLogic.cached_cfg1d.NGioDelay);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -97,7 +97,7 @@
|
||||
#define configTICK_RATE_HZ ( ( TickType_t ) 500 )
|
||||
#define configMAX_PRIORITIES ( 15 )
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 ) /* Can be as low as 60 but some of the demo tasks that use this constant require it to be higher. */
|
||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 12 * 1024 ) )
|
||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) )
|
||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||
#define configUSE_TRACE_FACILITY 0
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
/* ============================================================
|
||||
* TX Buffers (double-buffered for zero-copy)
|
||||
* ============================================================ */
|
||||
#define MAX_TCP_PAYLOAD_SIZE 10240
|
||||
#define MAX_TCP_PAYLOAD_SIZE 9216
|
||||
uint8_t g_TxNetBuffer_A_Mem[MAX_TCP_PAYLOAD_SIZE];
|
||||
uint8_t g_TxNetBuffer_B_Mem[MAX_TCP_PAYLOAD_SIZE];
|
||||
|
||||
@ -454,18 +454,17 @@ static void task_test_pattern_entry(void *pvParameters)
|
||||
|
||||
/*
|
||||
* Extract one representative temperature from a raw frame for 1D.
|
||||
* Uses max temperature of the center row.
|
||||
* Returns the global maximum temperature across the entire frame.
|
||||
*/
|
||||
static uint16_t get_1d_sample(const RawImageBuffer_t *raw)
|
||||
{
|
||||
uint16_t w = raw->Width;
|
||||
uint16_t h = raw->Height;
|
||||
uint16_t row = h / 2;
|
||||
uint16_t *src = raw->pData;
|
||||
uint16_t max_temp = 0;
|
||||
for (uint16_t x = 0; x < w; x++) {
|
||||
uint16_t t = src[row * w + x];
|
||||
if (t > max_temp) max_temp = t;
|
||||
uint32_t total = (uint32_t)w * h;
|
||||
for (uint32_t i = 0; i < total; i++) {
|
||||
if (src[i] > max_temp) max_temp = src[i];
|
||||
}
|
||||
return max_temp;
|
||||
}
|
||||
@ -494,10 +493,18 @@ static void send_1d_collection(const Config1D_t *cfg, uint8_t *use_buf_a)
|
||||
uint16_t end = s1d_count;
|
||||
if (cfg->RSizeStart > 0 && cfg->RSizeStart < end)
|
||||
end -= cfg->RSizeStart;
|
||||
/* Clamp: ensure valid slice even if server sends bad L/R values */
|
||||
if (start >= end) {
|
||||
DBG_ERR("1D: slice empty start=%d end=%d\r\n", (int)start, (int)end);
|
||||
if (s1d_count > 0) {
|
||||
DBG_ERR("1D: slice clamp L=%d R=%d cnt=%d\r\n",
|
||||
(int)cfg->LSizeStart, (int)cfg->RSizeStart, (int)s1d_count);
|
||||
start = 0;
|
||||
end = s1d_count;
|
||||
} else {
|
||||
DBG_ERR("1D: no data to send\r\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
uint16_t n = end - start;
|
||||
|
||||
TcpTxBuffer_t *tx_buf = (*use_buf_a) ? &g_TxNetBuffer_A : &g_TxNetBuffer_B;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user