Files
kunlun/app/demo/demo.h
2024-09-28 14:24:04 +08:00

105 lines
2.7 KiB
C
Executable File

/****************************************************************************
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.
****************************************************************************/
#ifndef _INCLUDE_DEMO_MAIN_APP_H_
#define _INCLUDE_DEMO_MAIN_APP_H_
#ifdef __cplusplus
extern "C" {
#endif
/* DEMO SUB FUNCTIONS */
#define IOT_DEMO_SEL_FUNC_DISPL 0
#define IOT_DEMO_SEL_SPEED_TEST 1
#define IOT_DEMO_SEL_EPWM_TEST 2
/* SELECT THE SUB FUNCTION */
#define IOT_DEMO_SUB_FUN IOT_DEMO_SEL_FUNC_DISPL
/* FOR DEMO DEBUG-PRINT */
#define INCLUDE_IOT_DEMO_DEBUG 1
#if INCLUDE_IOT_DEMO_DEBUG
#define IOT_DEMO_DEBUG_INFO 0x01
#define IOT_DEMO_DEBUG_ERROR 0x02
extern int iot_demo_debug;
#define DEMO_DEBUG_LOG(FLG, X0, X1, X2, X3, X4, X5, X6) \
if (iot_demo_debug & FLG) \
iot_cus_printf((char *)X0, (int)X1, (int)X2, (int)X3, (int)X4, \
(int)X5, (int)X6);
#else /*IOT_DEMO_DEBUG*/
#define DEMO_DEBUG_LOG(DBG_SW, X0, X1, X2, X3, X4, X5, X6)
#endif /*IOT_DEMO_DEBUG*/
#define DEMO_INFO(x0,x1,x2,x3,x4,x5,x6) \
DEMO_DEBUG_LOG(IOT_DEMO_DEBUG_INFO, "\r\n>>DEMO INFOR : " x0 "<<\r\n", x1,\
x2,x3,x4,x5,x6)
#define DEMO_ERROR(x0,x1,x2,x3,x4,x5,x6) \
DEMO_DEBUG_LOG(IOT_DEMO_DEBUG_INFO, "\r\n##DEMO ERROR : " x0 "##\r\n", x1,\
x2,x3,x4,x5,x6)
#define DEMO_PLC_CMD_PRIO 3
#define DEMO_TASK_MSG_PRIO 0
#define DEMO_MSG_HANDLE_TASK_PRIO 8
#define DEMO_MSG_TASK_PRIO_QUE 1
#define DEMO_MSG_PENDING_LIMIT 64
#define DEMO_APP_LINK_ID 2
enum
{
E_DEMO_EV_START = 0,
E_DEMO_EV_TIMR,
E_DEMO_EV_END = 31
};
#define DEMO_EV_VALID(ev) \
((ev) <= E_DEMO_EV_END && (ev) >= E_DEMO_EV_START)
enum
{
E_DEMO_MSG_START = 0,
E_DEMO_MSG_FROM_MAC,
E_DEMO_MSG_TIMER,
E_DEMO_MSG_PROCESS,
E_DEMO_MSG_END
};
#define DEMO_MSG_VALID(msg) \
((msg) > E_DEMO_MSG_START && (msg) < E_DEMO_MSG_END)
void app_demo_main_bin_dmp(void * data, uint32_t len);
#ifdef __cplusplus
}
#endif
#endif