Mercurial > avr_jtag
comparison src/cmd_proto.c @ 3:e410832c3280
Issue of avr-ld.
- For some unknown reason, avr-ld can not handle multiple objects well.
- Fixed by compile all source at once.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sun, 22 Feb 2009 01:40:36 +0800 |
parents | f7c60e525801 |
children | cc106f278d7d |
comparison
equal
deleted
inserted
replaced
2:abf221bf3ce4 | 3:e410832c3280 |
---|---|
10 ST_WAIT_LEN, | 10 ST_WAIT_LEN, |
11 ST_WAIT_DATA, | 11 ST_WAIT_DATA, |
12 ST_WAIT_CSUM | 12 ST_WAIT_CSUM |
13 }; | 13 }; |
14 | 14 |
15 #define BUF_SZ 512 | |
16 | |
15 cmd_proto_t *cmd_proto_new(void) { | 17 cmd_proto_t *cmd_proto_new(void) { |
16 cmd_proto_t *cp; | 18 cmd_proto_t *cp; |
17 | 19 |
18 cp = (cmd_proto_t *)malloc(sizeof(cmd_proto_t) + 512); | 20 cp = (cmd_proto_t *)malloc(sizeof(cmd_proto_t) + BUF_SZ); |
19 if(cp == NULL) | 21 if(cp == NULL) |
20 return NULL; | 22 return NULL; |
21 | 23 |
22 memset(cp, 0, sizeof(cmd_proto_t)); | 24 memset(cp, 0, sizeof(cmd_proto_t)); |
23 cp->bufs[0] = ((char *)cp) + sizeof(cmd_proto_t); | 25 cp->bufs[0] = ((char *)cp) + sizeof(cmd_proto_t); |