87 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			87 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
|  | /****************************************************************************
 | ||
|  | 
 | ||
|  | Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED. | ||
|  | 
 | ||
|  | This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT | ||
|  | be copied by any method or incorporated into another program without | ||
|  | the express written consent of Aerospace C.Power. This Information or any portion | ||
|  | thereof remains the property of Aerospace C.Power. The Information contained herein | ||
|  | is believed to be accurate and Aerospace C.Power assumes no responsibility or | ||
|  | liability for its use in any way and conveys no license or title under | ||
|  | any patent or copyright and makes no representation or warranty that this | ||
|  | Information is free from patent or copyright infringement. | ||
|  | 
 | ||
|  | ****************************************************************************/ | ||
|  | 
 | ||
|  | #include "os_task_api.h"
 | ||
|  | #include "os_event_api.h"
 | ||
|  | #include "os_timer_api.h"
 | ||
|  | #include "os_utils_api.h"
 | ||
|  | #include "iot_task_api.h"
 | ||
|  | #include "iot_module_api.h"
 | ||
|  | #include "os_lock_api.h"
 | ||
|  | #include "iot_plc_cco_api.h"
 | ||
|  | #include "iot_config_api.h"
 | ||
|  | #include "iot_app_api.h"
 | ||
|  | #include "iot_errno_api.h"
 | ||
|  | 
 | ||
|  | #include "demo.h"
 | ||
|  | 
 | ||
|  | #if IOT_DEMO_APP_ENABLE
 | ||
|  | extern int32_t iot_cus_printf(const char *fmt, ...); | ||
|  | extern void iot_print_config(bool_t enable); | ||
|  | 
 | ||
|  | int iot_demo_debug = IOT_DEMO_DEBUG_INFO|IOT_DEMO_DEBUG_ERROR; | ||
|  | 
 | ||
|  | void app_demo_main_bin_dmp(void * data, uint32_t len) | ||
|  | { | ||
|  |     char *pch = (char *)data; | ||
|  |     uint32_t cnt; | ||
|  | 
 | ||
|  |     if(NULL == data) | ||
|  |     { | ||
|  |         return; | ||
|  |     } | ||
|  | 
 | ||
|  |     for(cnt = 0; cnt < len; cnt++) | ||
|  |     { | ||
|  |         if(0 == (cnt % 32)) | ||
|  |         { | ||
|  |             iot_cus_printf("\r\n"); | ||
|  |         } | ||
|  |         iot_cus_printf("%02x ", ((int)*(pch++))&0xFF); | ||
|  |     } | ||
|  | 
 | ||
|  |     return; | ||
|  | } | ||
|  | 
 | ||
|  | uint32_t app_demo_entry(void) | ||
|  | { | ||
|  |     uint32_t ret = ERR_FAIL; | ||
|  | 
 | ||
|  |     iot_print_config(0); | ||
|  | 
 | ||
|  | #if (IOT_DEMO_SUB_FUN == IOT_DEMO_SEL_FUNC_DISPL)
 | ||
|  |     extern uint32_t app_demo_module_init(void); | ||
|  |     iot_cus_printf("\r\nDEMO ENTRY FUNCTIONS-SHOW..."); | ||
|  |     ret = app_demo_module_init(); | ||
|  | #elif (IOT_DEMO_SUB_FUN == IOT_DEMO_SEL_SPEED_TEST)
 | ||
|  |     extern uint32_t app_demo_spd_module_init(void); | ||
|  |     iot_cus_printf("\r\nDEMO ENTRY SPEED TEST..."); | ||
|  |     ret = app_demo_spd_module_init(); | ||
|  | #elif (IOT_DEMO_SUB_FUN == IOT_DEMO_SEL_EPWM_TEST)
 | ||
|  |     extern int app_demo_epwm_init(void); | ||
|  |     iot_cus_printf("\r\nDEMO ENTRY EPWM TEST..."); | ||
|  |     ret = app_demo_epwm_init(); | ||
|  | #endif
 | ||
|  | 
 | ||
|  |     if(ERR_OK != ret) | ||
|  |     { | ||
|  |         ret = ERR_PENDING; | ||
|  |     } | ||
|  | 
 | ||
|  |     return ret; | ||
|  | } | ||
|  | 
 | ||
|  | #endif
 |