From 911360c0e8683f9d61c023d844e961dddfd353ea Mon Sep 17 00:00:00 2001 From: Gatsby Van Date: Wed, 24 Jan 2024 10:53:17 +0800 Subject: [PATCH] bugfix: avoid NONE value after startup. --- df_datalink_sp/src/system_monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/df_datalink_sp/src/system_monitor.c b/df_datalink_sp/src/system_monitor.c index 7399e56..41f1271 100644 --- a/df_datalink_sp/src/system_monitor.c +++ b/df_datalink_sp/src/system_monitor.c @@ -56,7 +56,7 @@ inline uint8_t GetWritable(PINGPONG ctrllor) inline uint8_t GetReadable(PINGPONG ctrllor) { if (ctrllor.wBusy == BUFF_NONE || ctrllor.wBusy != ctrllor.latest) - return ctrllor.latest; + return ((ctrllor.latest == BUFF_NONE) ? BUFF_A : BUFF_B); else return ((ctrllor.wBusy == BUFF_B) ? BUFF_A : BUFF_B); }