50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
#include "system/includes.h"
|
|
#include "app_config.h"
|
|
#include "app_main.h"
|
|
#include "app_task.h"
|
|
#include "user_cfg.h"
|
|
#include "vm.h"
|
|
#include "sys_time.h"
|
|
|
|
#include "jb_protocol.h"
|
|
#include "jb_product.h"
|
|
#include "jb_ringbuffer.h"
|
|
#include "jb_common.h"
|
|
#include "usr_le_product.h"
|
|
|
|
/* 向 usr_le_code 库提供产品身份(换产品只改 jb_protocol.h 宏即可) */
|
|
const uint8_t g_usr_le_prodcode[USR_LE_PRODCODE_LEN] = {
|
|
JB_CATEGORY_CODE[0], JB_CATEGORY_CODE[1],
|
|
JB_CATEGORY_CODE[2], JB_CATEGORY_CODE[3]
|
|
};
|
|
const uint8_t g_usr_le_pcode[USR_LE_PCODE_LEN] = {
|
|
JB_PRODUCT_CODE[0], JB_PRODUCT_CODE[1], JB_PRODUCT_CODE[2],
|
|
JB_PRODUCT_CODE[3], JB_PRODUCT_CODE[4], JB_PRODUCT_CODE[5]
|
|
};
|
|
|
|
void usr_timer_1_ms();
|
|
static int jb_timer_id=0;
|
|
|
|
void usr_jb_init()
|
|
{
|
|
jbInit();
|
|
userInit();
|
|
if(jb_timer_id==0)jb_timer_id = sys_s_hi_timer_add(NULL, usr_timer_1_ms, TIMER_PERIOD_MS);
|
|
}
|
|
|
|
void usr_timer_1_ms()
|
|
{
|
|
jbTimerIrq();
|
|
}
|
|
|
|
void usr_jb_le_recieve_data(u8* data,u16 len)
|
|
{
|
|
jbPutData(data,len);
|
|
}
|
|
|
|
void usr_timer_loop()///500ms
|
|
{
|
|
userHandle();
|
|
jbProtocolHandle(&gDevData);
|
|
}
|