65 lines
1023 B
C
65 lines
1023 B
C
#include "proto_print.h"
|
|
|
|
#include "stdio.h"
|
|
#include "bsp_Uart.h"
|
|
|
|
u16 proto_print_data_type;
|
|
|
|
void proto_print_datatype_set(u8 type);
|
|
static void proto_print_task(void);
|
|
|
|
proto_print_t print =
|
|
{
|
|
.task = proto_print_task,
|
|
.set = proto_print_datatype_set,
|
|
};
|
|
|
|
proto_print_t *p_print = &print;
|
|
|
|
static void proto_print_datatype_set(u8 type)
|
|
{
|
|
if(type > PROTO_PRINT_MAX)
|
|
{
|
|
|
|
}
|
|
else
|
|
{
|
|
if(proto_print_data_type == type)
|
|
{
|
|
proto_print_data_type = PROTO_PRINT_NULL;
|
|
}
|
|
else
|
|
{
|
|
proto_print_data_type = type;
|
|
}
|
|
}
|
|
}
|
|
|
|
static void proto_print_task(void)
|
|
{
|
|
switch(proto_print_data_type)
|
|
{
|
|
case PROTO_PRINT_NULL:
|
|
{
|
|
|
|
}break;
|
|
case PROTO_PRINT_CURDATA:
|
|
{
|
|
|
|
}break;
|
|
case PROTO_PRINT_WAVE:
|
|
{
|
|
|
|
}break;
|
|
case PROTO_PRINT_CALIB:
|
|
{
|
|
|
|
}break;
|
|
default:
|
|
{
|
|
|
|
}break;
|
|
}
|
|
}
|
|
|