1 .cpu cortex-m4 2 .eabi_attribute 20, 1 3 .eabi_attribute 21, 1 4 .eabi_attribute 23, 3 5 .eabi_attribute 24, 1 6 .eabi_attribute 25, 1 7 .eabi_attribute 26, 1 8 .eabi_attribute 30, 4 9 .eabi_attribute 34, 1 10 .eabi_attribute 18, 4 11 .file "simpleserial.c" 12 .text 13 .Ltext0: 14 .cfi_sections .debug_frame 15 .section .text.check_version,"ax",%progbits 16 .align 1 17 .global check_version 18 .arch armv7e-m 19 .syntax unified 20 .thumb 21 .thumb_func 22 .fpu softvfp 24 check_version: 25 .LVL0: 26 .LFB1: 27 .file 1 "deps//simpleserial/simpleserial.c" 1:deps//simpleserial/simpleserial.c **** // simpleserial.c 2:deps//simpleserial/simpleserial.c **** 3:deps//simpleserial/simpleserial.c **** #include "simpleserial.h" 4:deps//simpleserial/simpleserial.c **** #include 5:deps//simpleserial/simpleserial.c **** #include "hal.h" 6:deps//simpleserial/simpleserial.c **** 7:deps//simpleserial/simpleserial.c **** 8:deps//simpleserial/simpleserial.c **** #define MAX_SS_CMDS 16 9:deps//simpleserial/simpleserial.c **** static int num_commands = 0; 10:deps//simpleserial/simpleserial.c **** 11:deps//simpleserial/simpleserial.c **** #define MAX_SS_LEN 192 12:deps//simpleserial/simpleserial.c **** 13:deps//simpleserial/simpleserial.c **** //#define SS_VER_1_0 0 14:deps//simpleserial/simpleserial.c **** //#define SS_VER_1_1 1 15:deps//simpleserial/simpleserial.c **** //#define SS_VER_2_0 2 16:deps//simpleserial/simpleserial.c **** 17:deps//simpleserial/simpleserial.c **** 18:deps//simpleserial/simpleserial.c **** // 0xA6 formerly 19:deps//simpleserial/simpleserial.c **** #define CW_CRC 0x4D 20:deps//simpleserial/simpleserial.c **** uint8_t ss_crc(uint8_t *buf, uint8_t len) 21:deps//simpleserial/simpleserial.c **** { 22:deps//simpleserial/simpleserial.c **** unsigned int k = 0; 23:deps//simpleserial/simpleserial.c **** uint8_t crc = 0x00; 24:deps//simpleserial/simpleserial.c **** while (len--) { 25:deps//simpleserial/simpleserial.c **** crc ^= *buf++; 26:deps//simpleserial/simpleserial.c **** for (k = 0; k < 8; k++) { 27:deps//simpleserial/simpleserial.c **** crc = crc & 0x80 ? (crc << 1) ^ CW_CRC: crc << 1; 28:deps//simpleserial/simpleserial.c **** } 29:deps//simpleserial/simpleserial.c **** } 30:deps//simpleserial/simpleserial.c **** return crc; 31:deps//simpleserial/simpleserial.c **** 32:deps//simpleserial/simpleserial.c **** } 33:deps//simpleserial/simpleserial.c **** 34:deps//simpleserial/simpleserial.c **** // [B_STUFF, CMD, SCMD, LEN, B_STUFF, DATA..., CRC, TERM] 35:deps//simpleserial/simpleserial.c **** 36:deps//simpleserial/simpleserial.c **** //#define SS_VER SS_VER_2_0 37:deps//simpleserial/simpleserial.c **** #if SS_VER == SS_VER_2_0 38:deps//simpleserial/simpleserial.c **** #error "SS_VER_2_0 is deprecated! Use SS_VER_2_1 instead." 39:deps//simpleserial/simpleserial.c **** #elif SS_VER == SS_VER_2_1 40:deps//simpleserial/simpleserial.c **** 41:deps//simpleserial/simpleserial.c **** 42:deps//simpleserial/simpleserial.c **** typedef struct ss_cmd 43:deps//simpleserial/simpleserial.c **** { 44:deps//simpleserial/simpleserial.c **** char c; 45:deps//simpleserial/simpleserial.c **** unsigned int len; 46:deps//simpleserial/simpleserial.c **** uint8_t (*fp)(uint8_t, uint8_t, uint8_t, uint8_t *); 47:deps//simpleserial/simpleserial.c **** } ss_cmd; 48:deps//simpleserial/simpleserial.c **** static ss_cmd commands[MAX_SS_CMDS]; 49:deps//simpleserial/simpleserial.c **** 50:deps//simpleserial/simpleserial.c **** void ss_puts(char *x) 51:deps//simpleserial/simpleserial.c **** { 52:deps//simpleserial/simpleserial.c **** do { 53:deps//simpleserial/simpleserial.c **** putch(*x); 54:deps//simpleserial/simpleserial.c **** } while (*++x); 55:deps//simpleserial/simpleserial.c **** } 56:deps//simpleserial/simpleserial.c **** 57:deps//simpleserial/simpleserial.c **** #define FRAME_BYTE 0x00 58:deps//simpleserial/simpleserial.c **** 59:deps//simpleserial/simpleserial.c **** uint8_t check_version(uint8_t cmd, uint8_t scmd, uint8_t len, uint8_t *data) 60:deps//simpleserial/simpleserial.c **** { 61:deps//simpleserial/simpleserial.c **** uint8_t ver = SS_VER; 62:deps//simpleserial/simpleserial.c **** simpleserial_put('r', 1, &ver); 63:deps//simpleserial/simpleserial.c **** return SS_ERR_OK; 64:deps//simpleserial/simpleserial.c **** } 65:deps//simpleserial/simpleserial.c **** 66:deps//simpleserial/simpleserial.c **** uint8_t ss_get_commands(uint8_t cmd, uint8_t scmd, uint8_t len, uint8_t *data) 67:deps//simpleserial/simpleserial.c **** { 68:deps//simpleserial/simpleserial.c **** uint8_t cmd_chars[MAX_SS_CMDS]; 69:deps//simpleserial/simpleserial.c **** for (uint8_t i = 0; i < (num_commands & 0xFF); i++) { 70:deps//simpleserial/simpleserial.c **** cmd_chars[i] = commands[i].c; 71:deps//simpleserial/simpleserial.c **** } 72:deps//simpleserial/simpleserial.c **** 73:deps//simpleserial/simpleserial.c **** simpleserial_put('r', num_commands & 0xFF, (void *)cmd_chars); 74:deps//simpleserial/simpleserial.c **** return 0x00; 75:deps//simpleserial/simpleserial.c **** 76:deps//simpleserial/simpleserial.c **** } 77:deps//simpleserial/simpleserial.c **** 78:deps//simpleserial/simpleserial.c **** uint8_t stuff_data(uint8_t *buf, uint8_t len) 79:deps//simpleserial/simpleserial.c **** { 80:deps//simpleserial/simpleserial.c **** uint8_t i = 1; 81:deps//simpleserial/simpleserial.c **** uint8_t last = 0; 82:deps//simpleserial/simpleserial.c **** for (; i < len; i++) { 83:deps//simpleserial/simpleserial.c **** if (buf[i] == FRAME_BYTE) { 84:deps//simpleserial/simpleserial.c **** buf[last] = i - last; 85:deps//simpleserial/simpleserial.c **** last = i; 86:deps//simpleserial/simpleserial.c **** } 87:deps//simpleserial/simpleserial.c **** } 88:deps//simpleserial/simpleserial.c **** return 0x00; 89:deps//simpleserial/simpleserial.c **** } 90:deps//simpleserial/simpleserial.c **** 91:deps//simpleserial/simpleserial.c **** uint8_t unstuff_data(uint8_t *buf, uint8_t len) 92:deps//simpleserial/simpleserial.c **** { 93:deps//simpleserial/simpleserial.c **** uint8_t next = buf[0]; 94:deps//simpleserial/simpleserial.c **** buf[0] = 0x00; 95:deps//simpleserial/simpleserial.c **** //len -= 1; 96:deps//simpleserial/simpleserial.c **** uint8_t tmp = next; 97:deps//simpleserial/simpleserial.c **** while ((next < len) && tmp != 0) { 98:deps//simpleserial/simpleserial.c **** tmp = buf[next]; 99:deps//simpleserial/simpleserial.c **** buf[next] = FRAME_BYTE; 100:deps//simpleserial/simpleserial.c **** next += tmp; 101:deps//simpleserial/simpleserial.c **** } 102:deps//simpleserial/simpleserial.c **** return next; 103:deps//simpleserial/simpleserial.c **** } 104:deps//simpleserial/simpleserial.c **** 105:deps//simpleserial/simpleserial.c **** // Set up the SimpleSerial module by preparing internal commands 106:deps//simpleserial/simpleserial.c **** // This just adds the "v" command for now... 107:deps//simpleserial/simpleserial.c **** void simpleserial_init() 108:deps//simpleserial/simpleserial.c **** { 109:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('v', 0, check_version); 110:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('w', 0, ss_get_commands); 111:deps//simpleserial/simpleserial.c **** } 112:deps//simpleserial/simpleserial.c **** 113:deps//simpleserial/simpleserial.c **** int simpleserial_addcmd(char c, unsigned int len, uint8_t (*fp)(uint8_t, uint8_t, uint8_t, uint8_t* 114:deps//simpleserial/simpleserial.c **** { 115:deps//simpleserial/simpleserial.c **** if(num_commands >= MAX_SS_CMDS) { 116:deps//simpleserial/simpleserial.c **** putch('a'); 117:deps//simpleserial/simpleserial.c **** return 1; 118:deps//simpleserial/simpleserial.c **** } 119:deps//simpleserial/simpleserial.c **** 120:deps//simpleserial/simpleserial.c **** if(len >= MAX_SS_LEN) { 121:deps//simpleserial/simpleserial.c **** putch('b'); 122:deps//simpleserial/simpleserial.c **** return 1; 123:deps//simpleserial/simpleserial.c **** } 124:deps//simpleserial/simpleserial.c **** 125:deps//simpleserial/simpleserial.c **** commands[num_commands].c = c; 126:deps//simpleserial/simpleserial.c **** commands[num_commands].len = len; 127:deps//simpleserial/simpleserial.c **** commands[num_commands].fp = fp; 128:deps//simpleserial/simpleserial.c **** num_commands++; 129:deps//simpleserial/simpleserial.c **** 130:deps//simpleserial/simpleserial.c **** return 0; 131:deps//simpleserial/simpleserial.c **** } 132:deps//simpleserial/simpleserial.c **** 133:deps//simpleserial/simpleserial.c **** void simpleserial_get(void) 134:deps//simpleserial/simpleserial.c **** { 135:deps//simpleserial/simpleserial.c **** uint8_t data_buf[MAX_SS_LEN]; 136:deps//simpleserial/simpleserial.c **** uint8_t err = 0; 137:deps//simpleserial/simpleserial.c **** 138:deps//simpleserial/simpleserial.c **** for (int i = 0; i < 4; i++) { 139:deps//simpleserial/simpleserial.c **** data_buf[i] = getch(); //PTR, cmd, scmd, len 140:deps//simpleserial/simpleserial.c **** if (data_buf[i] == FRAME_BYTE) { 141:deps//simpleserial/simpleserial.c **** err = SS_ERR_FRAME_BYTE; 142:deps//simpleserial/simpleserial.c **** goto ERROR; 143:deps//simpleserial/simpleserial.c **** } 144:deps//simpleserial/simpleserial.c **** } 145:deps//simpleserial/simpleserial.c **** uint8_t next_frame = unstuff_data(data_buf, 4); 146:deps//simpleserial/simpleserial.c **** 147:deps//simpleserial/simpleserial.c **** // check for valid command 148:deps//simpleserial/simpleserial.c **** uint8_t c = 0; 149:deps//simpleserial/simpleserial.c **** for(c = 0; c < num_commands; c++) 150:deps//simpleserial/simpleserial.c **** { 151:deps//simpleserial/simpleserial.c **** if(commands[c].c == data_buf[1]) 152:deps//simpleserial/simpleserial.c **** break; 153:deps//simpleserial/simpleserial.c **** } 154:deps//simpleserial/simpleserial.c **** 155:deps//simpleserial/simpleserial.c **** if (c == num_commands) { 156:deps//simpleserial/simpleserial.c **** err = SS_ERR_CMD; 157:deps//simpleserial/simpleserial.c **** goto ERROR; 158:deps//simpleserial/simpleserial.c **** } 159:deps//simpleserial/simpleserial.c **** 160:deps//simpleserial/simpleserial.c **** //check that next frame not beyond end of message 161:deps//simpleserial/simpleserial.c **** // account for cmd, scmd, len, data, crc, end of frame 162:deps//simpleserial/simpleserial.c **** if ((data_buf[3] + 5) < next_frame) { 163:deps//simpleserial/simpleserial.c **** err = SS_ERR_LEN; 164:deps//simpleserial/simpleserial.c **** goto ERROR; 165:deps//simpleserial/simpleserial.c **** } 166:deps//simpleserial/simpleserial.c **** 167:deps//simpleserial/simpleserial.c **** // read in data 168:deps//simpleserial/simpleserial.c **** // eq to len + crc + frame end 169:deps//simpleserial/simpleserial.c **** int i = 4; 170:deps//simpleserial/simpleserial.c **** for (; i < data_buf[3] + 5; i++) { 171:deps//simpleserial/simpleserial.c **** data_buf[i] = getch(); 172:deps//simpleserial/simpleserial.c **** if (data_buf[i] == FRAME_BYTE) { 173:deps//simpleserial/simpleserial.c **** err = SS_ERR_FRAME_BYTE; 174:deps//simpleserial/simpleserial.c **** goto ERROR; 175:deps//simpleserial/simpleserial.c **** } 176:deps//simpleserial/simpleserial.c **** } 177:deps//simpleserial/simpleserial.c **** 178:deps//simpleserial/simpleserial.c **** //check that final byte is the FRAME_BYTE 179:deps//simpleserial/simpleserial.c **** data_buf[i] = getch(); 180:deps//simpleserial/simpleserial.c **** if (data_buf[i] != FRAME_BYTE) { 181:deps//simpleserial/simpleserial.c **** err = SS_ERR_LEN; 182:deps//simpleserial/simpleserial.c **** goto ERROR; 183:deps//simpleserial/simpleserial.c **** } 184:deps//simpleserial/simpleserial.c **** 185:deps//simpleserial/simpleserial.c **** //fully unstuff data now 186:deps//simpleserial/simpleserial.c **** unstuff_data(data_buf + next_frame, i - next_frame + 1); 187:deps//simpleserial/simpleserial.c **** 188:deps//simpleserial/simpleserial.c **** //calc crc excluding original frame offset and frame end and crc 189:deps//simpleserial/simpleserial.c **** uint8_t crc = ss_crc(data_buf+1, i-2); 190:deps//simpleserial/simpleserial.c **** if (crc != data_buf[i-1]) { 191:deps//simpleserial/simpleserial.c **** err = SS_ERR_CRC; 192:deps//simpleserial/simpleserial.c **** goto ERROR; 193:deps//simpleserial/simpleserial.c **** } 194:deps//simpleserial/simpleserial.c **** 195:deps//simpleserial/simpleserial.c **** err = commands[c].fp(data_buf[1], data_buf[2], data_buf[3], data_buf+4); 196:deps//simpleserial/simpleserial.c **** 197:deps//simpleserial/simpleserial.c **** ERROR: 198:deps//simpleserial/simpleserial.c **** simpleserial_put('e', 0x01, &err); 199:deps//simpleserial/simpleserial.c **** return; 200:deps//simpleserial/simpleserial.c **** } 201:deps//simpleserial/simpleserial.c **** 202:deps//simpleserial/simpleserial.c **** void simpleserial_put(char c, uint8_t size, uint8_t* output) 203:deps//simpleserial/simpleserial.c **** { 204:deps//simpleserial/simpleserial.c **** uint8_t data_buf[MAX_SS_LEN]; 205:deps//simpleserial/simpleserial.c **** data_buf[0] = 0x00; 206:deps//simpleserial/simpleserial.c **** data_buf[1] = c; 207:deps//simpleserial/simpleserial.c **** data_buf[2] = size; 208:deps//simpleserial/simpleserial.c **** int i = 0; 209:deps//simpleserial/simpleserial.c **** for (; i < size; i++) { 210:deps//simpleserial/simpleserial.c **** data_buf[i + 3] = output[i]; 211:deps//simpleserial/simpleserial.c **** } 212:deps//simpleserial/simpleserial.c **** data_buf[i + 3] = ss_crc(data_buf+1, size+2); 213:deps//simpleserial/simpleserial.c **** data_buf[i + 4] = 0x00; 214:deps//simpleserial/simpleserial.c **** stuff_data(data_buf, i + 5); 215:deps//simpleserial/simpleserial.c **** for (int i = 0; i < size + 5; i++) { 216:deps//simpleserial/simpleserial.c **** putch(data_buf[i]); 217:deps//simpleserial/simpleserial.c **** } 218:deps//simpleserial/simpleserial.c **** } 219:deps//simpleserial/simpleserial.c **** 220:deps//simpleserial/simpleserial.c **** 221:deps//simpleserial/simpleserial.c **** #else 222:deps//simpleserial/simpleserial.c **** 223:deps//simpleserial/simpleserial.c **** typedef struct ss_cmd 224:deps//simpleserial/simpleserial.c **** { 225:deps//simpleserial/simpleserial.c **** char c; 226:deps//simpleserial/simpleserial.c **** unsigned int len; 227:deps//simpleserial/simpleserial.c **** uint8_t (*fp)(uint8_t*, uint8_t); 228:deps//simpleserial/simpleserial.c **** uint8_t flags; 229:deps//simpleserial/simpleserial.c **** } ss_cmd; 230:deps//simpleserial/simpleserial.c **** static ss_cmd commands[MAX_SS_CMDS]; 231:deps//simpleserial/simpleserial.c **** // Callback function for "v" command. 232:deps//simpleserial/simpleserial.c **** // This can exist in v1.0 as long as we don't actually send back an ack ("z") 233:deps//simpleserial/simpleserial.c **** uint8_t check_version(uint8_t *v, uint8_t len) 234:deps//simpleserial/simpleserial.c **** { 28 .loc 1 234 1 view -0 29 .cfi_startproc 30 @ args = 0, pretend = 0, frame = 0 31 @ frame_needed = 0, uses_anonymous_args = 0 32 @ link register save eliminated. 235:deps//simpleserial/simpleserial.c **** return SS_VER; 33 .loc 1 235 2 view .LVU1 236:deps//simpleserial/simpleserial.c **** } 34 .loc 1 236 1 is_stmt 0 view .LVU2 35 0000 0120 movs r0, #1 36 .LVL1: 37 .loc 1 236 1 view .LVU3 38 0002 7047 bx lr 39 .cfi_endproc 40 .LFE1: 42 .section .text.ss_crc,"ax",%progbits 43 .align 1 44 .global ss_crc 45 .syntax unified 46 .thumb 47 .thumb_func 48 .fpu softvfp 50 ss_crc: 51 .LVL2: 52 .LFB0: 21:deps//simpleserial/simpleserial.c **** unsigned int k = 0; 53 .loc 1 21 1 is_stmt 1 view -0 54 .cfi_startproc 55 @ args = 0, pretend = 0, frame = 0 56 @ frame_needed = 0, uses_anonymous_args = 0 21:deps//simpleserial/simpleserial.c **** unsigned int k = 0; 57 .loc 1 21 1 is_stmt 0 view .LVU5 58 0000 10B5 push {r4, lr} 59 .LCFI0: 60 .cfi_def_cfa_offset 8 61 .cfi_offset 4, -8 62 .cfi_offset 14, -4 21:deps//simpleserial/simpleserial.c **** unsigned int k = 0; 63 .loc 1 21 1 view .LVU6 64 0002 0246 mov r2, r0 22:deps//simpleserial/simpleserial.c **** uint8_t crc = 0x00; 65 .loc 1 22 2 is_stmt 1 view .LVU7 66 .LVL3: 23:deps//simpleserial/simpleserial.c **** while (len--) { 67 .loc 1 23 2 view .LVU8 24:deps//simpleserial/simpleserial.c **** crc ^= *buf++; 68 .loc 1 24 2 view .LVU9 69 0004 0144 add r1, r1, r0 70 .LVL4: 23:deps//simpleserial/simpleserial.c **** while (len--) { 71 .loc 1 23 10 is_stmt 0 view .LVU10 72 0006 0020 movs r0, #0 73 .LVL5: 74 .L3: 24:deps//simpleserial/simpleserial.c **** crc ^= *buf++; 75 .loc 1 24 9 is_stmt 1 view .LVU11 24:deps//simpleserial/simpleserial.c **** crc ^= *buf++; 76 .loc 1 24 9 is_stmt 0 view .LVU12 77 0008 8A42 cmp r2, r1 78 000a 00D1 bne .L7 30:deps//simpleserial/simpleserial.c **** 79 .loc 1 30 2 is_stmt 1 view .LVU13 32:deps//simpleserial/simpleserial.c **** 80 .loc 1 32 1 is_stmt 0 view .LVU14 81 000c 10BD pop {r4, pc} 82 .L7: 25:deps//simpleserial/simpleserial.c **** for (k = 0; k < 8; k++) { 83 .loc 1 25 3 is_stmt 1 view .LVU15 84 .LVL6: 25:deps//simpleserial/simpleserial.c **** for (k = 0; k < 8; k++) { 85 .loc 1 25 7 is_stmt 0 view .LVU16 86 000e 12F8013B ldrb r3, [r2], #1 @ zero_extendqisi2 87 .LVL7: 25:deps//simpleserial/simpleserial.c **** for (k = 0; k < 8; k++) { 88 .loc 1 25 7 view .LVU17 89 0012 0824 movs r4, #8 90 0014 5840 eors r0, r0, r3 91 .LVL8: 26:deps//simpleserial/simpleserial.c **** crc = crc & 0x80 ? (crc << 1) ^ CW_CRC: crc << 1; 92 .loc 1 26 3 is_stmt 1 view .LVU18 26:deps//simpleserial/simpleserial.c **** crc = crc & 0x80 ? (crc << 1) ^ CW_CRC: crc << 1; 93 .loc 1 26 17 view .LVU19 94 .L6: 27:deps//simpleserial/simpleserial.c **** } 95 .loc 1 27 4 view .LVU20 27:deps//simpleserial/simpleserial.c **** } 96 .loc 1 27 8 is_stmt 0 view .LVU21 97 0016 10F0800F tst r0, #128 98 001a 4FEA4003 lsl r3, r0, #1 27:deps//simpleserial/simpleserial.c **** } 99 .loc 1 27 34 view .LVU22 100 001e 18BF it ne 101 0020 83F04D03 eorne r3, r3, #77 26:deps//simpleserial/simpleserial.c **** crc = crc & 0x80 ? (crc << 1) ^ CW_CRC: crc << 1; 102 .loc 1 26 17 view .LVU23 103 0024 013C subs r4, r4, #1 104 .LVL9: 27:deps//simpleserial/simpleserial.c **** } 105 .loc 1 27 8 view .LVU24 106 0026 D8B2 uxtb r0, r3 107 .LVL10: 26:deps//simpleserial/simpleserial.c **** crc = crc & 0x80 ? (crc << 1) ^ CW_CRC: crc << 1; 108 .loc 1 26 23 is_stmt 1 view .LVU25 26:deps//simpleserial/simpleserial.c **** crc = crc & 0x80 ? (crc << 1) ^ CW_CRC: crc << 1; 109 .loc 1 26 17 view .LVU26 110 0028 F5D1 bne .L6 111 002a EDE7 b .L3 112 .cfi_endproc 113 .LFE0: 115 .section .text.hex_decode,"ax",%progbits 116 .align 1 117 .global hex_decode 118 .syntax unified 119 .thumb 120 .thumb_func 121 .fpu softvfp 123 hex_decode: 124 .LVL11: 125 .LFB4: 237:deps//simpleserial/simpleserial.c **** 238:deps//simpleserial/simpleserial.c **** uint8_t ss_num_commands(uint8_t *x, uint8_t len) 239:deps//simpleserial/simpleserial.c **** { 240:deps//simpleserial/simpleserial.c **** uint8_t ncmds = num_commands & 0xFF; 241:deps//simpleserial/simpleserial.c **** simpleserial_put('r', 0x01, &ncmds); 242:deps//simpleserial/simpleserial.c **** return 0x00; 243:deps//simpleserial/simpleserial.c **** } 244:deps//simpleserial/simpleserial.c **** 245:deps//simpleserial/simpleserial.c **** typedef struct ss_cmd_repr { 246:deps//simpleserial/simpleserial.c **** uint8_t c; 247:deps//simpleserial/simpleserial.c **** uint8_t len; 248:deps//simpleserial/simpleserial.c **** uint8_t flags; 249:deps//simpleserial/simpleserial.c **** } ss_cmd_repr; 250:deps//simpleserial/simpleserial.c **** 251:deps//simpleserial/simpleserial.c **** uint8_t ss_get_commands(uint8_t *x, uint8_t len) 252:deps//simpleserial/simpleserial.c **** { 253:deps//simpleserial/simpleserial.c **** ss_cmd_repr repr_cmd_buf[MAX_SS_CMDS]; 254:deps//simpleserial/simpleserial.c **** for (uint8_t i = 0; i < (num_commands & 0xFF); i++) { 255:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c; 256:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].len = commands[i].len; 257:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].flags = commands[i].flags; 258:deps//simpleserial/simpleserial.c **** } 259:deps//simpleserial/simpleserial.c **** 260:deps//simpleserial/simpleserial.c **** simpleserial_put('r', num_commands * 0x03, (void *) repr_cmd_buf); 261:deps//simpleserial/simpleserial.c **** return 0x00; 262:deps//simpleserial/simpleserial.c **** } 263:deps//simpleserial/simpleserial.c **** 264:deps//simpleserial/simpleserial.c **** static char hex_lookup[16] = 265:deps//simpleserial/simpleserial.c **** { 266:deps//simpleserial/simpleserial.c **** '0', '1', '2', '3', '4', '5', '6', '7', 267:deps//simpleserial/simpleserial.c **** '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' 268:deps//simpleserial/simpleserial.c **** }; 269:deps//simpleserial/simpleserial.c **** 270:deps//simpleserial/simpleserial.c **** int hex_decode(int len, char* ascii_buf, uint8_t* data_buf) 271:deps//simpleserial/simpleserial.c **** { 126 .loc 1 271 1 view -0 127 .cfi_startproc 128 @ args = 0, pretend = 0, frame = 0 129 @ frame_needed = 0, uses_anonymous_args = 0 272:deps//simpleserial/simpleserial.c **** for(int i = 0; i < len; i++) 130 .loc 1 272 2 view .LVU28 131 .LBB2: 132 .loc 1 272 6 view .LVU29 133 .loc 1 272 6 is_stmt 0 view .LVU30 134 .LBE2: 271:deps//simpleserial/simpleserial.c **** for(int i = 0; i < len; i++) 135 .loc 1 271 1 view .LVU31 136 0000 F0B5 push {r4, r5, r6, r7, lr} 137 .LCFI1: 138 .cfi_def_cfa_offset 20 139 .cfi_offset 4, -20 140 .cfi_offset 5, -16 141 .cfi_offset 6, -12 142 .cfi_offset 7, -8 143 .cfi_offset 14, -4 144 .LBB7: 145 .loc 1 272 10 view .LVU32 146 0002 0025 movs r5, #0 147 .LBB3: 273:deps//simpleserial/simpleserial.c **** { 274:deps//simpleserial/simpleserial.c **** char n_hi = ascii_buf[2*i]; 275:deps//simpleserial/simpleserial.c **** char n_lo = ascii_buf[2*i+1]; 148 .loc 1 275 8 view .LVU33 149 0004 4F1C adds r7, r1, #1 150 .LVL12: 151 .L10: 152 .loc 1 275 8 view .LVU34 153 .LBE3: 272:deps//simpleserial/simpleserial.c **** { 154 .loc 1 272 19 is_stmt 1 discriminator 1 view .LVU35 155 0006 8542 cmp r5, r0 156 0008 01DB blt .L20 157 .LBE7: 276:deps//simpleserial/simpleserial.c **** 277:deps//simpleserial/simpleserial.c **** if(n_lo >= '0' && n_lo <= '9') 278:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - '0'; 279:deps//simpleserial/simpleserial.c **** else if(n_lo >= 'A' && n_lo <= 'F') 280:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - 'A' + 10; 281:deps//simpleserial/simpleserial.c **** else if(n_lo >= 'a' && n_lo <= 'f') 282:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - 'a' + 10; 283:deps//simpleserial/simpleserial.c **** else 284:deps//simpleserial/simpleserial.c **** return 1; 285:deps//simpleserial/simpleserial.c **** 286:deps//simpleserial/simpleserial.c **** if(n_hi >= '0' && n_hi <= '9') 287:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - '0') << 4; 288:deps//simpleserial/simpleserial.c **** else if(n_hi >= 'A' && n_hi <= 'F') 289:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - 'A' + 10) << 4; 290:deps//simpleserial/simpleserial.c **** else if(n_hi >= 'a' && n_hi <= 'f') 291:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - 'a' + 10) << 4; 292:deps//simpleserial/simpleserial.c **** else 293:deps//simpleserial/simpleserial.c **** return 1; 294:deps//simpleserial/simpleserial.c **** } 295:deps//simpleserial/simpleserial.c **** 296:deps//simpleserial/simpleserial.c **** return 0; 158 .loc 1 296 9 is_stmt 0 view .LVU36 159 000a 0020 movs r0, #0 160 .LVL13: 161 .loc 1 296 9 view .LVU37 162 000c 21E0 b .L9 163 .LVL14: 164 .L20: 165 .LBB8: 166 .LBB4: 274:deps//simpleserial/simpleserial.c **** char n_lo = ascii_buf[2*i+1]; 167 .loc 1 274 3 is_stmt 1 view .LVU38 275:deps//simpleserial/simpleserial.c **** 168 .loc 1 275 8 is_stmt 0 view .LVU39 169 000e 17F81540 ldrb r4, [r7, r5, lsl #1] @ zero_extendqisi2 274:deps//simpleserial/simpleserial.c **** char n_lo = ascii_buf[2*i+1]; 170 .loc 1 274 8 view .LVU40 171 0012 11F81530 ldrb r3, [r1, r5, lsl #1] @ zero_extendqisi2 172 .LVL15: 275:deps//simpleserial/simpleserial.c **** 173 .loc 1 275 3 is_stmt 1 view .LVU41 277:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - '0'; 174 .loc 1 277 3 view .LVU42 277:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - '0'; 175 .loc 1 277 18 is_stmt 0 view .LVU43 176 0016 A4F13006 sub r6, r4, #48 177 001a F6B2 uxtb r6, r6 277:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - '0'; 178 .loc 1 277 5 view .LVU44 179 001c 092E cmp r6, #9 180 001e 0CD8 bhi .L11 278:deps//simpleserial/simpleserial.c **** else if(n_lo >= 'A' && n_lo <= 'F') 181 .loc 1 278 4 is_stmt 1 view .LVU45 278:deps//simpleserial/simpleserial.c **** else if(n_lo >= 'A' && n_lo <= 'F') 182 .loc 1 278 16 is_stmt 0 view .LVU46 183 0020 1670 strb r6, [r2] 184 .LVL16: 185 .L12: 286:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - '0') << 4; 186 .loc 1 286 3 is_stmt 1 view .LVU47 286:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - '0') << 4; 187 .loc 1 286 18 is_stmt 0 view .LVU48 188 0022 A3F13004 sub r4, r3, #48 286:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - '0') << 4; 189 .loc 1 286 5 view .LVU49 190 0026 E6B2 uxtb r6, r4 191 0028 092E cmp r6, #9 192 002a 15D8 bhi .L16 193 .L23: 289:deps//simpleserial/simpleserial.c **** else if(n_hi >= 'a' && n_hi <= 'f') 194 .loc 1 289 16 view .LVU50 195 002c 1378 ldrb r3, [r2] @ zero_extendqisi2 196 .LVL17: 289:deps//simpleserial/simpleserial.c **** else if(n_hi >= 'a' && n_hi <= 'f') 197 .loc 1 289 16 view .LVU51 198 002e 43EA0413 orr r3, r3, r4, lsl #4 199 .L22: 291:deps//simpleserial/simpleserial.c **** else 200 .loc 1 291 16 view .LVU52 201 0032 1370 strb r3, [r2] 202 .LBE4: 272:deps//simpleserial/simpleserial.c **** { 203 .loc 1 272 27 is_stmt 1 view .LVU53 204 0034 0135 adds r5, r5, #1 205 .LVL18: 272:deps//simpleserial/simpleserial.c **** { 206 .loc 1 272 27 is_stmt 0 view .LVU54 207 0036 0132 adds r2, r2, #1 208 0038 E5E7 b .L10 209 .LVL19: 210 .L11: 211 .LBB5: 279:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - 'A' + 10; 212 .loc 1 279 8 is_stmt 1 view .LVU55 279:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - 'A' + 10; 213 .loc 1 279 10 is_stmt 0 view .LVU56 214 003a A4F14106 sub r6, r4, #65 215 003e 052E cmp r6, #5 216 0040 02D8 bhi .L13 280:deps//simpleserial/simpleserial.c **** else if(n_lo >= 'a' && n_lo <= 'f') 217 .loc 1 280 4 is_stmt 1 view .LVU57 280:deps//simpleserial/simpleserial.c **** else if(n_lo >= 'a' && n_lo <= 'f') 218 .loc 1 280 29 is_stmt 0 view .LVU58 219 0042 373C subs r4, r4, #55 220 .LVL20: 221 .L21: 282:deps//simpleserial/simpleserial.c **** else 222 .loc 1 282 16 view .LVU59 223 0044 1470 strb r4, [r2] 224 .LVL21: 282:deps//simpleserial/simpleserial.c **** else 225 .loc 1 282 16 view .LVU60 226 0046 ECE7 b .L12 227 .LVL22: 228 .L13: 281:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - 'a' + 10; 229 .loc 1 281 8 is_stmt 1 view .LVU61 281:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - 'a' + 10; 230 .loc 1 281 10 is_stmt 0 view .LVU62 231 0048 A4F16106 sub r6, r4, #97 232 004c 052E cmp r6, #5 233 004e 01D9 bls .L14 234 .LVL23: 235 .L19: 284:deps//simpleserial/simpleserial.c **** 236 .loc 1 284 11 view .LVU63 237 0050 0120 movs r0, #1 238 .LVL24: 239 .L9: 284:deps//simpleserial/simpleserial.c **** 240 .loc 1 284 11 view .LVU64 241 .LBE5: 242 .LBE8: 297:deps//simpleserial/simpleserial.c **** } 243 .loc 1 297 1 view .LVU65 244 0052 F0BD pop {r4, r5, r6, r7, pc} 245 .LVL25: 246 .L14: 247 .LBB9: 248 .LBB6: 282:deps//simpleserial/simpleserial.c **** else 249 .loc 1 282 4 is_stmt 1 view .LVU66 282:deps//simpleserial/simpleserial.c **** else 250 .loc 1 282 29 is_stmt 0 view .LVU67 251 0054 573C subs r4, r4, #87 252 .LVL26: 282:deps//simpleserial/simpleserial.c **** else 253 .loc 1 282 29 view .LVU68 254 0056 F5E7 b .L21 255 .LVL27: 256 .L16: 288:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - 'A' + 10) << 4; 257 .loc 1 288 8 is_stmt 1 view .LVU69 288:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - 'A' + 10) << 4; 258 .loc 1 288 10 is_stmt 0 view .LVU70 259 0058 A3F14104 sub r4, r3, #65 260 005c 052C cmp r4, #5 261 005e 02D8 bhi .L18 289:deps//simpleserial/simpleserial.c **** else if(n_hi >= 'a' && n_hi <= 'f') 262 .loc 1 289 4 is_stmt 1 view .LVU71 289:deps//simpleserial/simpleserial.c **** else if(n_hi >= 'a' && n_hi <= 'f') 263 .loc 1 289 31 is_stmt 0 view .LVU72 264 0060 A3F13704 sub r4, r3, #55 265 0064 E2E7 b .L23 266 .L18: 290:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - 'a' + 10) << 4; 267 .loc 1 290 8 is_stmt 1 view .LVU73 290:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - 'a' + 10) << 4; 268 .loc 1 290 10 is_stmt 0 view .LVU74 269 0066 A3F16104 sub r4, r3, #97 270 006a 052C cmp r4, #5 271 006c F0D8 bhi .L19 291:deps//simpleserial/simpleserial.c **** else 272 .loc 1 291 4 is_stmt 1 view .LVU75 291:deps//simpleserial/simpleserial.c **** else 273 .loc 1 291 16 is_stmt 0 view .LVU76 274 006e 1478 ldrb r4, [r2] @ zero_extendqisi2 291:deps//simpleserial/simpleserial.c **** else 275 .loc 1 291 31 view .LVU77 276 0070 573B subs r3, r3, #87 277 .LVL28: 291:deps//simpleserial/simpleserial.c **** else 278 .loc 1 291 16 view .LVU78 279 0072 44EA0313 orr r3, r4, r3, lsl #4 280 .LVL29: 291:deps//simpleserial/simpleserial.c **** else 281 .loc 1 291 16 view .LVU79 282 0076 DCE7 b .L22 283 .LBE6: 284 .LBE9: 285 .cfi_endproc 286 .LFE4: 288 .section .text.simpleserial_addcmd_flags,"ax",%progbits 289 .align 1 290 .global simpleserial_addcmd_flags 291 .syntax unified 292 .thumb 293 .thumb_func 294 .fpu softvfp 296 simpleserial_addcmd_flags: 297 .LVL30: 298 .LFB7: 298:deps//simpleserial/simpleserial.c **** 299:deps//simpleserial/simpleserial.c **** 300:deps//simpleserial/simpleserial.c **** 301:deps//simpleserial/simpleserial.c **** // Set up the SimpleSerial module by preparing internal commands 302:deps//simpleserial/simpleserial.c **** // This just adds the "v" command for now... 303:deps//simpleserial/simpleserial.c **** void simpleserial_init() 304:deps//simpleserial/simpleserial.c **** { 305:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('v', 0, check_version); 306:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('w', 0, ss_get_commands); 307:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('y', 0, ss_num_commands); 308:deps//simpleserial/simpleserial.c **** } 309:deps//simpleserial/simpleserial.c **** 310:deps//simpleserial/simpleserial.c **** int simpleserial_addcmd(char c, unsigned int len, uint8_t (*fp)(uint8_t*, uint8_t)) 311:deps//simpleserial/simpleserial.c **** { 312:deps//simpleserial/simpleserial.c **** return simpleserial_addcmd_flags(c, len, fp, CMD_FLAG_NONE); 313:deps//simpleserial/simpleserial.c **** } 314:deps//simpleserial/simpleserial.c **** 315:deps//simpleserial/simpleserial.c **** int simpleserial_addcmd_flags(char c, unsigned int len, uint8_t (*fp)(uint8_t*, uint8_t), uint8_t f 316:deps//simpleserial/simpleserial.c **** { 299 .loc 1 316 1 is_stmt 1 view -0 300 .cfi_startproc 301 @ args = 0, pretend = 0, frame = 0 302 @ frame_needed = 0, uses_anonymous_args = 0 317:deps//simpleserial/simpleserial.c **** if(num_commands >= MAX_SS_CMDS) 303 .loc 1 317 2 view .LVU81 316:deps//simpleserial/simpleserial.c **** if(num_commands >= MAX_SS_CMDS) 304 .loc 1 316 1 is_stmt 0 view .LVU82 305 0000 70B5 push {r4, r5, r6, lr} 306 .LCFI2: 307 .cfi_def_cfa_offset 16 308 .cfi_offset 4, -16 309 .cfi_offset 5, -12 310 .cfi_offset 6, -8 311 .cfi_offset 14, -4 312 .loc 1 317 18 view .LVU83 313 0002 094E ldr r6, .L28 314 0004 3468 ldr r4, [r6] 315 .loc 1 317 4 view .LVU84 316 0006 0F2C cmp r4, #15 317 0008 0BDC bgt .L27 318:deps//simpleserial/simpleserial.c **** return 1; 319:deps//simpleserial/simpleserial.c **** 320:deps//simpleserial/simpleserial.c **** if(len >= MAX_SS_LEN) 318 .loc 1 320 2 is_stmt 1 view .LVU85 319 .loc 1 320 4 is_stmt 0 view .LVU86 320 000a BF29 cmp r1, #191 321 000c 09D8 bhi .L27 321:deps//simpleserial/simpleserial.c **** return 1; 322:deps//simpleserial/simpleserial.c **** 323:deps//simpleserial/simpleserial.c **** commands[num_commands].c = c; 322 .loc 1 323 2 is_stmt 1 view .LVU87 323 .loc 1 323 29 is_stmt 0 view .LVU88 324 000e 06EB0415 add r5, r6, r4, lsl #4 324:deps//simpleserial/simpleserial.c **** commands[num_commands].len = len; 325:deps//simpleserial/simpleserial.c **** commands[num_commands].fp = fp; 325 .loc 1 325 29 view .LVU89 326 0012 C5E90212 strd r1, r2, [r5, #8] 326:deps//simpleserial/simpleserial.c **** commands[num_commands].flags = fl; 327:deps//simpleserial/simpleserial.c **** num_commands++; 327 .loc 1 327 14 view .LVU90 328 0016 0134 adds r4, r4, #1 323:deps//simpleserial/simpleserial.c **** commands[num_commands].len = len; 329 .loc 1 323 29 view .LVU91 330 0018 2871 strb r0, [r5, #4] 324:deps//simpleserial/simpleserial.c **** commands[num_commands].len = len; 331 .loc 1 324 2 is_stmt 1 view .LVU92 326:deps//simpleserial/simpleserial.c **** commands[num_commands].flags = fl; 332 .loc 1 326 2 view .LVU93 326:deps//simpleserial/simpleserial.c **** commands[num_commands].flags = fl; 333 .loc 1 326 31 is_stmt 0 view .LVU94 334 001a 2B74 strb r3, [r5, #16] 335 .loc 1 327 2 is_stmt 1 view .LVU95 336 .loc 1 327 14 is_stmt 0 view .LVU96 337 001c 3460 str r4, [r6] 328:deps//simpleserial/simpleserial.c **** 329:deps//simpleserial/simpleserial.c **** return 0; 338 .loc 1 329 2 is_stmt 1 view .LVU97 339 .loc 1 329 9 is_stmt 0 view .LVU98 340 001e 0020 movs r0, #0 341 .LVL31: 342 .L24: 330:deps//simpleserial/simpleserial.c **** } 343 .loc 1 330 1 view .LVU99 344 0020 70BD pop {r4, r5, r6, pc} 345 .LVL32: 346 .L27: 318:deps//simpleserial/simpleserial.c **** 347 .loc 1 318 10 view .LVU100 348 0022 0120 movs r0, #1 349 .LVL33: 318:deps//simpleserial/simpleserial.c **** 350 .loc 1 318 10 view .LVU101 351 0024 FCE7 b .L24 352 .L29: 353 0026 00BF .align 2 354 .L28: 355 0028 00000000 .word .LANCHOR0 356 .cfi_endproc 357 .LFE7: 359 .section .text.simpleserial_addcmd,"ax",%progbits 360 .align 1 361 .global simpleserial_addcmd 362 .syntax unified 363 .thumb 364 .thumb_func 365 .fpu softvfp 367 simpleserial_addcmd: 368 .LVL34: 369 .LFB6: 311:deps//simpleserial/simpleserial.c **** return simpleserial_addcmd_flags(c, len, fp, CMD_FLAG_NONE); 370 .loc 1 311 1 is_stmt 1 view -0 371 .cfi_startproc 372 @ args = 0, pretend = 0, frame = 0 373 @ frame_needed = 0, uses_anonymous_args = 0 374 @ link register save eliminated. 312:deps//simpleserial/simpleserial.c **** } 375 .loc 1 312 2 view .LVU103 312:deps//simpleserial/simpleserial.c **** } 376 .loc 1 312 9 is_stmt 0 view .LVU104 377 0000 0023 movs r3, #0 378 0002 FFF7FEBF b simpleserial_addcmd_flags 379 .LVL35: 312:deps//simpleserial/simpleserial.c **** } 380 .loc 1 312 9 view .LVU105 381 .cfi_endproc 382 .LFE6: 384 .section .text.simpleserial_init,"ax",%progbits 385 .align 1 386 .global simpleserial_init 387 .syntax unified 388 .thumb 389 .thumb_func 390 .fpu softvfp 392 simpleserial_init: 393 .LFB5: 304:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('v', 0, check_version); 394 .loc 1 304 1 is_stmt 1 view -0 395 .cfi_startproc 396 @ args = 0, pretend = 0, frame = 0 397 @ frame_needed = 0, uses_anonymous_args = 0 305:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('w', 0, ss_get_commands); 398 .loc 1 305 2 view .LVU107 304:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('v', 0, check_version); 399 .loc 1 304 1 is_stmt 0 view .LVU108 400 0000 08B5 push {r3, lr} 401 .LCFI3: 402 .cfi_def_cfa_offset 8 403 .cfi_offset 3, -8 404 .cfi_offset 14, -4 305:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('w', 0, ss_get_commands); 405 .loc 1 305 2 view .LVU109 406 0002 074A ldr r2, .L32 407 0004 0021 movs r1, #0 408 0006 7620 movs r0, #118 409 0008 FFF7FEFF bl simpleserial_addcmd 410 .LVL36: 306:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('y', 0, ss_num_commands); 411 .loc 1 306 5 is_stmt 1 view .LVU110 412 000c 054A ldr r2, .L32+4 413 000e 7720 movs r0, #119 414 0010 FFF7FEFF bl simpleserial_addcmd 415 .LVL37: 307:deps//simpleserial/simpleserial.c **** } 416 .loc 1 307 5 view .LVU111 308:deps//simpleserial/simpleserial.c **** 417 .loc 1 308 1 is_stmt 0 view .LVU112 418 0014 BDE80840 pop {r3, lr} 419 .LCFI4: 420 .cfi_restore 14 421 .cfi_restore 3 422 .cfi_def_cfa_offset 0 307:deps//simpleserial/simpleserial.c **** } 423 .loc 1 307 5 view .LVU113 424 0018 034A ldr r2, .L32+8 425 001a 7920 movs r0, #121 426 001c FFF7FEBF b simpleserial_addcmd 427 .LVL38: 428 .L33: 429 .align 2 430 .L32: 431 0020 00000000 .word check_version 432 0024 00000000 .word ss_get_commands 433 0028 00000000 .word ss_num_commands 434 .cfi_endproc 435 .LFE5: 437 .section .text.simpleserial_put,"ax",%progbits 438 .align 1 439 .global simpleserial_put 440 .syntax unified 441 .thumb 442 .thumb_func 443 .fpu softvfp 445 simpleserial_put: 446 .LVL39: 447 .LFB9: 331:deps//simpleserial/simpleserial.c **** 332:deps//simpleserial/simpleserial.c **** void simpleserial_get(void) 333:deps//simpleserial/simpleserial.c **** { 334:deps//simpleserial/simpleserial.c **** char ascii_buf[2*MAX_SS_LEN]; 335:deps//simpleserial/simpleserial.c **** uint8_t data_buf[MAX_SS_LEN]; 336:deps//simpleserial/simpleserial.c **** char c; 337:deps//simpleserial/simpleserial.c **** 338:deps//simpleserial/simpleserial.c **** // Find which command we're receiving 339:deps//simpleserial/simpleserial.c **** c = getch(); 340:deps//simpleserial/simpleserial.c **** 341:deps//simpleserial/simpleserial.c **** int cmd; 342:deps//simpleserial/simpleserial.c **** for(cmd = 0; cmd < num_commands; cmd++) 343:deps//simpleserial/simpleserial.c **** { 344:deps//simpleserial/simpleserial.c **** if(commands[cmd].c == c) 345:deps//simpleserial/simpleserial.c **** break; 346:deps//simpleserial/simpleserial.c **** } 347:deps//simpleserial/simpleserial.c **** 348:deps//simpleserial/simpleserial.c **** // If we didn't find a match, give up right away 349:deps//simpleserial/simpleserial.c **** if(cmd == num_commands) 350:deps//simpleserial/simpleserial.c **** return; 351:deps//simpleserial/simpleserial.c **** 352:deps//simpleserial/simpleserial.c **** // If flag CMD_FLAG_LEN is set, the next byte indicates the sent length 353:deps//simpleserial/simpleserial.c **** if ((commands[cmd].flags & CMD_FLAG_LEN) != 0) 354:deps//simpleserial/simpleserial.c **** { 355:deps//simpleserial/simpleserial.c **** uint8_t l = 0; 356:deps//simpleserial/simpleserial.c **** char buff[2]; 357:deps//simpleserial/simpleserial.c **** buff[0] = getch(); 358:deps//simpleserial/simpleserial.c **** buff[1] = getch(); 359:deps//simpleserial/simpleserial.c **** if (hex_decode(1, buff, &l)) 360:deps//simpleserial/simpleserial.c **** return; 361:deps//simpleserial/simpleserial.c **** commands[cmd].len = l; 362:deps//simpleserial/simpleserial.c **** } 363:deps//simpleserial/simpleserial.c **** 364:deps//simpleserial/simpleserial.c **** // Receive characters until we fill the ASCII buffer 365:deps//simpleserial/simpleserial.c **** for(int i = 0; i < 2*commands[cmd].len; i++) 366:deps//simpleserial/simpleserial.c **** { 367:deps//simpleserial/simpleserial.c **** c = getch(); 368:deps//simpleserial/simpleserial.c **** 369:deps//simpleserial/simpleserial.c **** // Check for early \n 370:deps//simpleserial/simpleserial.c **** if(c == '\n' || c == '\r') 371:deps//simpleserial/simpleserial.c **** return; 372:deps//simpleserial/simpleserial.c **** 373:deps//simpleserial/simpleserial.c **** ascii_buf[i] = c; 374:deps//simpleserial/simpleserial.c **** } 375:deps//simpleserial/simpleserial.c **** 376:deps//simpleserial/simpleserial.c **** // Assert that last character is \n or \r 377:deps//simpleserial/simpleserial.c **** c = getch(); 378:deps//simpleserial/simpleserial.c **** if(c != '\n' && c != '\r') 379:deps//simpleserial/simpleserial.c **** return; 380:deps//simpleserial/simpleserial.c **** 381:deps//simpleserial/simpleserial.c **** // ASCII buffer is full: convert to bytes 382:deps//simpleserial/simpleserial.c **** // Check for illegal characters here 383:deps//simpleserial/simpleserial.c **** if(hex_decode(commands[cmd].len, ascii_buf, data_buf)) 384:deps//simpleserial/simpleserial.c **** return; 385:deps//simpleserial/simpleserial.c **** 386:deps//simpleserial/simpleserial.c **** // Callback 387:deps//simpleserial/simpleserial.c **** uint8_t ret[1]; 388:deps//simpleserial/simpleserial.c **** ret[0] = commands[cmd].fp(data_buf, commands[cmd].len); 389:deps//simpleserial/simpleserial.c **** 390:deps//simpleserial/simpleserial.c **** // Acknowledge (if version is 1.1) 391:deps//simpleserial/simpleserial.c **** #if SS_VER == SS_VER_1_1 392:deps//simpleserial/simpleserial.c **** simpleserial_put('z', 1, ret); 393:deps//simpleserial/simpleserial.c **** #endif 394:deps//simpleserial/simpleserial.c **** } 395:deps//simpleserial/simpleserial.c **** 396:deps//simpleserial/simpleserial.c **** void simpleserial_put(char c, uint8_t size, uint8_t* output) 397:deps//simpleserial/simpleserial.c **** { 448 .loc 1 397 1 is_stmt 1 view -0 449 .cfi_startproc 450 @ args = 0, pretend = 0, frame = 0 451 @ frame_needed = 0, uses_anonymous_args = 0 398:deps//simpleserial/simpleserial.c **** // Write first character 399:deps//simpleserial/simpleserial.c **** putch(c); 452 .loc 1 399 2 view .LVU115 397:deps//simpleserial/simpleserial.c **** // Write first character 453 .loc 1 397 1 is_stmt 0 view .LVU116 454 0000 F8B5 push {r3, r4, r5, r6, r7, lr} 455 .LCFI5: 456 .cfi_def_cfa_offset 24 457 .cfi_offset 3, -24 458 .cfi_offset 4, -20 459 .cfi_offset 5, -16 460 .cfi_offset 6, -12 461 .cfi_offset 7, -8 462 .cfi_offset 14, -4 397:deps//simpleserial/simpleserial.c **** // Write first character 463 .loc 1 397 1 view .LVU117 464 0002 1446 mov r4, r2 465 0004 0E46 mov r6, r1 466 .loc 1 399 2 view .LVU118 467 0006 FFF7FEFF bl putch 468 .LVL40: 400:deps//simpleserial/simpleserial.c **** 401:deps//simpleserial/simpleserial.c **** // Write each byte as two nibbles 402:deps//simpleserial/simpleserial.c **** for(int i = 0; i < size; i++) 469 .loc 1 402 2 is_stmt 1 view .LVU119 470 .LBB10: 471 .loc 1 402 6 view .LVU120 403:deps//simpleserial/simpleserial.c **** { 404:deps//simpleserial/simpleserial.c **** putch(hex_lookup[output[i] >> 4 ]); 472 .loc 1 404 3 is_stmt 0 view .LVU121 473 000a 0C4F ldr r7, .L37 474 000c 651E subs r5, r4, #1 402:deps//simpleserial/simpleserial.c **** { 475 .loc 1 402 19 view .LVU122 476 000e C4F10104 rsb r4, r4, #1 477 .LVL41: 478 .L35: 402:deps//simpleserial/simpleserial.c **** { 479 .loc 1 402 19 is_stmt 1 discriminator 1 view .LVU123 480 0012 6319 adds r3, r4, r5 481 0014 9E42 cmp r6, r3 482 0016 04DC bgt .L36 483 .LBE10: 405:deps//simpleserial/simpleserial.c **** putch(hex_lookup[output[i] & 0xF]); 406:deps//simpleserial/simpleserial.c **** } 407:deps//simpleserial/simpleserial.c **** 408:deps//simpleserial/simpleserial.c **** // Write trailing '\n' 409:deps//simpleserial/simpleserial.c **** putch('\n'); 484 .loc 1 409 2 view .LVU124 410:deps//simpleserial/simpleserial.c **** } 485 .loc 1 410 1 is_stmt 0 view .LVU125 486 0018 BDE8F840 pop {r3, r4, r5, r6, r7, lr} 487 .LCFI6: 488 .cfi_remember_state 489 .cfi_restore 14 490 .cfi_restore 7 491 .cfi_restore 6 492 .cfi_restore 5 493 .cfi_restore 4 494 .cfi_restore 3 495 .cfi_def_cfa_offset 0 409:deps//simpleserial/simpleserial.c **** } 496 .loc 1 409 2 view .LVU126 497 001c 0A20 movs r0, #10 498 001e FFF7FEBF b putch 499 .LVL42: 500 .L36: 501 .LCFI7: 502 .cfi_restore_state 503 .LBB11: 404:deps//simpleserial/simpleserial.c **** putch(hex_lookup[output[i] & 0xF]); 504 .loc 1 404 3 is_stmt 1 discriminator 3 view .LVU127 404:deps//simpleserial/simpleserial.c **** putch(hex_lookup[output[i] & 0xF]); 505 .loc 1 404 30 is_stmt 0 discriminator 3 view .LVU128 506 0022 15F8013F ldrb r3, [r5, #1]! @ zero_extendqisi2 507 0026 1B09 lsrs r3, r3, #4 404:deps//simpleserial/simpleserial.c **** putch(hex_lookup[output[i] & 0xF]); 508 .loc 1 404 3 discriminator 3 view .LVU129 509 0028 F85C ldrb r0, [r7, r3] @ zero_extendqisi2 510 002a FFF7FEFF bl putch 511 .LVL43: 405:deps//simpleserial/simpleserial.c **** } 512 .loc 1 405 3 is_stmt 1 discriminator 3 view .LVU130 405:deps//simpleserial/simpleserial.c **** } 513 .loc 1 405 30 is_stmt 0 discriminator 3 view .LVU131 514 002e 2B78 ldrb r3, [r5] @ zero_extendqisi2 515 0030 03F00F03 and r3, r3, #15 405:deps//simpleserial/simpleserial.c **** } 516 .loc 1 405 3 discriminator 3 view .LVU132 517 0034 F85C ldrb r0, [r7, r3] @ zero_extendqisi2 518 0036 FFF7FEFF bl putch 519 .LVL44: 402:deps//simpleserial/simpleserial.c **** { 520 .loc 1 402 28 is_stmt 1 discriminator 3 view .LVU133 521 003a EAE7 b .L35 522 .L38: 523 .align 2 524 .L37: 525 003c 00000000 .word .LANCHOR1 526 .LBE11: 527 .cfi_endproc 528 .LFE9: 530 .section .text.ss_num_commands,"ax",%progbits 531 .align 1 532 .global ss_num_commands 533 .syntax unified 534 .thumb 535 .thumb_func 536 .fpu softvfp 538 ss_num_commands: 539 .LVL45: 540 .LFB2: 239:deps//simpleserial/simpleserial.c **** uint8_t ncmds = num_commands & 0xFF; 541 .loc 1 239 1 view -0 542 .cfi_startproc 543 @ args = 0, pretend = 0, frame = 8 544 @ frame_needed = 0, uses_anonymous_args = 0 240:deps//simpleserial/simpleserial.c **** simpleserial_put('r', 0x01, &ncmds); 545 .loc 1 240 5 view .LVU135 239:deps//simpleserial/simpleserial.c **** uint8_t ncmds = num_commands & 0xFF; 546 .loc 1 239 1 is_stmt 0 view .LVU136 547 0000 07B5 push {r0, r1, r2, lr} 548 .LCFI8: 549 .cfi_def_cfa_offset 16 550 .cfi_offset 14, -4 240:deps//simpleserial/simpleserial.c **** simpleserial_put('r', 0x01, &ncmds); 551 .loc 1 240 13 view .LVU137 552 0002 074B ldr r3, .L40 241:deps//simpleserial/simpleserial.c **** return 0x00; 553 .loc 1 241 5 view .LVU138 554 0004 0DF10702 add r2, sp, #7 240:deps//simpleserial/simpleserial.c **** simpleserial_put('r', 0x01, &ncmds); 555 .loc 1 240 13 view .LVU139 556 0008 1B68 ldr r3, [r3] 557 000a 8DF80730 strb r3, [sp, #7] 241:deps//simpleserial/simpleserial.c **** return 0x00; 558 .loc 1 241 5 is_stmt 1 view .LVU140 559 000e 0121 movs r1, #1 560 .LVL46: 241:deps//simpleserial/simpleserial.c **** return 0x00; 561 .loc 1 241 5 is_stmt 0 view .LVU141 562 0010 7220 movs r0, #114 563 .LVL47: 241:deps//simpleserial/simpleserial.c **** return 0x00; 564 .loc 1 241 5 view .LVU142 565 0012 FFF7FEFF bl simpleserial_put 566 .LVL48: 242:deps//simpleserial/simpleserial.c **** } 567 .loc 1 242 5 is_stmt 1 view .LVU143 243:deps//simpleserial/simpleserial.c **** 568 .loc 1 243 1 is_stmt 0 view .LVU144 569 0016 0020 movs r0, #0 570 0018 03B0 add sp, sp, #12 571 .LCFI9: 572 .cfi_def_cfa_offset 4 573 @ sp needed 574 001a 5DF804FB ldr pc, [sp], #4 575 .L41: 576 001e 00BF .align 2 577 .L40: 578 0020 00000000 .word .LANCHOR0 579 .cfi_endproc 580 .LFE2: 582 .section .text.ss_get_commands,"ax",%progbits 583 .align 1 584 .global ss_get_commands 585 .syntax unified 586 .thumb 587 .thumb_func 588 .fpu softvfp 590 ss_get_commands: 591 .LVL49: 592 .LFB3: 252:deps//simpleserial/simpleserial.c **** ss_cmd_repr repr_cmd_buf[MAX_SS_CMDS]; 593 .loc 1 252 1 is_stmt 1 view -0 594 .cfi_startproc 595 @ args = 0, pretend = 0, frame = 48 596 @ frame_needed = 0, uses_anonymous_args = 0 253:deps//simpleserial/simpleserial.c **** for (uint8_t i = 0; i < (num_commands & 0xFF); i++) { 597 .loc 1 253 5 view .LVU146 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c; 598 .loc 1 254 5 view .LVU147 599 .LBB12: 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c; 600 .loc 1 254 10 view .LVU148 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c; 601 .loc 1 254 10 is_stmt 0 view .LVU149 602 .LBE12: 252:deps//simpleserial/simpleserial.c **** ss_cmd_repr repr_cmd_buf[MAX_SS_CMDS]; 603 .loc 1 252 1 view .LVU150 604 0000 70B5 push {r4, r5, r6, lr} 605 .LCFI10: 606 .cfi_def_cfa_offset 16 607 .cfi_offset 4, -16 608 .cfi_offset 5, -12 609 .cfi_offset 6, -8 610 .cfi_offset 14, -4 611 .LBB13: 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c; 612 .loc 1 254 43 view .LVU151 613 0002 124C ldr r4, .L45 614 0004 2168 ldr r1, [r4] 615 .LVL50: 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c; 616 .loc 1 254 43 view .LVU152 617 .LBE13: 252:deps//simpleserial/simpleserial.c **** ss_cmd_repr repr_cmd_buf[MAX_SS_CMDS]; 618 .loc 1 252 1 view .LVU153 619 0006 8CB0 sub sp, sp, #48 620 .LCFI11: 621 .cfi_def_cfa_offset 64 622 .LBB14: 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c; 623 .loc 1 254 43 view .LVU154 624 0008 CDB2 uxtb r5, r1 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c; 625 .loc 1 254 5 view .LVU155 626 000a 0020 movs r0, #0 627 .LVL51: 628 .L43: 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c; 629 .loc 1 254 27 is_stmt 1 discriminator 1 view .LVU156 630 000c C3B2 uxtb r3, r0 631 000e AB42 cmp r3, r5 632 0010 00F10100 add r0, r0, #1 633 .LVL52: 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c; 634 .loc 1 254 27 is_stmt 0 discriminator 1 view .LVU157 635 0014 09DB blt .L44 636 .LBE14: 260:deps//simpleserial/simpleserial.c **** return 0x00; 637 .loc 1 260 5 is_stmt 1 view .LVU158 638 0016 01EB4101 add r1, r1, r1, lsl #1 639 001a 6A46 mov r2, sp 640 001c C9B2 uxtb r1, r1 641 001e 7220 movs r0, #114 642 0020 FFF7FEFF bl simpleserial_put 643 .LVL53: 261:deps//simpleserial/simpleserial.c **** } 644 .loc 1 261 5 view .LVU159 262:deps//simpleserial/simpleserial.c **** 645 .loc 1 262 1 is_stmt 0 view .LVU160 646 0024 0020 movs r0, #0 647 0026 0CB0 add sp, sp, #48 648 .LCFI12: 649 .cfi_remember_state 650 .cfi_def_cfa_offset 16 651 @ sp needed 652 0028 70BD pop {r4, r5, r6, pc} 653 .LVL54: 654 .L44: 655 .LCFI13: 656 .cfi_restore_state 657 .LBB15: 255:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].len = commands[i].len; 658 .loc 1 255 9 is_stmt 1 discriminator 3 view .LVU161 255:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].len = commands[i].len; 659 .loc 1 255 27 is_stmt 0 discriminator 3 view .LVU162 660 002a 03EB4302 add r2, r3, r3, lsl #1 661 002e 3032 adds r2, r2, #48 255:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].len = commands[i].len; 662 .loc 1 255 40 discriminator 3 view .LVU163 663 0030 04EB0313 add r3, r4, r3, lsl #4 664 .LVL55: 255:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].len = commands[i].len; 665 .loc 1 255 27 discriminator 3 view .LVU164 666 0034 6A44 add r2, sp, r2 667 0036 1E79 ldrb r6, [r3, #4] @ zero_extendqisi2 668 0038 02F8306C strb r6, [r2, #-48] 256:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].flags = commands[i].flags; 669 .loc 1 256 9 is_stmt 1 discriminator 3 view .LVU165 256:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].flags = commands[i].flags; 670 .loc 1 256 29 is_stmt 0 discriminator 3 view .LVU166 671 003c 9E68 ldr r6, [r3, #8] 257:deps//simpleserial/simpleserial.c **** } 672 .loc 1 257 31 discriminator 3 view .LVU167 673 003e 1B7C ldrb r3, [r3, #16] @ zero_extendqisi2 256:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].flags = commands[i].flags; 674 .loc 1 256 29 discriminator 3 view .LVU168 675 0040 02F82F6C strb r6, [r2, #-47] 257:deps//simpleserial/simpleserial.c **** } 676 .loc 1 257 9 is_stmt 1 discriminator 3 view .LVU169 257:deps//simpleserial/simpleserial.c **** } 677 .loc 1 257 31 is_stmt 0 discriminator 3 view .LVU170 678 0044 02F82E3C strb r3, [r2, #-46] 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c; 679 .loc 1 254 53 is_stmt 1 discriminator 3 view .LVU171 680 .LVL56: 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c; 681 .loc 1 254 53 is_stmt 0 discriminator 3 view .LVU172 682 0048 E0E7 b .L43 683 .L46: 684 004a 00BF .align 2 685 .L45: 686 004c 00000000 .word .LANCHOR0 687 .LBE15: 688 .cfi_endproc 689 .LFE3: 691 .section .text.simpleserial_get,"ax",%progbits 692 .align 1 693 .global simpleserial_get 694 .syntax unified 695 .thumb 696 .thumb_func 697 .fpu softvfp 699 simpleserial_get: 700 .LFB8: 333:deps//simpleserial/simpleserial.c **** char ascii_buf[2*MAX_SS_LEN]; 701 .loc 1 333 1 is_stmt 1 view -0 702 .cfi_startproc 703 @ args = 0, pretend = 0, frame = 584 704 @ frame_needed = 0, uses_anonymous_args = 0 334:deps//simpleserial/simpleserial.c **** uint8_t data_buf[MAX_SS_LEN]; 705 .loc 1 334 2 view .LVU174 335:deps//simpleserial/simpleserial.c **** char c; 706 .loc 1 335 2 view .LVU175 336:deps//simpleserial/simpleserial.c **** 707 .loc 1 336 2 view .LVU176 339:deps//simpleserial/simpleserial.c **** 708 .loc 1 339 2 view .LVU177 333:deps//simpleserial/simpleserial.c **** char ascii_buf[2*MAX_SS_LEN]; 709 .loc 1 333 1 is_stmt 0 view .LVU178 710 0000 2DE9F041 push {r4, r5, r6, r7, r8, lr} 711 .LCFI14: 712 .cfi_def_cfa_offset 24 713 .cfi_offset 4, -24 714 .cfi_offset 5, -20 715 .cfi_offset 6, -16 716 .cfi_offset 7, -12 717 .cfi_offset 8, -8 718 .cfi_offset 14, -4 342:deps//simpleserial/simpleserial.c **** { 719 .loc 1 342 19 view .LVU179 720 0004 2D4D ldr r5, .L71 333:deps//simpleserial/simpleserial.c **** char ascii_buf[2*MAX_SS_LEN]; 721 .loc 1 333 1 view .LVU180 722 0006 ADF5127D sub sp, sp, #584 723 .LCFI15: 724 .cfi_def_cfa_offset 608 339:deps//simpleserial/simpleserial.c **** 725 .loc 1 339 6 view .LVU181 726 000a FFF7FEFF bl getch 727 .LVL57: 341:deps//simpleserial/simpleserial.c **** for(cmd = 0; cmd < num_commands; cmd++) 728 .loc 1 341 2 is_stmt 1 view .LVU182 342:deps//simpleserial/simpleserial.c **** { 729 .loc 1 342 2 view .LVU183 342:deps//simpleserial/simpleserial.c **** { 730 .loc 1 342 19 is_stmt 0 view .LVU184 731 000e 2A46 mov r2, r5 342:deps//simpleserial/simpleserial.c **** { 732 .loc 1 342 10 view .LVU185 733 0010 0023 movs r3, #0 342:deps//simpleserial/simpleserial.c **** { 734 .loc 1 342 19 view .LVU186 735 0012 52F8041B ldr r1, [r2], #4 736 .LVL58: 737 .L48: 342:deps//simpleserial/simpleserial.c **** { 738 .loc 1 342 19 is_stmt 1 discriminator 1 view .LVU187 739 0016 9942 cmp r1, r3 740 0018 40DC bgt .L50 349:deps//simpleserial/simpleserial.c **** return; 741 .loc 1 349 2 view .LVU188 349:deps//simpleserial/simpleserial.c **** return; 742 .loc 1 349 4 is_stmt 0 view .LVU189 743 001a 3BD0 beq .L47 744 .L49: 353:deps//simpleserial/simpleserial.c **** { 745 .loc 1 353 2 is_stmt 1 view .LVU190 353:deps//simpleserial/simpleserial.c **** { 746 .loc 1 353 20 is_stmt 0 view .LVU191 747 001c 05EB0314 add r4, r5, r3, lsl #4 748 0020 1E01 lsls r6, r3, #4 353:deps//simpleserial/simpleserial.c **** { 749 .loc 1 353 5 view .LVU192 750 0022 237C ldrb r3, [r4, #16] @ zero_extendqisi2 751 .LVL59: 353:deps//simpleserial/simpleserial.c **** { 752 .loc 1 353 5 view .LVU193 753 0024 DB07 lsls r3, r3, #31 754 0026 13D5 bpl .L52 755 .LBB16: 355:deps//simpleserial/simpleserial.c **** char buff[2]; 756 .loc 1 355 3 is_stmt 1 view .LVU194 355:deps//simpleserial/simpleserial.c **** char buff[2]; 757 .loc 1 355 11 is_stmt 0 view .LVU195 758 0028 0023 movs r3, #0 759 002a 8DF80830 strb r3, [sp, #8] 356:deps//simpleserial/simpleserial.c **** buff[0] = getch(); 760 .loc 1 356 3 is_stmt 1 view .LVU196 357:deps//simpleserial/simpleserial.c **** buff[1] = getch(); 761 .loc 1 357 3 view .LVU197 357:deps//simpleserial/simpleserial.c **** buff[1] = getch(); 762 .loc 1 357 13 is_stmt 0 view .LVU198 763 002e FFF7FEFF bl getch 764 .LVL60: 357:deps//simpleserial/simpleserial.c **** buff[1] = getch(); 765 .loc 1 357 11 view .LVU199 766 0032 8DF8C800 strb r0, [sp, #200] 358:deps//simpleserial/simpleserial.c **** if (hex_decode(1, buff, &l)) 767 .loc 1 358 3 is_stmt 1 view .LVU200 358:deps//simpleserial/simpleserial.c **** if (hex_decode(1, buff, &l)) 768 .loc 1 358 13 is_stmt 0 view .LVU201 769 0036 FFF7FEFF bl getch 770 .LVL61: 359:deps//simpleserial/simpleserial.c **** return; 771 .loc 1 359 7 view .LVU202 772 003a 02AA add r2, sp, #8 358:deps//simpleserial/simpleserial.c **** if (hex_decode(1, buff, &l)) 773 .loc 1 358 11 view .LVU203 774 003c 8DF8C900 strb r0, [sp, #201] 359:deps//simpleserial/simpleserial.c **** return; 775 .loc 1 359 3 is_stmt 1 view .LVU204 359:deps//simpleserial/simpleserial.c **** return; 776 .loc 1 359 7 is_stmt 0 view .LVU205 777 0040 32A9 add r1, sp, #200 778 0042 0120 movs r0, #1 779 0044 FFF7FEFF bl hex_decode 780 .LVL62: 359:deps//simpleserial/simpleserial.c **** return; 781 .loc 1 359 6 view .LVU206 782 0048 20BB cbnz r0, .L47 361:deps//simpleserial/simpleserial.c **** } 783 .loc 1 361 3 is_stmt 1 view .LVU207 361:deps//simpleserial/simpleserial.c **** } 784 .loc 1 361 21 is_stmt 0 view .LVU208 785 004a 9DF80830 ldrb r3, [sp, #8] @ zero_extendqisi2 786 004e A360 str r3, [r4, #8] 787 .L52: 788 0050 32AF add r7, sp, #200 789 .LBE16: 342:deps//simpleserial/simpleserial.c **** { 790 .loc 1 342 10 discriminator 1 view .LVU209 791 0052 0024 movs r4, #0 792 .LBB17: 365:deps//simpleserial/simpleserial.c **** { 793 .loc 1 365 36 discriminator 1 view .LVU210 794 0054 05EB0608 add r8, r5, r6 795 .L55: 796 .LVL63: 365:deps//simpleserial/simpleserial.c **** { 797 .loc 1 365 19 is_stmt 1 discriminator 1 view .LVU211 365:deps//simpleserial/simpleserial.c **** { 798 .loc 1 365 22 is_stmt 0 discriminator 1 view .LVU212 799 0058 D8F80830 ldr r3, [r8, #8] 365:deps//simpleserial/simpleserial.c **** { 800 .loc 1 365 19 discriminator 1 view .LVU213 801 005c B4EB430F cmp r4, r3, lsl #1 802 0060 22D3 bcc .L56 803 .LBE17: 377:deps//simpleserial/simpleserial.c **** if(c != '\n' && c != '\r') 804 .loc 1 377 2 is_stmt 1 view .LVU214 377:deps//simpleserial/simpleserial.c **** if(c != '\n' && c != '\r') 805 .loc 1 377 6 is_stmt 0 view .LVU215 806 0062 FFF7FEFF bl getch 807 .LVL64: 378:deps//simpleserial/simpleserial.c **** return; 808 .loc 1 378 2 is_stmt 1 view .LVU216 378:deps//simpleserial/simpleserial.c **** return; 809 .loc 1 378 4 is_stmt 0 view .LVU217 810 0066 0A28 cmp r0, #10 811 0068 01D0 beq .L57 378:deps//simpleserial/simpleserial.c **** return; 812 .loc 1 378 15 discriminator 1 view .LVU218 813 006a 0D28 cmp r0, #13 814 006c 12D1 bne .L47 815 .L57: 383:deps//simpleserial/simpleserial.c **** return; 816 .loc 1 383 2 is_stmt 1 view .LVU219 383:deps//simpleserial/simpleserial.c **** return; 817 .loc 1 383 29 is_stmt 0 view .LVU220 818 006e 3544 add r5, r5, r6 383:deps//simpleserial/simpleserial.c **** return; 819 .loc 1 383 5 view .LVU221 820 0070 02AA add r2, sp, #8 383:deps//simpleserial/simpleserial.c **** return; 821 .loc 1 383 29 view .LVU222 822 0072 AC68 ldr r4, [r5, #8] 823 .LVL65: 383:deps//simpleserial/simpleserial.c **** return; 824 .loc 1 383 5 view .LVU223 825 0074 32A9 add r1, sp, #200 826 0076 2046 mov r0, r4 827 .LVL66: 383:deps//simpleserial/simpleserial.c **** return; 828 .loc 1 383 5 view .LVU224 829 0078 FFF7FEFF bl hex_decode 830 .LVL67: 383:deps//simpleserial/simpleserial.c **** return; 831 .loc 1 383 4 view .LVU225 832 007c 50B9 cbnz r0, .L47 387:deps//simpleserial/simpleserial.c **** ret[0] = commands[cmd].fp(data_buf, commands[cmd].len); 833 .loc 1 387 2 is_stmt 1 view .LVU226 388:deps//simpleserial/simpleserial.c **** 834 .loc 1 388 2 view .LVU227 388:deps//simpleserial/simpleserial.c **** 835 .loc 1 388 11 is_stmt 0 view .LVU228 836 007e E1B2 uxtb r1, r4 837 0080 EB68 ldr r3, [r5, #12] 838 0082 02A8 add r0, sp, #8 839 0084 9847 blx r3 840 .LVL68: 392:deps//simpleserial/simpleserial.c **** #endif 841 .loc 1 392 2 view .LVU229 842 0086 01AA add r2, sp, #4 388:deps//simpleserial/simpleserial.c **** 843 .loc 1 388 9 view .LVU230 844 0088 8DF80400 strb r0, [sp, #4] 392:deps//simpleserial/simpleserial.c **** #endif 845 .loc 1 392 2 is_stmt 1 view .LVU231 846 008c 0121 movs r1, #1 847 008e 7A20 movs r0, #122 848 0090 FFF7FEFF bl simpleserial_put 849 .LVL69: 850 .L47: 394:deps//simpleserial/simpleserial.c **** 851 .loc 1 394 1 is_stmt 0 view .LVU232 852 0094 0DF5127D add sp, sp, #584 853 .LCFI16: 854 .cfi_remember_state 855 .cfi_def_cfa_offset 24 856 @ sp needed 857 0098 BDE8F081 pop {r4, r5, r6, r7, r8, pc} 858 .LVL70: 859 .L50: 860 .LCFI17: 861 .cfi_restore_state 344:deps//simpleserial/simpleserial.c **** break; 862 .loc 1 344 3 is_stmt 1 view .LVU233 344:deps//simpleserial/simpleserial.c **** break; 863 .loc 1 344 19 is_stmt 0 view .LVU234 864 009c 1C01 lsls r4, r3, #4 344:deps//simpleserial/simpleserial.c **** break; 865 .loc 1 344 5 view .LVU235 866 009e A45C ldrb r4, [r4, r2] @ zero_extendqisi2 867 00a0 8442 cmp r4, r0 868 00a2 BBD0 beq .L49 342:deps//simpleserial/simpleserial.c **** { 869 .loc 1 342 38 is_stmt 1 discriminator 2 view .LVU236 870 00a4 0133 adds r3, r3, #1 871 .LVL71: 342:deps//simpleserial/simpleserial.c **** { 872 .loc 1 342 38 is_stmt 0 discriminator 2 view .LVU237 873 00a6 B6E7 b .L48 874 .LVL72: 875 .L56: 876 .LBB18: 367:deps//simpleserial/simpleserial.c **** 877 .loc 1 367 3 is_stmt 1 view .LVU238 367:deps//simpleserial/simpleserial.c **** 878 .loc 1 367 7 is_stmt 0 view .LVU239 879 00a8 FFF7FEFF bl getch 880 .LVL73: 370:deps//simpleserial/simpleserial.c **** return; 881 .loc 1 370 3 is_stmt 1 view .LVU240 370:deps//simpleserial/simpleserial.c **** return; 882 .loc 1 370 5 is_stmt 0 view .LVU241 883 00ac 0A28 cmp r0, #10 884 00ae F1D0 beq .L47 370:deps//simpleserial/simpleserial.c **** return; 885 .loc 1 370 16 discriminator 1 view .LVU242 886 00b0 0D28 cmp r0, #13 887 00b2 EFD0 beq .L47 373:deps//simpleserial/simpleserial.c **** } 888 .loc 1 373 3 is_stmt 1 discriminator 2 view .LVU243 373:deps//simpleserial/simpleserial.c **** } 889 .loc 1 373 16 is_stmt 0 discriminator 2 view .LVU244 890 00b4 07F8010B strb r0, [r7], #1 365:deps//simpleserial/simpleserial.c **** { 891 .loc 1 365 43 is_stmt 1 discriminator 2 view .LVU245 892 00b8 0134 adds r4, r4, #1 893 .LVL74: 365:deps//simpleserial/simpleserial.c **** { 894 .loc 1 365 43 is_stmt 0 discriminator 2 view .LVU246 895 00ba CDE7 b .L55 896 .L72: 897 .align 2 898 .L71: 899 00bc 00000000 .word .LANCHOR0 900 .LBE18: 901 .cfi_endproc 902 .LFE8: 904 .section .rodata 905 .set .LANCHOR1,. + 0 908 hex_lookup: 909 0000 30313233 .ascii "0123456789ABCDEF" 909 34353637 909 38394142 909 43444546 910 .bss 911 .align 2 912 .set .LANCHOR0,. + 0 915 num_commands: 916 0000 00000000 .space 4 919 commands: 920 0004 00000000 .space 256 920 00000000 920 00000000 920 00000000 920 00000000 921 .text 922 .Letext0: 923 .file 2 "/usr/arm-none-eabi/include/machine/_default_types.h" 924 .file 3 "/usr/arm-none-eabi/include/sys/_stdint.h" 925 .file 4 "deps//hal/stm32f3/stm32f3_hal.h" DEFINED SYMBOLS *ABS*:0000000000000000 simpleserial.c /tmp/ccZxLcuP.s:16 .text.check_version:0000000000000000 $t /tmp/ccZxLcuP.s:24 .text.check_version:0000000000000000 check_version /tmp/ccZxLcuP.s:43 .text.ss_crc:0000000000000000 $t /tmp/ccZxLcuP.s:50 .text.ss_crc:0000000000000000 ss_crc /tmp/ccZxLcuP.s:116 .text.hex_decode:0000000000000000 $t /tmp/ccZxLcuP.s:123 .text.hex_decode:0000000000000000 hex_decode /tmp/ccZxLcuP.s:289 .text.simpleserial_addcmd_flags:0000000000000000 $t /tmp/ccZxLcuP.s:296 .text.simpleserial_addcmd_flags:0000000000000000 simpleserial_addcmd_flags /tmp/ccZxLcuP.s:355 .text.simpleserial_addcmd_flags:0000000000000028 $d /tmp/ccZxLcuP.s:360 .text.simpleserial_addcmd:0000000000000000 $t /tmp/ccZxLcuP.s:367 .text.simpleserial_addcmd:0000000000000000 simpleserial_addcmd /tmp/ccZxLcuP.s:385 .text.simpleserial_init:0000000000000000 $t /tmp/ccZxLcuP.s:392 .text.simpleserial_init:0000000000000000 simpleserial_init /tmp/ccZxLcuP.s:431 .text.simpleserial_init:0000000000000020 $d /tmp/ccZxLcuP.s:590 .text.ss_get_commands:0000000000000000 ss_get_commands /tmp/ccZxLcuP.s:538 .text.ss_num_commands:0000000000000000 ss_num_commands /tmp/ccZxLcuP.s:438 .text.simpleserial_put:0000000000000000 $t /tmp/ccZxLcuP.s:445 .text.simpleserial_put:0000000000000000 simpleserial_put /tmp/ccZxLcuP.s:525 .text.simpleserial_put:000000000000003c $d /tmp/ccZxLcuP.s:531 .text.ss_num_commands:0000000000000000 $t /tmp/ccZxLcuP.s:578 .text.ss_num_commands:0000000000000020 $d /tmp/ccZxLcuP.s:583 .text.ss_get_commands:0000000000000000 $t /tmp/ccZxLcuP.s:686 .text.ss_get_commands:000000000000004c $d /tmp/ccZxLcuP.s:692 .text.simpleserial_get:0000000000000000 $t /tmp/ccZxLcuP.s:699 .text.simpleserial_get:0000000000000000 simpleserial_get /tmp/ccZxLcuP.s:899 .text.simpleserial_get:00000000000000bc $d /tmp/ccZxLcuP.s:908 .rodata:0000000000000000 hex_lookup /tmp/ccZxLcuP.s:911 .bss:0000000000000000 $d /tmp/ccZxLcuP.s:915 .bss:0000000000000000 num_commands /tmp/ccZxLcuP.s:919 .bss:0000000000000004 commands UNDEFINED SYMBOLS putch getch