diff --git a/APP_Framework/Applications/app_test/Makefile b/APP_Framework/Applications/app_test/Makefile index 7b554d013..1e89361c4 100644 --- a/APP_Framework/Applications/app_test/Makefile +++ b/APP_Framework/Applications/app_test/Makefile @@ -24,7 +24,7 @@ endif ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := test_shell.c - SRC_FILES += test_hash.c + ifeq ($(CONFIG_USER_TEST_ADC),y) SRC_FILES += test_adc.c endif diff --git a/APP_Framework/Applications/app_test/test_hash.c b/APP_Framework/Applications/app_test/test_hash.c deleted file mode 100644 index 14539fc3e..000000000 --- a/APP_Framework/Applications/app_test/test_hash.c +++ /dev/null @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2020 AIIT XUOS Lab -* XiUOS is licensed under Mulan PSL v2. -* You can use this software according to the terms and conditions of the Mulan PSL v2. -* You may obtain a copy of Mulan PSL v2 at: -* http://license.coscl.org.cn/MulanPSL2 -* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -* See the Mulan PSL v2 for more details. -*/ - -/** -* @file: test_ethernet.c -* @brief: a application of ethernet function -* @version: 1.1 -* @author: AIIT XUOS Lab -* @date: 2022/12/17 -*/ -#include -#include -#include -#include - -int Testhash(void) -{ - Element a[]={{12,1},{2,2},{31,3},{45,4},{8,5},{45,5}}; - - int n = sizeof(a)/sizeof(Element); - Hash_table *h = Creat_Table(n); - int i = 0; - for(i = 0 ; idata->value); //查找key值为12的Element - printf("%d\n",h->length); //打印哈希表的元素个数 - Destroy_Table(h); // 摧毁哈希表 - - return 0; -} - -PRIV_SHELL_CMD_FUNCTION(Testhash, a hash test sample, PRIV_SHELL_CMD_MAIN_ATTR); \ No newline at end of file diff --git a/APP_Framework/Applications/connection_app/Makefile b/APP_Framework/Applications/connection_app/Makefile index 2ed5cc480..8aa357308 100755 --- a/APP_Framework/Applications/connection_app/Makefile +++ b/APP_Framework/Applications/connection_app/Makefile @@ -14,7 +14,7 @@ ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) ifeq ($(CONFIG_RESOURCES_LWIP),y) SRC_DIR += socket_demo endif - SRC_DIR +=mqtt_demo + include $(KERNEL_ROOT)/compiler.mk endif diff --git a/Ubiquitous/XiZi_IIoT/kernel/include/xs_hash.h b/Ubiquitous/XiZi_IIoT/kernel/include/xs_hash.h deleted file mode 100644 index 4423d9573..000000000 --- a/Ubiquitous/XiZi_IIoT/kernel/include/xs_hash.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2020 AIIT XUOS Lab - * XiUOS is licensed under Mulan PSL v2. - * You can use this software according to the terms and conditions of the Mulan PSL v2. - * You may obtain a copy of Mulan PSL v2 at: - * http://license.coscl.org.cn/MulanPSL2 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v2 for more details. - */ - -/** -* @file: xs_hash.h -* @brief: hash table -* @version: 1.0 -* @author: AIIT XUOS Lab -* @date: 2023/7/10 -* -*/ - -#include -#include -#include -#include "xs_base.h" - -#define REMAINDER 11 - -typedef struct element -{ - uint8_t key; - uint8_t value; - uint8_t hash; -}Element; - - -typedef struct Pnode -{ - Element *data; - struct Pnode *next; -}Node; - - -typedef struct hash_table -{ - uint8_t size; - uint8_t length; - struct Pnode *head; -}Hash_table; - - -Hash_table* Creat_Table(int table_size) -{ - Hash_table *h = (Hash_table *)malloc(sizeof(Hash_table)); - h->size = REMAINDER; - h->head = (Node *)malloc((h->size)*sizeof(Node)); - h->length = 0; - int i = 0; - for(i=0 ; isize ; i++) - { - h->head[i].next = NULL; - } - return h; -} - -int hash(int value) -{ - return value%REMAINDER; -} - -Node *lookup(Hash_table *h , int key) -{ - int i; - i = hash(key); - Node * p = h->head[i].next; - while(p && key != p->data->key) - { - p = p->next; - } - - return p; -} - - - -void Insert(Hash_table *h , Element k) -{ - Node * p = lookup(h,k.key); - if(!p) - { - Node *q = (Node *)malloc(sizeof(Node)); - q->data = (Element *)malloc(sizeof(Element)); - (q->data)->key = k.key; - (q->data)->value = k.value; - int position; - position = (q->data)->hash = hash(k.key); - q->next = h->head[position].next; - h->head[position].next = q; - - h->length += 1; - return ; - } - else - { - printf("The keys is exist !\n"); - return ; - } -} - -void Destroy_Table(Hash_table *h) -{ - int i; - Node *p , *q; - for(i=0 ; isize ; i++) - { - p = h->head[i].next; - while(p) - { - q=p->next; - free(p); - p=q; - } - } - free(h->head); - free(h); -} - - -void print_Table(Hash_table *h) -{ - int i = 0; - for (i = 0; i < h->size ; i++) - { - Node * p = h->head[i].next; - while (p) - { - printf("[%d-%d] ",p->data->key, p->data->value); - p = p->next; - } - printf("NULL\n"); - } -} - - diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/Makefile b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/Makefile index d61a6f138..3b2116a85 100644 --- a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/Makefile +++ b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/Makefile @@ -2,7 +2,7 @@ SRC_DIR += api SRC_DIR += arch SRC_DIR += core SRC_DIR += netif -SRC_DIR += include + SRC_DIR += apps @@ -10,7 +10,7 @@ LWIP_DIR += api LWIP_DIR += arch LWIP_DIR += core LWIP_DIR += netif -LWIP_DIR += include + LWIP_DIR += apps diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/lwipopts.h b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/lwipopts.h index 726e37ea8..7ee9d1273 100644 --- a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/lwipopts.h +++ b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/lwipopts.h @@ -46,7 +46,6 @@ // #define LWIP_API_MSG_DEBUG #endif -// #define LWIP_SOCKETS_DEBUG 1 #ifdef LWIP_DEBUG #ifdef LWIP_SYS_DEBUG diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/include/Makefile b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/include/Makefile deleted file mode 100644 index c53e661a4..000000000 --- a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/include/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -SRC_DIR += lwip - -LWIP_DIR += lwip - - -include $(KERNEL_ROOT)/compiler.mk \ No newline at end of file diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/include/lwip/Makefile b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/include/lwip/Makefile deleted file mode 100644 index 1d8dcd833..000000000 --- a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/include/lwip/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -SRC_DIR += apps - -LWIP_DIR += apps - - -include $(KERNEL_ROOT)/compiler.mk \ No newline at end of file