From f03cf3ae7a36954e64fc014e6bb7afd20c5a5247 Mon Sep 17 00:00:00 2001
From: jinlicong <493886250@qq.com>
Date: Wed, 12 Jun 2024 17:22:08 +0800
Subject: [PATCH] 增加IAP功能,准备测试上位机升级

---
 Soft/linked_list.c |  124 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 124 insertions(+), 0 deletions(-)

diff --git a/Soft/linked_list.c b/Soft/linked_list.c
new file mode 100644
index 0000000..290b323
--- /dev/null
+++ b/Soft/linked_list.c
@@ -0,0 +1,124 @@
+#include "linked_list.h"
+#include "stdlib.h"
+
+
+ALARM_NODE_T * pList_head = NULL;
+uint8_t alarm_list_cnt = 0;
+	
+///*����ͷ���ݹ���*/
+//ALARM_NODE_T * Alarm_List_Node_HeadCreated(ALARM_NODE_T * pHead,SYS_ALARM_VALVE_T alarm_id)
+//{
+//	if(pHead->list_data == AV_NORMAL && pHead->alarm_list_next == NULL)
+//	{
+//		pHead->list_data = alarm_id;
+//	}
+//	return pHead;
+//}
+/*���붯̬����ռ�*/
+ALARM_NODE_T * Alarm_List_Node_Add(SYS_ALARM_VALVE_T alarm_id)
+{
+	ALARM_NODE_T * ptr = (ALARM_NODE_T * )malloc(ALARM_LIST_NODE_LEN);
+	if(ptr != NULL)
+	{
+		ptr->list_data = alarm_id;
+		ptr->alarm_list_next = NULL;
+		return ptr;
+	}
+	return NULL;
+}
+//�������
+//˫��ָ�룺ָ��ָ���ָ�룬�����ı�ָ���ַ��ֵ�������˫��ָ��
+void Alarm_List_Node_PushBack(ALARM_NODE_T ** ppList,SYS_ALARM_VALVE_T alarm_id)
+{
+//	ALARM_NODE_T * tail, * now_ptr;
+//	
+//	if(alarm_id != ALARM_ID_NORMAL)
+//	{
+//		alarm_list_cnt++;
+//		if(*ppList == NULL)
+//		{
+//			*ppList = Alarm_List_Node_Add(alarm_id);
+//		}
+//		else
+//		{
+//			//�ж��������Ƿ��Ѿ����ڸñ���id���Ѿ����ڲ��ٲ�������
+//			do{
+//				if(now_ptr->list_data == alarm_id){
+//					return;
+//				}else{
+//					now_ptr = now_ptr->alarm_list_next;
+//				}
+//				
+//			}while(now_ptr != NULL);
+//			
+//			tail = *ppList;
+//			while(tail->alarm_list_next)
+//				tail = tail->alarm_list_next;
+//			tail->alarm_list_next = Alarm_List_Node_Add(alarm_id);
+//		}
+//	}
+}
+//�������βɾ
+void Alarm_List_Node_PopBack(ALARM_NODE_T ** ppList)
+{
+	ALARM_NODE_T * tail = *ppList;
+	while (tail->alarm_list_next->alarm_list_next)
+	{
+		tail = tail->alarm_list_next;
+	}
+	free(tail->alarm_list_next);
+	tail->alarm_list_next = NULL;
+}
+////���������
+//ALARM_NODE_T * Alarm_List_Node_Find(ALARM_NODE_T * pList,SYS_ALARM_VALVE_T alarm_id)
+//{
+//	ALARM_NODE_T * cur_ptr = pList;
+//	while(cur_ptr)
+//	{
+//		if(cur_ptr->list_data == alarm_id)
+//			return cur_ptr;
+//		cur_ptr = cur_ptr->alarm_list_next;
+//	}
+//	return NULL;
+//}	
+//�������м�ɾ��
+void Alarm_List_Node_Deleted(ALARM_NODE_T ** ppHeadList,SYS_ALARM_VALVE_T alarm_id)
+{
+//	if(alarm_id != ALARM_ID_NORMAL)
+//	{
+//		ALARM_NODE_T * last_ptr,* now_ptr;
+//		if(*ppHeadList == NULL)
+//			return;
+//		else
+//		{
+//			now_ptr = *ppHeadList;
+//			while(now_ptr->alarm_list_next != NULL && now_ptr->list_data != alarm_id)
+//			{
+//				last_ptr = now_ptr;
+//				now_ptr = now_ptr->alarm_list_next;
+//			}
+//			if(now_ptr->list_data == alarm_id)
+//			{
+//				alarm_list_cnt--;
+//				if(now_ptr == *ppHeadList)
+//					*ppHeadList = now_ptr->alarm_list_next;
+//				else
+//					last_ptr->alarm_list_next = now_ptr->alarm_list_next;
+//				free(now_ptr);
+//				now_ptr = NULL;
+//			}
+//		}
+//	}
+}
+
+
+
+
+
+
+
+
+
+
+
+

--
Gitblit v1.9.3