Sfoglia il codice sorgente

SPI功能正常,gpio调试完成

huang_chao 1 anno fa
parent
commit
71afda5c85

+ 1 - 1
build_all.sh

@@ -4,7 +4,7 @@ export Start_at=`date +%H:%M:%S`
 export PROJECT_ROOT=$PWD
 export curtitle="cmd:"$0
 export ret="0"
-export def_proj="EC800GCN_GA"
+export def_proj="EC600GCN_LA"
 export buildtype_src=$1
 export hardware_type="UIS8850DG"
 export ql_ext_flash="N"

+ 0 - 3
components/CMakeLists.txt

@@ -71,8 +71,5 @@ add_subdirectory_if_exist(ql-application)
 add_subdirectory_if_exist(ql-kernel)
 if(CONFIG_QUEC_PROJECT_FEATURE_VSIM_ADAPT_STD)
 add_subdirectory_if_exist(ql-application/vsim_img)
-
-
-add_subdirectory_if_exist(sdmmc)
 endif()
 endif()

+ 2 - 1
components/net/lwip/src/core/ipv4/ip4_addr.c

@@ -119,7 +119,8 @@ ip4_addr_netmask_valid(u32_t netmask)
  * @param cp IP address in ascii representation (e.g. "127.0.0.1")
  * @return ip address in network order
  */
