forked from lab85-ru/jtag_avr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
task_consol.h
33 lines (25 loc) · 1004 Bytes
/
task_consol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* task_consol.h
*
* Created on: 29.10.2010
* Author: Àäìèíèñòðàòîð
*/
#ifndef TASK_CONSOL_H_
#define TASK_CONSOL_H_
#define FBUFF_SIZE 512
#define CONSOL_BUF_SIZE (134)// 133 for x-modex-128
typedef struct{
char buf[ CONSOL_BUF_SIZE ]; // áóôåð, ñòðîêà ñêëååíàÿ èç îòäåëüíûõ áàéòîâ
unsigned char n; // êîëè÷åñòâî áàéò â áóôåðå
unsigned char i; // òåêóùàÿ ïîçèöèÿ ñ÷èòûâàåìîãî áàéòà èç áóôåðà äëÿ x-modem, ò.ê. ëèíéíûé áóôåð
char string[ CONSOL_BUF_SIZE ]; // êîïèÿ ñòðîêè buf äëÿ ïîñëåäþþùåãî ðàçáîðà
}consol_structure;
typedef enum {FLAG_CONSOL, FLAG_XMODEM} consol_flag_enum; // ðåæèì â êîòîðîì íàõîäèòñÿ êîíñîëü
int search_arg(char *sin, char **argv);
void consol_init( void );
void consol_out_promt( void );
void consol_clear_buf( void );
void task_consol( void );
void print_byte_to_bit(uint8_t b);
void dump_buff (const char *buff, unsigned int ofs, unsigned int cnt);
#endif /* TASK_CONSOL_H_ */