13 changed files with 170 additions and 3063 deletions
@ -0,0 +1,5 @@ |
|||||
|
{ |
||||
|
"files.associations": { |
||||
|
"msp_uart1.h": "c" |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -1,121 +0,0 @@ |
|||||
/*****************************************************************************
|
|
||||
* uart.h: Header file for NXP LPC17xx Family Microprocessors |
|
||||
* |
|
||||
* Copyright (c) 2023 CCSENS |
|
||||
* All rights reserved. |
|
||||
* |
|
||||
* History |
|
||||
* 2009.05.27 ver 1.00 Prelimnary version, first Release |
|
||||
* |
|
||||
******************************************************************************/ |
|
||||
#ifndef _c_lib_H_ |
|
||||
#define _c_lib_H_ |
|
||||
|
|
||||
|
|
||||
#include <stdarg.h> |
|
||||
#include <stdlib.h> |
|
||||
#include "c_type51.h" |
|
||||
//
|
|
||||
#include "c_delay.h" |
|
||||
#include "c_crc.h" |
|
||||
//#include "../debug/debug_drv.h"
|
|
||||
//extern char guc_send[128];
|
|
||||
extern unsigned char code cguHex2Char[16][2]; |
|
||||
typedef struct |
|
||||
{ |
|
||||
vU16 up_point; |
|
||||
vU16 down_point; |
|
||||
|
|
||||
|
|
||||
}TS_up_down_p_; |
|
||||
|
|
||||
extern U8 Lc_Hex2Char(U8 CharStr); |
|
||||
extern U8 Lc_strStartsWith(U8 *s1,U8 *s2); |
|
||||
|
|
||||
//extern void Lc_int2str(U32 ui_in,UN_TYPE len,UN_TYPE point,char *d);
|
|
||||
// input: 123456d
|
|
||||
// output: '1' '2' '3'....
|
|
||||
//对应的点阵 为 0123456789. ,最后为空格,专为显示点阵类的数值使用
|
|
||||
//extern void Lc_int2number(U32 ui_in,UN_TYPE len,UN_TYPE point,char *d);
|
|
||||
//extern U32 L2_fun_number_show(int i,char str[4]);
|
|
||||
#if 10 |
|
||||
|
|
||||
void Lc_sint2str_2_1(int i_in,char *d); |
|
||||
void Lc_int2str_2(U32 ui_in,char *d); |
|
||||
void Lc_uc2str_2(U8 ui_in,char *d); |
|
||||
|
|
||||
extern void Lc_int2str_2_2(U32 ui_in,char *d); |
|
||||
extern void Lc_int2str_3(U32 ui_in,char *d); |
|
||||
|
|
||||
extern void Lc_int2str_3(U32 ui_in,char *d); |
|
||||
extern void Lc_int2str_4(U32 ui_in,char *d); |
|
||||
|
|
||||
extern void Lc_sint2str_3(int i_in,char *d); |
|
||||
#define Lc_WEI(WEIx,WEIn) (U8)((WEIx/ul2fun2[WEIn])%10); |
|
||||
#define Lc_eee(WEIn) ul2fun2[WEIn] |
|
||||
|
|
||||
|
|
||||
#endif |
|
||||
extern int Lc_strlen(const char *str); |
|
||||
extern void Lc_despiking_shift3_U16(vU16 *m); |
|
||||
extern int libc_strlen(char *str); |
|
||||
|
|
||||
extern char *Lc_int2a(vS32 value, char *string, UN_TYPE radix); |
|
||||
|
|
||||
extern void Lc_int2D(vS16 value, char *string,char bits); |
|
||||
extern int hexToDec(const char *source); |
|
||||
extern int getIndexOfSigns(char ch); |
|
||||
extern unsigned char hex_to_char(unsigned char hex); |
|
||||
|
|
||||
extern char *strstr(const char *str1, const char *str2); |
|
||||
extern unsigned char catch_protocol (const char d_src[],char d_protocol[]) ; |
|
||||
#define Lc_delay_1us() L0_delay_1us() |
|
||||
|
|
||||
extern U8* Lc_strcpy(U8* dst,const char* str); |
|
||||
|
|
||||
////////////////
|
|
||||
|
|
||||
extern void Lc_uc_hex(char ww); |
|
||||
extern void Lc_us_hex(U16 ww); |
|
||||
//extern void Lc_print(void (*L0pf_send_uc)(char ww), char *dat,...);
|
|
||||
extern void Lc_print(char *dat4,...); |
|
||||
extern void Lc_print_NC(char *dat,...); |
|
||||
extern void Lc_print_buf(char *dat4,...); |
|
||||
|
|
||||
extern u8 Lc_ocr8(const u8 *d,u8 len); |
|
||||
|
|
||||
extern void L3_us_big(U16 *d); |
|
||||
extern void L3_ui_big(vU32 *d); |
|
||||
extern void Lc_buf_copy_uc(U8 *d,const U8 *s,U16 num); |
|
||||
|
|
||||
extern void Lc_buf_copy_us(U16 *d,const U16 *s,U16 num); |
|
||||
|
|
||||
///void L2_line_algo_media(U8 *buf,vU16 len);
|
|
||||
extern vU8 Lc_U8_media3(vU8 a,vU8 b,vU8 c); |
|
||||
extern vS32 Lc_S32_media3(vS32 a,vS32 b,vS32 c); |
|
||||
extern vS32 Lc_S32_media(vS32 val[],S16 num); |
|
||||
extern void Lc_array_sort(S32 arr[],int n); |
|
||||
|
|
||||
/// 0x11 0x22 ---> 0x31 0x31 0x32 0x32 '1' '1' '2' '2'
|
|
||||
extern void Lc_hex2ascii(U8 *buf,U16 len,U8 *ascii); |
|
||||
extern int isBigEndianOrder(void); |
|
||||
extern U32 ntohl(U32 dat); |
|
||||
extern U32 htonl(U32 dat); |
|
||||
extern U16 ntohs(U16 dat); |
|
||||
extern U16 htons(U16 dat); |
|
||||
extern U32 Lc_abs(vS32 a,vS32 b); |
|
||||
extern void Lc_encrypt_id(U8 *enc_dst, U8 *enc_src, U32 enc_key, U8 src_len); |
|
||||
extern void Lc_encrypt_id1(U8 *enc_dst, U8 *enc_src, U8 enc_key[], U8 src_len); |
|
||||
extern int Lc_strlen(char *str); |
|
||||
extern U32 Lc_vU32_avg(U32 *d, U8 n); |
|
||||
extern U32 Lc_vS32_media(U32 *d, U8 n); |
|
||||
extern int Lc_memset(U8 *buf,U8 c,U16 len); |
|
||||
|
|
||||
extern void Lc_for_int8(U8 i); |
|
||||
extern void Lc_for_int16(U16 i); |
|
||||
|
|
||||
|
|
||||
#endif /* end _c_lib_H_ */ |
|
||||
/*****************************************************************************
|
|
||||
** End Of File |
|
||||
******************************************************************************/ |
|
@ -1,359 +0,0 @@ |
|||||
//////////////////////////////////////////////////////////////////////////
|
|
||||
/// COPYRIGHT NOTICE
|
|
||||
/// Copyright (c) 2020, 传控科技
|
|
||||
/// All rights reserved.
|
|
||||
///
|
|
||||
/// @file main.c
|
|
||||
/// @brief main app
|
|
||||
///
|
|
||||
///(本文件实现的功能的详述)
|
|
||||
///
|
|
||||
/// @version 1.1 CCsens technology
|
|
||||
/// @author CC
|
|
||||
/// @date 20150102
|
|
||||
///
|
|
||||
///
|
|
||||
/// 修订说明:最初版本
|
|
||||
/// Modified by: cc
|
|
||||
/// Modified date: 20200531
|
|
||||
/// Version:
|
|
||||
/// Descriptions: add u8
|
|
||||
//////////////////////////////////////////////////////////////////////////
|
|
||||
|
|
||||
|
|
||||
//#include <stdint.h>
|
|
||||
|
|
||||
#ifndef __TYPE51_H__ |
|
||||
#define __TYPE51_H__ |
|
||||
|
|
||||
/*********************************************************************************************************
|
|
||||
realView编译器需要添加的头文件 |
|
||||
*********************************************************************************************************/ |
|
||||
#include <ctype.h> |
|
||||
#include <stdlib.h> |
|
||||
#include <setjmp.h> |
|
||||
//#include <rt_misc.h>
|
|
||||
|
|
||||
typedef unsigned char U8; |
|
||||
|
|
||||
typedef volatile unsigned short U16; /* 无符号16位整型变量 */ |
|
||||
|
|
||||
typedef volatile signed long S32; |
|
||||
typedef volatile unsigned long U32; /* 无符号32位整型变量 */ |
|
||||
typedef unsigned int FLAG_P; // 标准类变量
|
|
||||
//typedef unsigned char INTU; // 标准类变量8BIT MCU
|
|
||||
typedef unsigned int INTU; // 标准类变量32BIT MCU
|
|
||||
|
|
||||
typedef U8 UN_TYPE; |
|
||||
typedef U8 vtype; |
|
||||
typedef U8 vType; |
|
||||
|
|
||||
/*********************************************************************************************************
|
|
||||
返回值定义 |
|
||||
*********************************************************************************************************/ |
|
||||
#define ZY_OK 0 /* 操作成功 */ |
|
||||
#define ZY_NOT_OK 1 /* 操作失败 */ |
|
||||
#define ZY_PARAMETER_ERR 2 /* 参数错误 */ |
|
||||
#define ZY_NO_FIND_FUNCTION 6 /* 没有发现指定函数 */ |
|
||||
#define ZY_NO_MEMORY 12 /* 内存不足 */ |
|
||||
#define ZY_TIME_OUT 13 /* 超时 */ |
|
||||
#define ZY_NO_FIND_OBJECT 16 /* 没有发现对象 */ |
|
||||
|
|
||||
|
|
||||
#define D_flag_lock 2 |
|
||||
#define D_flag_clear 0 |
|
||||
#define D_flag_CanUse 1 |
|
||||
|
|
||||
|
|
||||
typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus; |
|
||||
typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState; |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
#ifndef NULL |
|
||||
#define NULL ((void *)0) |
|
||||
#endif |
|
||||
|
|
||||
#ifndef FALSE |
|
||||
#define FALSE (0) |
|
||||
#endif |
|
||||
|
|
||||
#ifndef D_stop |
|
||||
#define D_stop (1) |
|
||||
#endif |
|
||||
|
|
||||
#ifndef D_run |
|
||||
#define D_run (0) |
|
||||
#endif |
|
||||
|
|
||||
#ifndef D_ready |
|
||||
#define D_ready (1) |
|
||||
#endif |
|
||||
|
|
||||
#ifndef D_ready2 |
|
||||
#define D_ready2 (2) |
|
||||
#endif |
|
||||
|
|
||||
|
|
||||
#ifndef D_max |
|
||||
#define D_max (3) |
|
||||
#endif |
|
||||
|
|
||||
|
|
||||
|
|
||||
#ifndef D_diff |
|
||||
#define D_diff (4) |
|
||||
#endif |
|
||||
|
|
||||
#ifndef D_set |
|
||||
#define D_set (1) |
|
||||
#endif |
|
||||
|
|
||||
|
|
||||
|
|
||||
#ifndef D_clear |
|
||||
#define D_clear (0) |
|
||||
#endif |
|
||||
#define D_ON 1 |
|
||||
#define D_OFF 0 |
|
||||
|
|
||||
#define D_sleep_wakeup 3 |
|
||||
#define D_sleep 1 |
|
||||
#define D_wakeup 0 |
|
||||
|
|
||||
#ifndef TRUE |
|
||||
#define TRUE (1) |
|
||||
#endif |
|
||||
|
|
||||
/*********************************************************************************************************
|
|
||||
定义与编译器无关的数据类型 |
|
||||
*********************************************************************************************************/ |
|
||||
|
|
||||
typedef U8 u8; |
|
||||
typedef volatile U8 vU8; |
|
||||
|
|
||||
typedef U8 uint8_t; |
|
||||
typedef U8 uint8; |
|
||||
typedef char int8_t; |
|
||||
|
|
||||
|
|
||||
typedef U8 BOOLEAN; /* 布尔变量 */ |
|
||||
typedef U8 *PU8; |
|
||||
typedef U8 BYTE; |
|
||||
typedef signed char S8; |
|
||||
typedef volatile signed char vS8; |
|
||||
typedef signed char *PS8; |
|
||||
|
|
||||
|
|
||||
typedef S8 s8; |
|
||||
|
|
||||
|
|
||||
#define bit char |
|
||||
//#define code
|
|
||||
|
|
||||
typedef U16 u16; |
|
||||
typedef volatile U16 vU16; /* 无符号16位整型变量 */ |
|
||||
typedef volatile signed short S16; |
|
||||
typedef volatile signed short s16; |
|
||||
typedef volatile S16 vS16; /* 有符号16位整型变量 */ |
|
||||
|
|
||||
|
|
||||
|
|
||||
typedef volatile U16 uint16_t; |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
typedef volatile S32 vS32; |
|
||||
|
|
||||
typedef U32 INT32U; // 无符号32位整型变量
|
|
||||
|
|
||||
typedef S32 INT32S; // 有符号32位整型变量
|
|
||||
|
|
||||
|
|
||||
|
|
||||
typedef volatile U32 vU32; /* 有符号32位整型变量 */ |
|
||||
|
|
||||
typedef float FP32; /* 单精度浮点数(32位长度) */ |
|
||||
typedef double FP64; /* 双精度浮点数(64位长度) */ |
|
||||
|
|
||||
|
|
||||
typedef U32 uint32_t; |
|
||||
|
|
||||
typedef U32 uint32; |
|
||||
|
|
||||
|
|
||||
|
|
||||
//typedef unsigned char BOOLEAN; // 布尔变量
|
|
||||
typedef unsigned char INT8U; // 无符号8位整型变量
|
|
||||
typedef signed char INT8S; // 有符号8位整型变量
|
|
||||
typedef unsigned short INT16U; // 无符号16位整型变量
|
|
||||
typedef signed short INT16S; // 有符号16位整型变量
|
|
||||
//typedef float FP32; // 单精度浮点数(32位长度)
|
|
||||
//typedef double FP64; // 双精度浮点数(64位长度)
|
|
||||
|
|
||||
|
|
||||
|
|
||||
///>>>>>>cpu类型特有>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>大端小端
|
|
||||
|
|
||||
|
|
||||
typedef union |
|
||||
{ |
|
||||
vU32 ui; |
|
||||
vU16 s[2]; |
|
||||
vU8 d[4]; |
|
||||
}tu_ui4uc; |
|
||||
|
|
||||
typedef union |
|
||||
{ |
|
||||
vU16 word; |
|
||||
struct |
|
||||
{ |
|
||||
vU8 h; |
|
||||
vU8 l; |
|
||||
}BYTE2; |
|
||||
}U_U16; |
|
||||
|
|
||||
typedef union |
|
||||
{ |
|
||||
vU32 dWord; |
|
||||
///High 0123 Low
|
|
||||
struct |
|
||||
{ |
|
||||
vU8 byte0; |
|
||||
vU8 byte1; |
|
||||
vU8 byte2; |
|
||||
vU8 byte3; |
|
||||
}BYTE4; |
|
||||
|
|
||||
vU16 us[2]; |
|
||||
}U_U32; |
|
||||
typedef union |
|
||||
{ |
|
||||
vU16 us; |
|
||||
vU8 uc[2]; |
|
||||
struct |
|
||||
{ |
|
||||
vU8 H; |
|
||||
vU8 L; |
|
||||
}BYTE2; |
|
||||
}U_F16; |
|
||||
/**********
|
|
||||
k.us = 0x1234 |
|
||||
uc |
|
||||
[0]=0x12 |
|
||||
[1]=0x34 |
|
||||
byte2 |
|
||||
H=0x12 |
|
||||
L=0x34 |
|
||||
|
|
||||
**********/ |
|
||||
|
|
||||
|
|
||||
|
|
||||
typedef union |
|
||||
{ |
|
||||
float fl; |
|
||||
vU8 uc[4]; |
|
||||
|
|
||||
}U_F32; |
|
||||
|
|
||||
|
|
||||
///<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<大端小端
|
|
||||
|
|
||||
|
|
||||
typedef struct |
|
||||
{ |
|
||||
u16 get; //想要达到的值
|
|
||||
u16 max; //最大值
|
|
||||
u16 min; //最小值
|
|
||||
/// u16 diff; //get和最值max,min的差值 在有些输入的时候有用 不想
|
|
||||
}TS_u16get_;//电磁阀动作
|
|
||||
|
|
||||
|
|
||||
typedef struct |
|
||||
{ |
|
||||
vU8 *buffer; |
|
||||
vU8 wpt; |
|
||||
vU8 rpt; |
|
||||
vU8 cnt; |
|
||||
}byte_len_fifo_struct; |
|
||||
|
|
||||
typedef struct |
|
||||
{ |
|
||||
vU16 *buffer; |
|
||||
vU16 wpt; |
|
||||
vU16 rpt; |
|
||||
vU16 cnt; |
|
||||
}word_len_fifo_struct; |
|
||||
|
|
||||
typedef struct |
|
||||
{ |
|
||||
vU16 x; |
|
||||
vU16 y; |
|
||||
}point_struct; |
|
||||
|
|
||||
|
|
||||
typedef struct |
|
||||
{ |
|
||||
vU16 x; |
|
||||
vU16 y; |
|
||||
vU16 width; |
|
||||
vU16 height; |
|
||||
}rect_struct; |
|
||||
|
|
||||
|
|
||||
#define HIGHT 1 |
|
||||
#define LOW 0 |
|
||||
#if 0 |
|
||||
#ifndef MIN |
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b)) |
|
||||
#endif |
|
||||
|
|
||||
#ifndef MAX |
|
||||
#define MAX(a, b) (((a) > (b)) ? (a) : (b)) |
|
||||
#endif |
|
||||
#endif |
|
||||
#ifndef ABS |
|
||||
#define ABS(a, b) (((a) > (b)) ? ((a) - (b)) : ((b) - (a))) |
|
||||
#endif |
|
||||
|
|
||||
|
|
||||
#define F_FINSIH 1 |
|
||||
#define F_WORKING 0 |
|
||||
#define F_WAITINGKEY 2 |
|
||||
|
|
||||
|
|
||||
#define DF_var_up(v,step,max,init) (v) += (step);if((v) > (max)) (v) = (init); |
|
||||
//if step > 1 bug warning!!
|
|
||||
#define DF_var_down(v,step,min,init) \ |
|
||||
if((v) < ((min) + (step))) \ |
|
||||
{ \ |
|
||||
(v) = (init); \ |
|
||||
}else \ |
|
||||
{ \ |
|
||||
(v) -= (step); \ |
|
||||
} |
|
||||
|
|
||||
#define D_us2uc_H(x) (U8)(0x00ff&((x)>>8)) |
|
||||
#define D_us2uc_L(x) (U8)(0x00ff&(x)) |
|
||||
|
|
||||
|
|
||||
#define D_ul2uc_0(xx) (U8)(0x000000ff&(xx)) |
|
||||
#define D_uc_high(ww) ((ww)>>4) |
|
||||
#define D_uc_low(ww) ((ww)&0x0f) |
|
||||
|
|
||||
#define D_2uc_u16(H,L) (((u16)H)<<8 | (u16)L) |
|
||||
|
|
||||
#define L0_type_byte(x) ((U8 *) &(x)) |
|
||||
|
|
||||
|
|
||||
//#define _nop_ __NOP
|
|
||||
// #define _nop_
|
|
||||
|
|
||||
|
|
||||
extern void L3_us_big(U16 *d); |
|
||||
extern void L3_ui_big(vU32 *d); |
|
||||
#endif /* __TYPE_H__ */ |
|
@ -1,203 +0,0 @@ |
|||||
/*****************************************************************************
|
|
||||
* DEBUG_DRV.h: Header file for DEBUY DRIVER FILES |
|
||||
* |
|
||||
* |
|
||||
* Copyright(C) 2013, cc |
|
||||
* All rights reserved. |
|
||||
* |
|
||||
* History |
|
||||
* 2013.05.24 ver 1.00 Prelimnary version, first Release |
|
||||
* 2020.02.22 ver 2.00 step 1 led鐐圭伅 |
|
||||
step 2.1 uart debug send |
|
||||
step 2.2 uart debug rev with led |
|
||||
step 2.3 debug protocol test |
|
||||
step 3 |
|
||||
step 4 timer test --> get tick |
|
||||
step 5 TTSS task test |
|
||||
step 6 |
|
||||
|
|
||||
|
|
||||
******************************************************************************/ |
|
||||
|
|
||||
|
|
||||
#ifndef __DEBUG_DRV_H |
|
||||
#define __DEBUG_DRV_H |
|
||||
|
|
||||
#include "c_type51.h" |
|
||||
#include "c_lib.h" |
|
||||
#include "msp_uartN.h" |
|
||||
|
|
||||
#include "msp_uart1.h" |
|
||||
//#include "msp_uart2.h"///
|
|
||||
///#include "msp_uart3.h"
|
|
||||
///#include "msp_uart4.h"///
|
|
||||
|
|
||||
#include "stdio.h" |
|
||||
//#include "msp_uart4.h"
|
|
||||
#include "tpc_x.h" |
|
||||
//#include "tpc_debug.h"
|
|
||||
|
|
||||
extern TS_P_debug *pd; |
|
||||
|
|
||||
|
|
||||
#define D_cmd_filter_debug 0xfd |
|
||||
#define D_cmd_filter_gc032A 0xfc |
|
||||
|
|
||||
#define D_cmd_filter_weight 0xFE |
|
||||
|
|
||||
|
|
||||
#define D_cmd_filter_iicx 0xf1 |
|
||||
|
|
||||
|
|
||||
///鏍规嵁瀹為檯鐢佃矾杩涜�璋冩暣
|
|
||||
#if 0 |
|
||||
#define L1_uartD_senduc(x) L1_uart4_senduc((x) |
|
||||
#define L1_uartD_sendArray(x,len) L1_uart4_sendArray((x),(len)) |
|
||||
#define L1_uartD_sendStr(x) L1_uart4_sendStr((x)) |
|
||||
#define L1_uartD_waitFree() L1_uart4_waitFree() |
|
||||
#define D_ts_uartX_rev (&TP_Uart_RE_) |
|
||||
|
|
||||
#define Uart_Send_Msg(X); L1_uartD_sendStr(X); |
|
||||
|
|
||||
#else |
|
||||
#define L1_uartD_0d0a() L0_uartN_0d0a(D_UART1) |
|
||||
#define L1_uartD_uc(x) L0_uartN_uc(D_UART1,(x)) |
|
||||
#define L1_uartD_us(x) L0_uartN_us(D_UART1,(x)) |
|
||||
#define L1_uartD_uchex(x) L0_uartN_uchex(D_UART1,(x)) |
|
||||
#define L1_uartD_ushex(x) L0_uartN_ushex(D_UART1,(x)) |
|
||||
#define L1_uartD_ulhex(x) L0_uartN_ulhex(D_UART1,(x)) |
|
||||
#define L1_uartD_Array(x,len) L0_uartN_Array(D_UART1,(x),(len)) |
|
||||
#define L1_uartD_ArrayLong(x,start,end) L0_uartN_Arraylong(D_UART1,x,start,end) |
|
||||
////#define L1_uartD_Arrayhex(x,len) L0_uartN_uchexArray(D_UART1,(x),(len))
|
|
||||
|
|
||||
|
|
||||
#define L1_uartD_Arrayhex(x,len) L0_uartN_Arrayhex_withoutbuf(D_UART1,(x),(len)) |
|
||||
////#define L1_uartD_ushexArray(x,len) L0_uartN_ushexArray(D_UART1,(x),(len))
|
|
||||
|
|
||||
|
|
||||
#define L1_uartD_Str(x) L0_uartN_str(D_UART1,(x)) |
|
||||
#define L1_uartD_waitFree() L0_waitFree_uartN(D_UART1) |
|
||||
#define D_ts_uartX_rev (&ts_s2b1_road) |
|
||||
|
|
||||
#define Uart__Msg(X); L1_uartD_Str(X); |
|
||||
#define uartSendByte(X) L0_uartN_ushex(D_UART1,(X)) |
|
||||
#define Uart__Hex(x,u) L0_uartN_ushex(D_UART1,(x)) |
|
||||
|
|
||||
|
|
||||
#endif |
|
||||
|
|
||||
///#define xxxlog(format, ...) printf("[%s:%d->%s] ",format, __FILE__, __LINE__, __func__, ##__VA_ARGS__)
|
|
||||
|
|
||||
//////#define printfs_debug
|
|
||||
|
|
||||
#ifdef printfs_debug |
|
||||
#define printfs(str) |
|
||||
#define printf1(str,i1) |
|
||||
#define printf2(str,i1,i2) |
|
||||
#define printf3(str,i1,i2,i3) |
|
||||
#define printf4(str,i1,i2,i3,i4) |
|
||||
#else |
|
||||
|
|
||||
#define printfs(str) L1_uartD_waitFree() ;printf(str) |
|
||||
#define printf1(str,i1) L1_uartD_waitFree() ;printf(str,i1) |
|
||||
#define printf2(str,i1,i2) L1_uartD_waitFree() ;printf(str,i1,i2) |
|
||||
#define printf3(str,i1,i2,i3) L1_uartD_waitFree() ;printf(str,i1,i2,i3) |
|
||||
#define printf4(str,i1,i2,i3,i4) L1_uartD_waitFree() ;printf(str,i1,i2,i3,i4) |
|
||||
#define printf5(str,i1,i2,i3,i4,i5) L1_uartD_waitFree() ;printf(str,i1,i2,i3,i4,i5) |
|
||||
|
|
||||
/*
|
|
||||
|
|
||||
#define printfs(str) L1_uartD_Str(str);///L1_uartD_waitFree() ;printf(str)
|
|
||||
#define printf1(str,i1) L1_uartD_Str(str);L1_uartD_ushex(i1);///L1_uartD_waitFree() ;printf(str,i1)
|
|
||||
#define printf2(str,i1,i2) printf1(str,i1);L1_uartD_ushex(i2);///L1_uartD_waitFree() ;printf(str,i1,i2)
|
|
||||
#define printf3(str,i1,i2,i3) printf2(str,i1,i2);L1_uartD_ushex(i3);///L1_uartD_Str(str);L1_uartD_ushex(i1);///L1_uartD_waitFree() ;printf(str,i1,i2,i3)
|
|
||||
#define printf4(str,i1,i2,i3,i4) printf3(str,i1,i2,i3);L1_uartD_ushex(i4);///L1_uartD_Str(str);L1_uartD_ushex(i1);///L1_uartD_waitFree() ;printf(str,i1,i2,i3,i4)
|
|
||||
#define printf5(str,i1,i2,i3,i4,i5) printf4(str,i1,i2,i3,i4);L1_uartD_ushex(i5);///L1_uartD_Str(str);L0_uartN_ushex(i1);/// L1_uartD_waitFree() ;printf(str,i1,i2,i3,i4,i5)
|
|
||||
*/ |
|
||||
|
|
||||
|
|
||||
#endif |
|
||||
///L0_waitFree_uartN
|
|
||||
|
|
||||
extern void L3_debug_drv_init(void); |
|
||||
extern void L3_test_ONdebug(u8 filter); |
|
||||
extern vtype L2_debug_ONcomand(void); |
|
||||
|
|
||||
|
|
||||
extern void L3_iicx_debug(u8 filter); |
|
||||
|
|
||||
#if 0 |
|
||||
if(1 == ts_uart4_rev.revok) |
|
||||
{ts_uart4_rev.revok= 0; |
|
||||
td = (TS_P_debug *)ts_uart4_rev.buf; |
|
||||
L1_uart4_sendArray(ts_uart4_rev.buf, 5); |
|
||||
if(D_sb_filter == td->filter) |
|
||||
{ |
|
||||
if(0x04 == td->R1)///璁剧疆鍥涗釜浼犳劅鍣ㄧ殑娓呴浂
|
|
||||
{ //// fd 04 33 44 55
|
|
||||
|
|
||||
void L3_debug_drv_init(void); |
|
||||
#define L3_debug_time() L0pf_send_uc = L0_uart0_uc; ///Lc_print("\r\n%s,-%sL:%d,",__DATE__,__TIME__,__LINE__);
|
|
||||
extern void L3_debug_cycle(void); |
|
||||
|
|
||||
|
|
||||
#define UART_debug_reg ((LPC_UART1_TypeDef *) LPC_UART1_BASE ) |
|
||||
//#define UART_debug ((LPC_UART1_TypeDef *) LPC_UART1_BASE )
|
|
||||
//#define UART_debug ((LPC_UART_TypeDef *) LPC_UART_BASE )
|
|
||||
//#define UART_debug ((LPC_UART_TypeDef *) LPC_UART_BASE )
|
|
||||
#define UART_debug 1 |
|
||||
|
|
||||
#define L0_debugS_uc(x) //L0_Usend_uc(UART_debug,x)
|
|
||||
#define L0_debugS_uc_hex(x) //L0_Usend_uc_hex(UART_debug,x)
|
|
||||
#define L0_debug_uc_show(x,y); //L0_USART_print(UART_debug,x,y);
|
|
||||
#define L0_debug_us_show(x,y); //L0_USART_print(UART_debug,x,y);
|
|
||||
#define L0_debug_ul_show(x,y); //L0_USART_print(UART_debug,x,y);
|
|
||||
|
|
||||
|
|
||||
//#define L2_debug_info(x) //L0_USART_print(UART_debug,x);
|
|
||||
#define L2_debug_Au4B(x) // L0_Usend_Au4B(UART_debug,x)
|
|
||||
#define L0_debug_Au4B_show(x,y); //L0_USART_print(UART_debug,x,y);
|
|
||||
#define L0_debug_Aus_show(x,y); //L0_USART_print(UART_debug,x,y);
|
|
||||
#define L0_debug_A4B_show(x,y); //L0_USART_print(UART_debug,x,y);
|
|
||||
|
|
||||
|
|
||||
//#define debug22(format...) Lc_print("%s (%d): ",__FILE__,__LINE__);
|
|
||||
|
|
||||
//#define LOG(format, args...) Lc_print(format, ##args)
|
|
||||
//#define RTA_printf(...) Lc_print(__VA_ARGS__)
|
|
||||
|
|
||||
//#define L2_debug_info Lc_print
|
|
||||
|
|
||||
//#define L3_debug_time() Lc_print(L0_uart0_uc,"\r\n%s,-%sL:%d,",__DATE__,__TIME__,__LINE__);
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
#define L2_debug_info(...) \ |
|
||||
Lc_print(L0_uart_uc,__VA_ARGS__); |
|
||||
|
|
||||
//do {
|
|
||||
//Lc_print("%s (%d): ", __FILE__, __LINE__);
|
|
||||
//Lc_print(format, __VA_ARGS__);
|
|
||||
//} while (0)
|
|
||||
|
|
||||
|
|
||||
#define CHECK1(x, ...) if (!(x)) { printf(__VA_ARGS__); } |
|
||||
|
|
||||
#define LOG(...) {\ |
|
||||
Lc_print(L0_uart_uc,"%s: Line %d:\t", __FILE__, __LINE__);\ |
|
||||
Lc_print(L0_uart_uc, __VA_ARGS__);\ |
|
||||
Lc_print(L0_uart_uc,"\n");\ |
|
||||
} |
|
||||
|
|
||||
int main() { |
|
||||
int x = 3; |
|
||||
// 一些代码...
|
|
||||
LOG("x = %d", x); // 2-1-5.cpp: Line 12: x = 3
|
|
||||
} |
|
||||
#endif |
|
||||
#endif /* end __DEBUG_DRV_H */ |
|
||||
|
|
||||
/*****************************************************************************
|
|
||||
** End Of File |
|
||||
******************************************************************************/ |
|
@ -1,378 +0,0 @@ |
|||||
/*****************************************************************************
|
|
||||
* debug_drv.c: debug app |
|
||||
* |
|
||||
* Copyright(C) 2013, cc |
|
||||
* All rights reserved. |
|
||||
* |
|
||||
* History |
|
||||
* 2013.05.24 ver 1.00 Prelimnary version, first Release |
|
||||
* |
|
||||
|
|
||||
|
|
||||
if(ts_s2b_debug.idle) |
|
||||
{ |
|
||||
ts_s2b_debug.idle = 0; |
|
||||
printf("\r\n O"); |
|
||||
if(ts_s2b_debug.len > 0) |
|
||||
{ |
|
||||
//// L1_uartD_sendArrayhex((U8 *)&ts_s2b_debug.t, 5);
|
|
||||
/// xxxx///謠仙叙蜊剰ョョ
|
|
||||
/// if(debgu) ts_s2b_debug.ok =1;
|
|
||||
|
|
||||
printf("\r\n len = %d",(int)ts_s2b_debug.len); |
|
||||
ts_s2b_debug.len = 0; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
******************************************************************************/ |
|
||||
|
|
||||
#include "debug_drv.h" |
|
||||
///#include "msp_iicM1.h"
|
|
||||
#include "c_type51.h" |
|
||||
///#include "msp_uart2.h"
|
|
||||
|
|
||||
#include "tpc_road.h" |
|
||||
TS_P_debug *pd=NULL; |
|
||||
|
|
||||
////蜷ッ蜉ィ騾丈シ�謖�サ、 蠑蜈ウ謇灘シ 蜿ッ莉・讓。諡溷ス灘燕荳イ蜿」蜿鷹�
|
|
||||
vtype L2_debug_comand(void) |
|
||||
{ |
|
||||
u8 cmd=0,num=0; |
|
||||
if(1 == ts_Urec[D_UART1].debugok) |
|
||||
{ ts_Urec[D_UART1].debugok = 0;////隗」譫仙刻隶ョ
|
|
||||
/// printf("\r\nw ts_Urec[D_UART1].max = %d num = %d",(int)ts_Urec[D_UART1].rmax,(int)ts_Urec[D_UART1].num);
|
|
||||
printf("\r\ndebugok",(int)(int)ts_Urec[D_UART1].debugok); |
|
||||
|
|
||||
} |
|
||||
if(1 == ts_Urec[D_UART1].ok) |
|
||||
{ ts_Urec[D_UART1].ok = 0;////隗」譫仙刻隶ョ
|
|
||||
L1_uartD_sendArrayhex(ts_Urecbuf.r1, ts_Urec[D_UART1].num);L1_uartD_0d0a(); |
|
||||
///---------荳イ蜿」1逧�刻隶ョ蛻�ク、邀サ 1邀サ譏ッ Fx蠑螟エ逧�宙蟇ケ螟冶ョセx逧���㊥debug蜊剰ョョ�帑セ句ヲ�D蠑螟エ譏ッ邉サ扈歸ebug Fc譏ッiic隹�ッ戊ョセ螟�
|
|
||||
////荳邀サ譏ッDx蠑螟エ逧�ッケ荳イ蜿」x騾丈シ�蜊剰ョョ ////D2縲ゅゅゅ� 騾丈シ�扈吩クイ蜿」2逧�焚謐ョ
|
|
||||
cmd = D_uc_high(ts_Urecbuf.r1[0]); |
|
||||
num = D_uc_low(ts_Urecbuf.r1[0]); |
|
||||
printf(" 0->%X %X ",(int)cmd,(int)num ); |
|
||||
if(cmd == 0x0D) |
|
||||
{////D2縲ゅゅゅ� 騾丈シ�扈吩クイ蜿」2逧�焚謐ョ
|
|
||||
L1_uartD_sendArrayhex(&ts_Urecbuf.r1[1], ts_Urec[D_UART1].num-1); |
|
||||
|
|
||||
if(2 == num) |
|
||||
{ printf(" 2-> "); |
|
||||
L1_uart2_sendArray(&ts_Urecbuf.r1[1], ts_Urec[D_UART1].num-1); |
|
||||
}else if(3 == num) |
|
||||
{ printf(" 3-> "); |
|
||||
L1_uart3_sendArray(&ts_Urecbuf.r1[1], ts_Urec[D_UART1].num-1); |
|
||||
|
|
||||
}else if(4 == num) |
|
||||
{ printf(" 4-> "); |
|
||||
L1_uart4_sendArray(&ts_Urecbuf.r1[1], ts_Urec[D_UART1].num-1); |
|
||||
|
|
||||
}else |
|
||||
{ |
|
||||
} |
|
||||
return 1; |
|
||||
|
|
||||
} |
|
||||
////debug蜊剰ョョ菴ソ逕ィ荳イ蜿」1 謨�悟�谺。邂蜊戊ァ」譫� 隕∵アらャャ荳荳ェ蟄礼ャヲ蠢�。サ荳コFx
|
|
||||
if(0x0F == cmd) |
|
||||
{ |
|
||||
///TS_P_debug
|
|
||||
pd = (TS_P_debug*)ts_Urecbuf.r1; |
|
||||
L1_uartD_sendArrayhex((U8 *)pd, 5);////(U8 *)&pd,髞呵ッッ逧�。ィ霎セ譁ケ蠑� pd蟆ア譏ッ蝨ー蝮
|
|
||||
return 1; |
|
||||
} |
|
||||
printf("\r\n ok "); |
|
||||
} |
|
||||
|
|
||||
if(1 == ts_Urec[D_UART2].ok) |
|
||||
{ ts_Urec[D_UART2].ok = 0;////謾カ蛻ー荳蟶ァ謨ー謐ョ
|
|
||||
|
|
||||
//pd = (TS_P_debug*)ts_Urecbuf.r2;////
|
|
||||
//L1_uartD_sendArrayhex((char *)pd, ts_Urec[D_UART2].num);
|
|
||||
L1_uartD_sendArrayhex(ts_Urecbuf.r2, ts_Urec[D_UART2].num); |
|
||||
} |
|
||||
if(1 == ts_Urec[D_UART3].ok) |
|
||||
{ ts_Urec[D_UART3].ok = 0;////隗」譫仙刻隶ョ
|
|
||||
|
|
||||
//pd = (TS_P_debug*)ts_Urecbuf.r2;////
|
|
||||
//L1_uartD_sendArrayhex((char *)pd, ts_Urec[D_UART2].num);
|
|
||||
L1_uartD_sendArrayhex(ts_Urecbuf.r3, ts_Urec[D_UART3].num); |
|
||||
} |
|
||||
if(1 == ts_Urec[D_UART4].ok) |
|
||||
{ ts_Urec[D_UART4].ok = 0;////隗」譫仙刻隶ョ
|
|
||||
|
|
||||
//pd = (TS_P_debug*)ts_Urecbuf.r2;////
|
|
||||
//L1_uartD_sendArrayhex((char *)pd, ts_Urec[D_UART2].num);
|
|
||||
L1_uartD_sendArrayhex(ts_Urecbuf.r4, ts_Urec[D_UART4].num); |
|
||||
} |
|
||||
|
|
||||
return 0; |
|
||||
} |
|
||||
////蜷ッ蜉ィ騾丈シ�謖�サ、 蠑蜈ウ謇灘シ 蜿ッ莉・讓。諡溷ス灘燕荳イ蜿」蜿鷹�
|
|
||||
vtype L2_debug_comand333(void) |
|
||||
{ |
|
||||
if(1 == ts_Urec[D_UART1].debugok) |
|
||||
{ ts_Urec[D_UART1].debugok = 0;////隗」譫仙刻隶ョ
|
|
||||
/// printf("\r\nw ts_Urec[D_UART1].max = %d num = %d",(int)ts_Urec[D_UART1].rmax,(int)ts_Urec[D_UART1].num);
|
|
||||
printf("\r\ndebugok",(int)(int)ts_Urec[D_UART1].debugok); |
|
||||
|
|
||||
} |
|
||||
if(1 == ts_Urec[D_UART1].ok) |
|
||||
{ ts_Urec[D_UART1].ok = 0;////隗」譫仙刻隶ョ
|
|
||||
L1_uartD_sendArrayhex(ts_Urecbuf.r1, ts_Urec[D_UART1].num);L1_uartD_0d0a(); |
|
||||
///---------荳イ蜿」1逧�刻隶ョ蛻�ク、邀サ 1邀サ譏ッ Fx蠑螟エ逧�宙蟇ケ螟冶ョセx逧���㊥debug蜊剰ョョ�帑セ句ヲ�D蠑螟エ譏ッ邉サ扈歸ebug Fc譏ッiic隹�ッ戊ョセ螟�
|
|
||||
////荳邀サ譏ッDx蠑螟エ逧�ッケ荳イ蜿」x騾丈シ�蜊剰ョョ ////D2縲ゅゅゅ� 騾丈シ�扈吩クイ蜿」2逧�焚謐ョ
|
|
||||
if((ts_Urecbuf.r1[0]&0xF0) == 0xD0) |
|
||||
{////D2縲ゅゅゅ� 騾丈シ�扈吩クイ蜿」2逧�焚謐ョ
|
|
||||
printf("\r\n Dn=%x :",(int)(ts_Urecbuf.r1[0]&0x0F)); |
|
||||
L1_uartD_sendArrayhex(&ts_Urecbuf.r1[1], ts_Urec[D_UART1].num-1); |
|
||||
|
|
||||
if(ts_Urecbuf.r1[0]&0x0f == 0x02) |
|
||||
{ printf(" 2-> "); |
|
||||
L1_uart2_sendArray(&ts_Urecbuf.r1[1], ts_Urec[D_UART1].num-1); |
|
||||
}else if(ts_Urecbuf.r1[0]&0x0f == 0x03) |
|
||||
{ printf(" 3-> "); |
|
||||
L1_uart3_sendArray(&ts_Urecbuf.r1[1], ts_Urec[D_UART1].num-1); |
|
||||
|
|
||||
}else if(ts_Urecbuf.r1[0]&0x0f == 0x04) |
|
||||
{ printf(" 4-> "); |
|
||||
L1_uart4_sendArray(&ts_Urecbuf.r1[1], ts_Urec[D_UART1].num-1); |
|
||||
|
|
||||
}else |
|
||||
{printf(" 4->%x %x ",(int)(ts_Urecbuf.r1[0]&0xF0), (int)(ts_Urecbuf.r1[0]&0x0f) ); |
|
||||
} |
|
||||
return 1; |
|
||||
|
|
||||
} |
|
||||
////debug蜊剰ョョ菴ソ逕ィ荳イ蜿」1 謨�悟�谺。邂蜊戊ァ」譫� 隕∵アらャャ荳荳ェ蟄礼ャヲ蠢�。サ荳コFx
|
|
||||
if(ts_Urecbuf.r1[0]&0xf0 == 0xf0) |
|
||||
{ |
|
||||
///TS_P_debug
|
|
||||
pd = (TS_P_debug*)ts_Urecbuf.r1; |
|
||||
L1_uartD_sendArrayhex((U8 *)pd, 5);////(U8 *)&pd,髞呵ッッ逧�。ィ霎セ譁ケ蠑� pd蟆ア譏ッ蝨ー蝮
|
|
||||
return 1; |
|
||||
} |
|
||||
printf("\r\n ok "); |
|
||||
} |
|
||||
|
|
||||
if(1 == ts_Urec[D_UART2].ok) |
|
||||
{ ts_Urec[D_UART2].ok = 0;////謾カ蛻ー荳蟶ァ謨ー謐ョ
|
|
||||
|
|
||||
//pd = (TS_P_debug*)ts_Urecbuf.r2;////
|
|
||||
//L1_uartD_sendArrayhex((char *)pd, ts_Urec[D_UART2].num);
|
|
||||
L1_uartD_sendArrayhex(ts_Urecbuf.r2, ts_Urec[D_UART2].num); |
|
||||
} |
|
||||
if(1 == ts_Urec[D_UART3].ok) |
|
||||
{ ts_Urec[D_UART3].ok = 0;////隗」譫仙刻隶ョ
|
|
||||
|
|
||||
//pd = (TS_P_debug*)ts_Urecbuf.r2;////
|
|
||||
//L1_uartD_sendArrayhex((char *)pd, ts_Urec[D_UART2].num);
|
|
||||
L1_uartD_sendArrayhex(ts_Urecbuf.r3, ts_Urec[D_UART3].num); |
|
||||
} |
|
||||
if(1 == ts_Urec[D_UART4].ok) |
|
||||
{ ts_Urec[D_UART4].ok = 0;////隗」譫仙刻隶ョ
|
|
||||
|
|
||||
//pd = (TS_P_debug*)ts_Urecbuf.r2;////
|
|
||||
//L1_uartD_sendArrayhex((char *)pd, ts_Urec[D_UART2].num);
|
|
||||
L1_uartD_sendArrayhex(ts_Urecbuf.r4, ts_Urec[D_UART4].num); |
|
||||
} |
|
||||
|
|
||||
return 0; |
|
||||
} |
|
||||
|
|
||||
void L3_test_debug(u8 filter) |
|
||||
{ |
|
||||
if(filter == pd->filter) |
|
||||
{///filter num d1 d2 d3 ....dn
|
|
||||
//// FD 08 11 22 33 44 55 66 77 88
|
|
||||
printf("\r\n FD ok"); |
|
||||
|
|
||||
switch (pd->ocr) |
|
||||
{ |
|
||||
case 0x11: |
|
||||
|
|
||||
printf("11"); |
|
||||
//// D_lora_wakeup(); L0_uart2_sendArray(test, 13);
|
|
||||
printf(" lora send "); |
|
||||
/// L1_uartD_sendArrayhex(test, 13);
|
|
||||
//1/ 2 3 4 5 6 7 8 9 10 11 12 13
|
|
||||
break; |
|
||||
case 0x12: |
|
||||
printf("12"); |
|
||||
/// D_lora_wakeup(); L0_uart2_sendArray(test2, 7);
|
|
||||
printf(" lora send2 "); |
|
||||
/// L1_uartD_sendArrayhex(test2, 7);
|
|
||||
//1 2 3 4 5 6 7 8 9 10 11 12 13
|
|
||||
break; |
|
||||
default: |
|
||||
printf(" pp error\r\n "); |
|
||||
|
|
||||
break; |
|
||||
}; |
|
||||
|
|
||||
printf("333"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
///#define D_keil_sim
|
|
||||
#ifdef D_keil_sim |
|
||||
void UartInit(void) //9600bps@11.0592MHz
|
|
||||
{ |
|
||||
SCON = 0x50; //8菴肴焚謐?蜿ッ蜿俶ウ「迚ケ邇?
|
|
||||
AUXR |= 0x01; //荳イ蜿」1騾画叫螳壽慮蝎?荳コ豕「迚ケ邇�書逕溷�?
|
|
||||
AUXR |= 0x04; //螳壽慮蝎?譌カ髓滉クコFosc,蜊?T
|
|
||||
T2L = 0xE0; //隶セ螳壼ョ壽慮蛻晏 ?
|
|
||||
T2H = 0xFE; //隶セ螳壼ョ壽慮蛻晏?
|
|
||||
AUXR |= 0x10; //蜷ッ蜉ィ螳壽慮蝎?
|
|
||||
} |
|
||||
|
|
||||
void L3_debug_drv_init(void) |
|
||||
{ |
|
||||
|
|
||||
Ts_debug.uxrev = D_ts_uartX_rev; |
|
||||
|
|
||||
Ts_debug.td = (TS_P_debug *)Ts_debug.uxrev->buf; |
|
||||
Ts_debug.ok = &Ts_debug.uxrev->debugok; |
|
||||
UartInit(); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
char putchar(char ch) |
|
||||
{ |
|
||||
SBUF = ch; |
|
||||
while(TI == 0); |
|
||||
TI = 0; |
|
||||
return ch; |
|
||||
} |
|
||||
|
|
||||
#else |
|
||||
|
|
||||
|
|
||||
void L3_debug_drv_init(void) |
|
||||
{ |
|
||||
D_s2b_road1_init(); |
|
||||
} |
|
||||
|
|
||||
char putchar(char ch) |
|
||||
{ |
|
||||
/* Place your implementation of fputc here */ |
|
||||
/* e.g. write a character to the EVAL_COM1 and Loop until the end of transmission */ |
|
||||
/// HAL_UART_Transmit_IT(&huart4, (uint8_t *)&ch, 1);
|
|
||||
L1_uartD_senduc(ch); |
|
||||
return ch; |
|
||||
///SBUF= ch;
|
|
||||
/// while(t)
|
|
||||
/// while(!TI);
|
|
||||
// TI = 0;
|
|
||||
/// return (SBUF = ch);
|
|
||||
} |
|
||||
#endif ///#ifdef D_keil_sim
|
|
||||
|
|
||||
#if 0 |
|
||||
|
|
||||
void L3_debug_drv_init(void) |
|
||||
{ |
|
||||
L0pf_send_uc = L0_uart0_uc; |
|
||||
Lc_print("\r\n debug shell init:\t"); |
|
||||
/// io ノ靹テオトア�シミエキィ
|
|
||||
|
|
||||
Lc_print("Mode:"); |
|
||||
#ifdef D_debug_time |
|
||||
Lc_print(" debug"); |
|
||||
#else |
|
||||
//D_debug_time_using
|
|
||||
Lc_print(" normal"); |
|
||||
#endif |
|
||||
} |
|
||||
|
|
||||
|
|
||||
#ifdef D_debug_sim |
|
||||
|
|
||||
fff |
|
||||
void L3_debug_cycle(void) |
|
||||
{ |
|
||||
INTERRUPT_UART(); |
|
||||
TIMER0_IRQHandler(); |
|
||||
|
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
#else |
|
||||
|
|
||||
#endif |
|
||||
void L3_test_debug(u8 filter) |
|
||||
{ |
|
||||
if(filter == Ts_debug.td->filter) |
|
||||
{///filter num d1 d2 d3 ....dn
|
|
||||
//// FD 08 11 22 33 44 55 66 77 88
|
|
||||
L1_uartD_sendArrayhex(Ts_debug.td,Ts_debug.td->R1); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
void L3_iicx_debug(u8 filter) |
|
||||
{ |
|
||||
|
|
||||
if(filter == Ts_debug.td->filter) |
|
||||
{ |
|
||||
if(0x10 == Ts_debug.td->ocr)///read reg1 num 隸サ蜿睦eg1蝨ー蝮荳ュ逧�um荳ェ謨ー謐?
|
|
||||
{ |
|
||||
|
|
||||
//NUM: 0 1 2 3 4
|
|
||||
// Fx R1 R2 R3 ocr
|
|
||||
// sla reg1 num
|
|
||||
/// f1 32 15 06 10
|
|
||||
|
|
||||
|
|
||||
//NUM: 0 1 2 3 4
|
|
||||
// Fx R1 R2 R3 ocr
|
|
||||
// sla reg1 num
|
|
||||
/// f1 32 0x28 06 10
|
|
||||
/// f1 32 0x28 06 10
|
|
||||
/// 28
|
|
||||
/// 0010 1000 28
|
|
||||
/// 1010 1000 a8
|
|
||||
L2_IICM1_ReadReg(Ts_debug.td->R1,Ts_debug.td->R2,Ts_debug.d,Ts_debug.td->R3); |
|
||||
///printf("\r\n 0x%2x 0x%2x\r\n",(int)Ts_debug.d[0],(int)Ts_debug.d[1]);
|
|
||||
L1_uartD_sendArrayhex(Ts_debug.d,Ts_debug.td->R3); |
|
||||
/// printf("\r\n 0x%2x\r\n",(int)Ts_debug.td->ocr);
|
|
||||
} |
|
||||
else if(0x11 == Ts_debug.td->ocr) |
|
||||
{ |
|
||||
L2_IICM1_ReadReg(Ts_debug.td->R1,Ts_debug.td->R2,Ts_debug.d,Ts_debug.td->R3); |
|
||||
//printf("\r\n 0x%2x 0x%2x\r\n",(int)Ts_debug.d[0],(int)Ts_debug.d[1]);
|
|
||||
//L1_uartD_sendArrayhex(Ts_debug.d,Ts_debug.td->R3);
|
|
||||
|
|
||||
|
|
||||
printf("\r\n 0x%2x 0x%2x\r\n",(int)Ts_debug.d[0],(int)Ts_debug.d[1]); |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
} |
|
||||
else if(0x12 == Ts_debug.td->ocr) |
|
||||
{ |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
#else |
|
||||
|
|
||||
|
|
||||
|
|
||||
#endif |
|
||||
|
|
||||
|
|
||||
|
|
||||
/******************************************************************************
|
|
||||
** End Of File |
|
||||
******************************************************************************/ |
|
Binary file not shown.
Loading…
Reference in new issue