-u32_t ipaddr_addr(const char *cp)
+u32_t
+ipaddr_addr(const char *cp)
 {
   ip4_addr_t val;
 

BIN
components/newlib/armca5/libql_newlib.a


+ 5 - 1
components/ql-application/CMakeLists.txt

@@ -266,4 +266,8 @@ endif()
 
 if(QL_APP_FEATURE_WIFI)
 add_subdirectory_if_exist(wifi)
-endif()
+endif()
+
+if(HC_APP_FEATURE_MOID8ID)
+add_subdirectory_if_exist(mod8id_sdk)
+endif()

+ 4 - 0
components/ql-application/init/CMakeLists.txt

@@ -261,6 +261,10 @@ if(NOT QL_PROJECT_MIXER AND NOT CONFIG_QUEC_PROJECT_FEATURE_VSIM_ADAPT_STD)
 		target_link_libraries(${target} PRIVATE ql_app_wifi)
 	endif()
 
+	if(HC_APP_FEATURE_MOID8ID)
+		target_link_libraries(${target} PRIVATE hc_app_moid8id)
+	endif()
+
 relative_glob(srcs *.h *.c)
 beautify_c_code(${target} ${srcs})
 endif()

+ 3 - 2
components/ql-application/init/ql_init.c

@@ -87,6 +87,7 @@ WHEN              WHO         WHAT, WHERE, WHY
 #include "socket_demo.h"
 #endif
 
+#include "app_moid8id_hc.h"
 
 #ifdef QL_APP_FEATURE_FILE_ZIP
 #include "zip_demo.h"
@@ -453,7 +454,7 @@ static void ql_init_demo_thread(void *param)
 	//ql_qthsdk_app_init();
 #endif
 #ifdef QL_APP_FEATURE_SOCKET
-	//ql_socket_app_init();
+	ql_socket_app_init();
 #endif
     
 #ifdef QL_APP_FEATURE_MMS
@@ -654,7 +655,7 @@ static void ql_init_demo_thread(void *param)
     ql_sdmmc_app_init();
     ql_spi_demo_init(); 
     ql_power_app_init();
-
+    hc_moid_app_init();
  
 #if 0
     ql_fota_ftp_app_init();

+ 13 - 6
components/ql-application/ntp/ntp_demo.c

@@ -29,7 +29,7 @@ WHEN              WHO         WHAT, WHERE, WHY
 #include "ql_api_datacall.h"
 #include "ql_ntp_client.h"
 #include "ql_api_rtc.h"
-
+//#include "ntp_info_decode.h"
 #define QL_NTP_LOG_LEVEL	            QL_LOG_LEVEL_INFO
 #define QL_NTP_LOG(msg, ...)			QL_LOG(QL_NTP_LOG_LEVEL, "ql_NTP_DEMO", msg, ##__VA_ARGS__)
 #define QL_NTP_LOG_PUSH(msg, ...)	    QL_LOG_PUSH("ql_NTP_DEMO", msg, ##__VA_ARGS__)
@@ -39,13 +39,15 @@ static ql_task_t ntp_task = NULL;
 static ntp_client_id  ntp_cli_id = 0;
 static ql_sem_t  ntp_semp;
 
+
 static void ntp_result_cb(ntp_client_id     cli_id, int result, struct tm *sync_time, void *arg)
 {
     ql_rtc_time_t time;
 	if(ntp_cli_id != cli_id)
 		return;
 
-	if(result == QL_NTP_SUCCESS){
+	if(result == QL_NTP_SUCCESS)
+	{
 		char time_str[256] = {0};
 
 		snprintf(time_str, 256, "%04d/%02d/%02d,%02d:%02d:%02d",sync_time->tm_year + 1900, sync_time->tm_mon + 1, sync_time->tm_mday,
@@ -62,7 +64,9 @@ static void ntp_result_cb(ntp_client_id     cli_id, int result, struct tm *sync_
 		{
 			QL_NTP_LOG("ntp set RTC time failed");
 		}
-	}else{
+	}
+	else
+	{
 		QL_NTP_LOG("ntp sync failed :%d", result);
 	}
 	ql_rtos_semaphore_release(ntp_semp);
@@ -82,7 +86,8 @@ static void ntp_app_thread(void * arg)
 	QL_NTP_LOG("wait for network register done");
 
 	ql_rtos_semaphore_create(&ntp_semp, 0);
-	while((ret = ql_network_register_wait(nSim, 120)) != 0 && i < 10){
+	while((ret = ql_network_register_wait(nSim, 120)) != 0 && i < 10)
+	{
     	i++;
 		ql_rtos_task_sleep_s(1);
 	}
@@ -136,9 +141,11 @@ static void ntp_app_thread(void * arg)
 
 		ntp_cli_id = ql_ntp_sync("ntp.aliyun.com", &sync_option, ntp_result_cb, NULL, &error_num);
 		
-		if(ntp_cli_id != 0){
+		if(ntp_cli_id != 0)
+		{
 			ql_rtos_semaphore_wait(ntp_semp, QL_WAIT_FOREVER);
-		}else{
+		}else
+		{
 			QL_NTP_LOG("ntp failed");
 		}
 		QL_NTP_LOG("==============ntp_test_end[%d]================\n",run_num);

+ 1 - 0
components/ql-application/peripheral/gpio_demo.c

@@ -51,6 +51,7 @@ static ql_gpio_cfg _ql_gpio_cfg[] =
  ===========================================================================*/
 void _ql_gpio_demo_init(  void)
 {
+    
     uint16_t num;
     for( num = 0; num < sizeof(_ql_gpio_cfg)/sizeof(_ql_gpio_cfg[0]); num++ )
     {

+ 4 - 0
components/ql-application/ql_app_feature_config.cmake

@@ -633,6 +633,10 @@ message(STATUS "FEATURE WIFI  is disabled at core!")
 option(QL_APP_FEATURE_WIFI   "Enable WIFI" OFF)
 endif()
 message(STATUS "QL_APP_FEATURE_WIFI  ${QL_APP_FEATURE_WIFI}")
+
+option(HC_APP_FEATURE_MOID8ID   "Enable MOID8ID" ON)
+
+
 ################################################################################################################
 # Quectel open sdk package config
 ################################################################################################################

+ 6 - 0
components/ql-application/ql_app_feature_config.h.in

@@ -430,4 +430,10 @@
  * whether to eanble APP feature WIFI
  */
 #cmakedefine QL_APP_FEATURE_WIFI
+
+/**
+ * whether to eanble APP feature MOID8ID
+ */
+#cmakedefine HC_APP_FEATURE_MOID8ID
+
 #endif

+ 1 - 2
components/ql-application/socket/CMakeLists.txt

@@ -11,8 +11,7 @@ target_include_directories(${target} PUBLIC inc)
 #target_link_libraries(${target} PRIVATE kernel driver ql_api_common)
 
 target_sources(${target} PRIVATE
-	socket_demo.c
-)
+	socket_demo.c ntp_info_decode.c)
 
 relative_glob(srcs include/*.h src/*.c inc/*.h)
 beautify_c_code(${target} ${srcs})

+ 4 - 2
components/ql-application/socket/inc/socket_demo.h

@@ -31,14 +31,16 @@ WHEN        WHO            WHAT, WHERE, WHY
 #ifdef __cplusplus
 		extern "C" {
 #endif
-		
+#include "ntp_info_decode.h"	
 		
 		
 		/*========================================================================
 		 *	function Definition
 		 *========================================================================*/
 int ql_socket_app_init(void);
-		
+	
+
+
 #ifdef __cplusplus
 		}/*"C" */
 #endif

File diff suppressed because it is too large
+ 79 - 890
components/ql-application/socket/socket_demo.c


+ 9 - 4
components/ql-application/spi/spi_demo.c

@@ -354,7 +354,7 @@ static void ql_spi_demo_task_pthread(void *ctx)
     ql_autosleep_enable(QL_ALLOW_SLEEP);
     ql_rtos_task_sleep_s(2);
 #endif
-    static uint8_t cmd_type = 0;
+    //static uint8_t cmd_type = 0;
     OTA_FLAG = 1;
     while(1)
     {
@@ -364,7 +364,7 @@ static void ql_spi_demo_task_pthread(void *ctx)
             QL_SPI_DEMO_LOG("ota test mode");
             data_mpu_pack(outdata, &outlen, 0X60, 0X03, spiclk);;
         }
-
+        #if 0
         cmd_type = cmd_type + 1 > 4 ? 1 : cmd_type + 1;
         data_mpu_pack(outdata, &outlen, 0X50, cmd_type, spiclk);;
         spi_dma_write_hc(QL_CUR_SPI_PORT, outdata, 512, spiclk);
@@ -373,9 +373,14 @@ static void ql_spi_demo_task_pthread(void *ctx)
         unsigned short sendLen = 0;
         ql_spi_flash_data_printf(indata, 512);
         data_decode_mpu(indata, 512, outdata, &sendLen, spiclk);
-        
-        data_mpu_pack(outdata, &outlen, 0X60, cmd_type, spiclk);;
+        if(0X03 != cmd_type)
+        {
+            data_mpu_pack(outdata, &outlen, 0X60, cmd_type, spiclk);
+
+        }
         spi_dma_write_hc(QL_CUR_SPI_PORT, outdata, 512, spiclk);
+        spi_dma_read_hc(QL_CUR_SPI_PORT, indata, 512, spiclk);
+        #endif
         ql_rtos_task_sleep_ms(500);
     }   
     ql_spi_release(QL_CUR_SPI_PORT);

+ 1 - 1
components/ql-kernel/inc/ql_gpio.h

@@ -328,7 +328,7 @@ ql_errcode_gpio ql_pin_set_func(uint8_t pin_num, uint8_t func_sel);
 ql_errcode_gpio ql_pin_get_func(uint8_t pin_num, uint8_t *func_sel);
 
 /**
- * @brief Pin function set to GPIO
+ * @brief  
  * @param pin_num  : Pin number
  * @return
  *       QL_GPIO_INVALID_PARAM_ERR

Some files were not shown because too many files changed in this diff