simpleserial.lst 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562
  1. 1 .cpu cortex-m4
  2. 2 .eabi_attribute 20, 1
  3. 3 .eabi_attribute 21, 1
  4. 4 .eabi_attribute 23, 3
  5. 5 .eabi_attribute 24, 1
  6. 6 .eabi_attribute 25, 1
  7. 7 .eabi_attribute 26, 1
  8. 8 .eabi_attribute 30, 4
  9. 9 .eabi_attribute 34, 1
  10. 10 .eabi_attribute 18, 4
  11. 11 .file "simpleserial.c"
  12. 12 .text
  13. 13 .Ltext0:
  14. 14 .cfi_sections .debug_frame
  15. 15 .section .text.check_version,"ax",%progbits
  16. 16 .align 1
  17. 17 .global check_version
  18. 18 .arch armv7e-m
  19. 19 .syntax unified
  20. 20 .thumb
  21. 21 .thumb_func
  22. 22 .fpu softvfp
  23. 24 check_version:
  24. 25 .LVL0:
  25. 26 .LFB1:
  26. 27 .file 1 "deps//simpleserial/simpleserial.c"
  27. 1:deps//simpleserial/simpleserial.c **** // simpleserial.c
  28. 2:deps//simpleserial/simpleserial.c ****
  29. 3:deps//simpleserial/simpleserial.c **** #include "simpleserial.h"
  30. 4:deps//simpleserial/simpleserial.c **** #include <stdint.h>
  31. 5:deps//simpleserial/simpleserial.c **** #include "hal.h"
  32. 6:deps//simpleserial/simpleserial.c ****
  33. 7:deps//simpleserial/simpleserial.c ****
  34. 8:deps//simpleserial/simpleserial.c **** #define MAX_SS_CMDS 16
  35. 9:deps//simpleserial/simpleserial.c **** static int num_commands = 0;
  36. 10:deps//simpleserial/simpleserial.c ****
  37. 11:deps//simpleserial/simpleserial.c **** #define MAX_SS_LEN 192
  38. 12:deps//simpleserial/simpleserial.c ****
  39. 13:deps//simpleserial/simpleserial.c **** //#define SS_VER_1_0 0
  40. 14:deps//simpleserial/simpleserial.c **** //#define SS_VER_1_1 1
  41. 15:deps//simpleserial/simpleserial.c **** //#define SS_VER_2_0 2
  42. 16:deps//simpleserial/simpleserial.c ****
  43. 17:deps//simpleserial/simpleserial.c ****
  44. 18:deps//simpleserial/simpleserial.c **** // 0xA6 formerly
  45. 19:deps//simpleserial/simpleserial.c **** #define CW_CRC 0x4D
  46. 20:deps//simpleserial/simpleserial.c **** uint8_t ss_crc(uint8_t *buf, uint8_t len)
  47. 21:deps//simpleserial/simpleserial.c **** {
  48. 22:deps//simpleserial/simpleserial.c **** unsigned int k = 0;
  49. 23:deps//simpleserial/simpleserial.c **** uint8_t crc = 0x00;
  50. 24:deps//simpleserial/simpleserial.c **** while (len--) {
  51. 25:deps//simpleserial/simpleserial.c **** crc ^= *buf++;
  52. 26:deps//simpleserial/simpleserial.c **** for (k = 0; k < 8; k++) {
  53. 27:deps//simpleserial/simpleserial.c **** crc = crc & 0x80 ? (crc << 1) ^ CW_CRC: crc << 1;
  54. 28:deps//simpleserial/simpleserial.c **** }
  55. 29:deps//simpleserial/simpleserial.c **** }
  56. 30:deps//simpleserial/simpleserial.c **** return crc;
  57. 31:deps//simpleserial/simpleserial.c ****
  58. 32:deps//simpleserial/simpleserial.c **** }
  59. 33:deps//simpleserial/simpleserial.c ****
  60. 34:deps//simpleserial/simpleserial.c **** // [B_STUFF, CMD, SCMD, LEN, B_STUFF, DATA..., CRC, TERM]
  61. 35:deps//simpleserial/simpleserial.c ****
  62. 36:deps//simpleserial/simpleserial.c **** //#define SS_VER SS_VER_2_0
  63. 37:deps//simpleserial/simpleserial.c **** #if SS_VER == SS_VER_2_0
  64. 38:deps//simpleserial/simpleserial.c **** #error "SS_VER_2_0 is deprecated! Use SS_VER_2_1 instead."
  65. 39:deps//simpleserial/simpleserial.c **** #elif SS_VER == SS_VER_2_1
  66. 40:deps//simpleserial/simpleserial.c ****
  67. 41:deps//simpleserial/simpleserial.c ****
  68. 42:deps//simpleserial/simpleserial.c **** typedef struct ss_cmd
  69. 43:deps//simpleserial/simpleserial.c **** {
  70. 44:deps//simpleserial/simpleserial.c **** char c;
  71. 45:deps//simpleserial/simpleserial.c **** unsigned int len;
  72. 46:deps//simpleserial/simpleserial.c **** uint8_t (*fp)(uint8_t, uint8_t, uint8_t, uint8_t *);
  73. 47:deps//simpleserial/simpleserial.c **** } ss_cmd;
  74. 48:deps//simpleserial/simpleserial.c **** static ss_cmd commands[MAX_SS_CMDS];
  75. 49:deps//simpleserial/simpleserial.c ****
  76. 50:deps//simpleserial/simpleserial.c **** void ss_puts(char *x)
  77. 51:deps//simpleserial/simpleserial.c **** {
  78. 52:deps//simpleserial/simpleserial.c **** do {
  79. 53:deps//simpleserial/simpleserial.c **** putch(*x);
  80. 54:deps//simpleserial/simpleserial.c **** } while (*++x);
  81. 55:deps//simpleserial/simpleserial.c **** }
  82. 56:deps//simpleserial/simpleserial.c ****
  83. 57:deps//simpleserial/simpleserial.c **** #define FRAME_BYTE 0x00
  84. 58:deps//simpleserial/simpleserial.c ****
  85. 59:deps//simpleserial/simpleserial.c **** uint8_t check_version(uint8_t cmd, uint8_t scmd, uint8_t len, uint8_t *data)
  86. 60:deps//simpleserial/simpleserial.c **** {
  87. 61:deps//simpleserial/simpleserial.c **** uint8_t ver = SS_VER;
  88. 62:deps//simpleserial/simpleserial.c **** simpleserial_put('r', 1, &ver);
  89. 63:deps//simpleserial/simpleserial.c **** return SS_ERR_OK;
  90. 64:deps//simpleserial/simpleserial.c **** }
  91. 65:deps//simpleserial/simpleserial.c ****
  92. 66:deps//simpleserial/simpleserial.c **** uint8_t ss_get_commands(uint8_t cmd, uint8_t scmd, uint8_t len, uint8_t *data)
  93. 67:deps//simpleserial/simpleserial.c **** {
  94. 68:deps//simpleserial/simpleserial.c **** uint8_t cmd_chars[MAX_SS_CMDS];
  95. 69:deps//simpleserial/simpleserial.c **** for (uint8_t i = 0; i < (num_commands & 0xFF); i++) {
  96. 70:deps//simpleserial/simpleserial.c **** cmd_chars[i] = commands[i].c;
  97. 71:deps//simpleserial/simpleserial.c **** }
  98. 72:deps//simpleserial/simpleserial.c ****
  99. 73:deps//simpleserial/simpleserial.c **** simpleserial_put('r', num_commands & 0xFF, (void *)cmd_chars);
  100. 74:deps//simpleserial/simpleserial.c **** return 0x00;
  101. 75:deps//simpleserial/simpleserial.c ****
  102. 76:deps//simpleserial/simpleserial.c **** }
  103. 77:deps//simpleserial/simpleserial.c ****
  104. 78:deps//simpleserial/simpleserial.c **** uint8_t stuff_data(uint8_t *buf, uint8_t len)
  105. 79:deps//simpleserial/simpleserial.c **** {
  106. 80:deps//simpleserial/simpleserial.c **** uint8_t i = 1;
  107. 81:deps//simpleserial/simpleserial.c **** uint8_t last = 0;
  108. 82:deps//simpleserial/simpleserial.c **** for (; i < len; i++) {
  109. 83:deps//simpleserial/simpleserial.c **** if (buf[i] == FRAME_BYTE) {
  110. 84:deps//simpleserial/simpleserial.c **** buf[last] = i - last;
  111. 85:deps//simpleserial/simpleserial.c **** last = i;
  112. 86:deps//simpleserial/simpleserial.c **** }
  113. 87:deps//simpleserial/simpleserial.c **** }
  114. 88:deps//simpleserial/simpleserial.c **** return 0x00;
  115. 89:deps//simpleserial/simpleserial.c **** }
  116. 90:deps//simpleserial/simpleserial.c ****
  117. 91:deps//simpleserial/simpleserial.c **** uint8_t unstuff_data(uint8_t *buf, uint8_t len)
  118. 92:deps//simpleserial/simpleserial.c **** {
  119. 93:deps//simpleserial/simpleserial.c **** uint8_t next = buf[0];
  120. 94:deps//simpleserial/simpleserial.c **** buf[0] = 0x00;
  121. 95:deps//simpleserial/simpleserial.c **** //len -= 1;
  122. 96:deps//simpleserial/simpleserial.c **** uint8_t tmp = next;
  123. 97:deps//simpleserial/simpleserial.c **** while ((next < len) && tmp != 0) {
  124. 98:deps//simpleserial/simpleserial.c **** tmp = buf[next];
  125. 99:deps//simpleserial/simpleserial.c **** buf[next] = FRAME_BYTE;
  126. 100:deps//simpleserial/simpleserial.c **** next += tmp;
  127. 101:deps//simpleserial/simpleserial.c **** }
  128. 102:deps//simpleserial/simpleserial.c **** return next;
  129. 103:deps//simpleserial/simpleserial.c **** }
  130. 104:deps//simpleserial/simpleserial.c ****
  131. 105:deps//simpleserial/simpleserial.c **** // Set up the SimpleSerial module by preparing internal commands
  132. 106:deps//simpleserial/simpleserial.c **** // This just adds the "v" command for now...
  133. 107:deps//simpleserial/simpleserial.c **** void simpleserial_init()
  134. 108:deps//simpleserial/simpleserial.c **** {
  135. 109:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('v', 0, check_version);
  136. 110:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('w', 0, ss_get_commands);
  137. 111:deps//simpleserial/simpleserial.c **** }
  138. 112:deps//simpleserial/simpleserial.c ****
  139. 113:deps//simpleserial/simpleserial.c **** int simpleserial_addcmd(char c, unsigned int len, uint8_t (*fp)(uint8_t, uint8_t, uint8_t, uint8_t*
  140. 114:deps//simpleserial/simpleserial.c **** {
  141. 115:deps//simpleserial/simpleserial.c **** if(num_commands >= MAX_SS_CMDS) {
  142. 116:deps//simpleserial/simpleserial.c **** putch('a');
  143. 117:deps//simpleserial/simpleserial.c **** return 1;
  144. 118:deps//simpleserial/simpleserial.c **** }
  145. 119:deps//simpleserial/simpleserial.c ****
  146. 120:deps//simpleserial/simpleserial.c **** if(len >= MAX_SS_LEN) {
  147. 121:deps//simpleserial/simpleserial.c **** putch('b');
  148. 122:deps//simpleserial/simpleserial.c **** return 1;
  149. 123:deps//simpleserial/simpleserial.c **** }
  150. 124:deps//simpleserial/simpleserial.c ****
  151. 125:deps//simpleserial/simpleserial.c **** commands[num_commands].c = c;
  152. 126:deps//simpleserial/simpleserial.c **** commands[num_commands].len = len;
  153. 127:deps//simpleserial/simpleserial.c **** commands[num_commands].fp = fp;
  154. 128:deps//simpleserial/simpleserial.c **** num_commands++;
  155. 129:deps//simpleserial/simpleserial.c ****
  156. 130:deps//simpleserial/simpleserial.c **** return 0;
  157. 131:deps//simpleserial/simpleserial.c **** }
  158. 132:deps//simpleserial/simpleserial.c ****
  159. 133:deps//simpleserial/simpleserial.c **** void simpleserial_get(void)
  160. 134:deps//simpleserial/simpleserial.c **** {
  161. 135:deps//simpleserial/simpleserial.c **** uint8_t data_buf[MAX_SS_LEN];
  162. 136:deps//simpleserial/simpleserial.c **** uint8_t err = 0;
  163. 137:deps//simpleserial/simpleserial.c ****
  164. 138:deps//simpleserial/simpleserial.c **** for (int i = 0; i < 4; i++) {
  165. 139:deps//simpleserial/simpleserial.c **** data_buf[i] = getch(); //PTR, cmd, scmd, len
  166. 140:deps//simpleserial/simpleserial.c **** if (data_buf[i] == FRAME_BYTE) {
  167. 141:deps//simpleserial/simpleserial.c **** err = SS_ERR_FRAME_BYTE;
  168. 142:deps//simpleserial/simpleserial.c **** goto ERROR;
  169. 143:deps//simpleserial/simpleserial.c **** }
  170. 144:deps//simpleserial/simpleserial.c **** }
  171. 145:deps//simpleserial/simpleserial.c **** uint8_t next_frame = unstuff_data(data_buf, 4);
  172. 146:deps//simpleserial/simpleserial.c ****
  173. 147:deps//simpleserial/simpleserial.c **** // check for valid command
  174. 148:deps//simpleserial/simpleserial.c **** uint8_t c = 0;
  175. 149:deps//simpleserial/simpleserial.c **** for(c = 0; c < num_commands; c++)
  176. 150:deps//simpleserial/simpleserial.c **** {
  177. 151:deps//simpleserial/simpleserial.c **** if(commands[c].c == data_buf[1])
  178. 152:deps//simpleserial/simpleserial.c **** break;
  179. 153:deps//simpleserial/simpleserial.c **** }
  180. 154:deps//simpleserial/simpleserial.c ****
  181. 155:deps//simpleserial/simpleserial.c **** if (c == num_commands) {
  182. 156:deps//simpleserial/simpleserial.c **** err = SS_ERR_CMD;
  183. 157:deps//simpleserial/simpleserial.c **** goto ERROR;
  184. 158:deps//simpleserial/simpleserial.c **** }
  185. 159:deps//simpleserial/simpleserial.c ****
  186. 160:deps//simpleserial/simpleserial.c **** //check that next frame not beyond end of message
  187. 161:deps//simpleserial/simpleserial.c **** // account for cmd, scmd, len, data, crc, end of frame
  188. 162:deps//simpleserial/simpleserial.c **** if ((data_buf[3] + 5) < next_frame) {
  189. 163:deps//simpleserial/simpleserial.c **** err = SS_ERR_LEN;
  190. 164:deps//simpleserial/simpleserial.c **** goto ERROR;
  191. 165:deps//simpleserial/simpleserial.c **** }
  192. 166:deps//simpleserial/simpleserial.c ****
  193. 167:deps//simpleserial/simpleserial.c **** // read in data
  194. 168:deps//simpleserial/simpleserial.c **** // eq to len + crc + frame end
  195. 169:deps//simpleserial/simpleserial.c **** int i = 4;
  196. 170:deps//simpleserial/simpleserial.c **** for (; i < data_buf[3] + 5; i++) {
  197. 171:deps//simpleserial/simpleserial.c **** data_buf[i] = getch();
  198. 172:deps//simpleserial/simpleserial.c **** if (data_buf[i] == FRAME_BYTE) {
  199. 173:deps//simpleserial/simpleserial.c **** err = SS_ERR_FRAME_BYTE;
  200. 174:deps//simpleserial/simpleserial.c **** goto ERROR;
  201. 175:deps//simpleserial/simpleserial.c **** }
  202. 176:deps//simpleserial/simpleserial.c **** }
  203. 177:deps//simpleserial/simpleserial.c ****
  204. 178:deps//simpleserial/simpleserial.c **** //check that final byte is the FRAME_BYTE
  205. 179:deps//simpleserial/simpleserial.c **** data_buf[i] = getch();
  206. 180:deps//simpleserial/simpleserial.c **** if (data_buf[i] != FRAME_BYTE) {
  207. 181:deps//simpleserial/simpleserial.c **** err = SS_ERR_LEN;
  208. 182:deps//simpleserial/simpleserial.c **** goto ERROR;
  209. 183:deps//simpleserial/simpleserial.c **** }
  210. 184:deps//simpleserial/simpleserial.c ****
  211. 185:deps//simpleserial/simpleserial.c **** //fully unstuff data now
  212. 186:deps//simpleserial/simpleserial.c **** unstuff_data(data_buf + next_frame, i - next_frame + 1);
  213. 187:deps//simpleserial/simpleserial.c ****
  214. 188:deps//simpleserial/simpleserial.c **** //calc crc excluding original frame offset and frame end and crc
  215. 189:deps//simpleserial/simpleserial.c **** uint8_t crc = ss_crc(data_buf+1, i-2);
  216. 190:deps//simpleserial/simpleserial.c **** if (crc != data_buf[i-1]) {
  217. 191:deps//simpleserial/simpleserial.c **** err = SS_ERR_CRC;
  218. 192:deps//simpleserial/simpleserial.c **** goto ERROR;
  219. 193:deps//simpleserial/simpleserial.c **** }
  220. 194:deps//simpleserial/simpleserial.c ****
  221. 195:deps//simpleserial/simpleserial.c **** err = commands[c].fp(data_buf[1], data_buf[2], data_buf[3], data_buf+4);
  222. 196:deps//simpleserial/simpleserial.c ****
  223. 197:deps//simpleserial/simpleserial.c **** ERROR:
  224. 198:deps//simpleserial/simpleserial.c **** simpleserial_put('e', 0x01, &err);
  225. 199:deps//simpleserial/simpleserial.c **** return;
  226. 200:deps//simpleserial/simpleserial.c **** }
  227. 201:deps//simpleserial/simpleserial.c ****
  228. 202:deps//simpleserial/simpleserial.c **** void simpleserial_put(char c, uint8_t size, uint8_t* output)
  229. 203:deps//simpleserial/simpleserial.c **** {
  230. 204:deps//simpleserial/simpleserial.c **** uint8_t data_buf[MAX_SS_LEN];
  231. 205:deps//simpleserial/simpleserial.c **** data_buf[0] = 0x00;
  232. 206:deps//simpleserial/simpleserial.c **** data_buf[1] = c;
  233. 207:deps//simpleserial/simpleserial.c **** data_buf[2] = size;
  234. 208:deps//simpleserial/simpleserial.c **** int i = 0;
  235. 209:deps//simpleserial/simpleserial.c **** for (; i < size; i++) {
  236. 210:deps//simpleserial/simpleserial.c **** data_buf[i + 3] = output[i];
  237. 211:deps//simpleserial/simpleserial.c **** }
  238. 212:deps//simpleserial/simpleserial.c **** data_buf[i + 3] = ss_crc(data_buf+1, size+2);
  239. 213:deps//simpleserial/simpleserial.c **** data_buf[i + 4] = 0x00;
  240. 214:deps//simpleserial/simpleserial.c **** stuff_data(data_buf, i + 5);
  241. 215:deps//simpleserial/simpleserial.c **** for (int i = 0; i < size + 5; i++) {
  242. 216:deps//simpleserial/simpleserial.c **** putch(data_buf[i]);
  243. 217:deps//simpleserial/simpleserial.c **** }
  244. 218:deps//simpleserial/simpleserial.c **** }
  245. 219:deps//simpleserial/simpleserial.c ****
  246. 220:deps//simpleserial/simpleserial.c ****
  247. 221:deps//simpleserial/simpleserial.c **** #else
  248. 222:deps//simpleserial/simpleserial.c ****
  249. 223:deps//simpleserial/simpleserial.c **** typedef struct ss_cmd
  250. 224:deps//simpleserial/simpleserial.c **** {
  251. 225:deps//simpleserial/simpleserial.c **** char c;
  252. 226:deps//simpleserial/simpleserial.c **** unsigned int len;
  253. 227:deps//simpleserial/simpleserial.c **** uint8_t (*fp)(uint8_t*, uint8_t);
  254. 228:deps//simpleserial/simpleserial.c **** uint8_t flags;
  255. 229:deps//simpleserial/simpleserial.c **** } ss_cmd;
  256. 230:deps//simpleserial/simpleserial.c **** static ss_cmd commands[MAX_SS_CMDS];
  257. 231:deps//simpleserial/simpleserial.c **** // Callback function for "v" command.
  258. 232:deps//simpleserial/simpleserial.c **** // This can exist in v1.0 as long as we don't actually send back an ack ("z")
  259. 233:deps//simpleserial/simpleserial.c **** uint8_t check_version(uint8_t *v, uint8_t len)
  260. 234:deps//simpleserial/simpleserial.c **** {
  261. 28 .loc 1 234 1 view -0
  262. 29 .cfi_startproc
  263. 30 @ args = 0, pretend = 0, frame = 0
  264. 31 @ frame_needed = 0, uses_anonymous_args = 0
  265. 32 @ link register save eliminated.
  266. 235:deps//simpleserial/simpleserial.c **** return SS_VER;
  267. 33 .loc 1 235 2 view .LVU1
  268. 236:deps//simpleserial/simpleserial.c **** }
  269. 34 .loc 1 236 1 is_stmt 0 view .LVU2
  270. 35 0000 0120 movs r0, #1
  271. 36 .LVL1:
  272. 37 .loc 1 236 1 view .LVU3
  273. 38 0002 7047 bx lr
  274. 39 .cfi_endproc
  275. 40 .LFE1:
  276. 42 .section .text.ss_crc,"ax",%progbits
  277. 43 .align 1
  278. 44 .global ss_crc
  279. 45 .syntax unified
  280. 46 .thumb
  281. 47 .thumb_func
  282. 48 .fpu softvfp
  283. 50 ss_crc:
  284. 51 .LVL2:
  285. 52 .LFB0:
  286. 21:deps//simpleserial/simpleserial.c **** unsigned int k = 0;
  287. 53 .loc 1 21 1 is_stmt 1 view -0
  288. 54 .cfi_startproc
  289. 55 @ args = 0, pretend = 0, frame = 0
  290. 56 @ frame_needed = 0, uses_anonymous_args = 0
  291. 21:deps//simpleserial/simpleserial.c **** unsigned int k = 0;
  292. 57 .loc 1 21 1 is_stmt 0 view .LVU5
  293. 58 0000 10B5 push {r4, lr}
  294. 59 .LCFI0:
  295. 60 .cfi_def_cfa_offset 8
  296. 61 .cfi_offset 4, -8
  297. 62 .cfi_offset 14, -4
  298. 21:deps//simpleserial/simpleserial.c **** unsigned int k = 0;
  299. 63 .loc 1 21 1 view .LVU6
  300. 64 0002 0246 mov r2, r0
  301. 22:deps//simpleserial/simpleserial.c **** uint8_t crc = 0x00;
  302. 65 .loc 1 22 2 is_stmt 1 view .LVU7
  303. 66 .LVL3:
  304. 23:deps//simpleserial/simpleserial.c **** while (len--) {
  305. 67 .loc 1 23 2 view .LVU8
  306. 24:deps//simpleserial/simpleserial.c **** crc ^= *buf++;
  307. 68 .loc 1 24 2 view .LVU9
  308. 69 0004 0144 add r1, r1, r0
  309. 70 .LVL4:
  310. 23:deps//simpleserial/simpleserial.c **** while (len--) {
  311. 71 .loc 1 23 10 is_stmt 0 view .LVU10
  312. 72 0006 0020 movs r0, #0
  313. 73 .LVL5:
  314. 74 .L3:
  315. 24:deps//simpleserial/simpleserial.c **** crc ^= *buf++;
  316. 75 .loc 1 24 9 is_stmt 1 view .LVU11
  317. 24:deps//simpleserial/simpleserial.c **** crc ^= *buf++;
  318. 76 .loc 1 24 9 is_stmt 0 view .LVU12
  319. 77 0008 8A42 cmp r2, r1
  320. 78 000a 00D1 bne .L7
  321. 30:deps//simpleserial/simpleserial.c ****
  322. 79 .loc 1 30 2 is_stmt 1 view .LVU13
  323. 32:deps//simpleserial/simpleserial.c ****
  324. 80 .loc 1 32 1 is_stmt 0 view .LVU14
  325. 81 000c 10BD pop {r4, pc}
  326. 82 .L7:
  327. 25:deps//simpleserial/simpleserial.c **** for (k = 0; k < 8; k++) {
  328. 83 .loc 1 25 3 is_stmt 1 view .LVU15
  329. 84 .LVL6:
  330. 25:deps//simpleserial/simpleserial.c **** for (k = 0; k < 8; k++) {
  331. 85 .loc 1 25 7 is_stmt 0 view .LVU16
  332. 86 000e 12F8013B ldrb r3, [r2], #1 @ zero_extendqisi2
  333. 87 .LVL7:
  334. 25:deps//simpleserial/simpleserial.c **** for (k = 0; k < 8; k++) {
  335. 88 .loc 1 25 7 view .LVU17
  336. 89 0012 0824 movs r4, #8
  337. 90 0014 5840 eors r0, r0, r3
  338. 91 .LVL8:
  339. 26:deps//simpleserial/simpleserial.c **** crc = crc & 0x80 ? (crc << 1) ^ CW_CRC: crc << 1;
  340. 92 .loc 1 26 3 is_stmt 1 view .LVU18
  341. 26:deps//simpleserial/simpleserial.c **** crc = crc & 0x80 ? (crc << 1) ^ CW_CRC: crc << 1;
  342. 93 .loc 1 26 17 view .LVU19
  343. 94 .L6:
  344. 27:deps//simpleserial/simpleserial.c **** }
  345. 95 .loc 1 27 4 view .LVU20
  346. 27:deps//simpleserial/simpleserial.c **** }
  347. 96 .loc 1 27 8 is_stmt 0 view .LVU21
  348. 97 0016 10F0800F tst r0, #128
  349. 98 001a 4FEA4003 lsl r3, r0, #1
  350. 27:deps//simpleserial/simpleserial.c **** }
  351. 99 .loc 1 27 34 view .LVU22
  352. 100 001e 18BF it ne
  353. 101 0020 83F04D03 eorne r3, r3, #77
  354. 26:deps//simpleserial/simpleserial.c **** crc = crc & 0x80 ? (crc << 1) ^ CW_CRC: crc << 1;
  355. 102 .loc 1 26 17 view .LVU23
  356. 103 0024 013C subs r4, r4, #1
  357. 104 .LVL9:
  358. 27:deps//simpleserial/simpleserial.c **** }
  359. 105 .loc 1 27 8 view .LVU24
  360. 106 0026 D8B2 uxtb r0, r3
  361. 107 .LVL10:
  362. 26:deps//simpleserial/simpleserial.c **** crc = crc & 0x80 ? (crc << 1) ^ CW_CRC: crc << 1;
  363. 108 .loc 1 26 23 is_stmt 1 view .LVU25
  364. 26:deps//simpleserial/simpleserial.c **** crc = crc & 0x80 ? (crc << 1) ^ CW_CRC: crc << 1;
  365. 109 .loc 1 26 17 view .LVU26
  366. 110 0028 F5D1 bne .L6
  367. 111 002a EDE7 b .L3
  368. 112 .cfi_endproc
  369. 113 .LFE0:
  370. 115 .section .text.hex_decode,"ax",%progbits
  371. 116 .align 1
  372. 117 .global hex_decode
  373. 118 .syntax unified
  374. 119 .thumb
  375. 120 .thumb_func
  376. 121 .fpu softvfp
  377. 123 hex_decode:
  378. 124 .LVL11:
  379. 125 .LFB4:
  380. 237:deps//simpleserial/simpleserial.c ****
  381. 238:deps//simpleserial/simpleserial.c **** uint8_t ss_num_commands(uint8_t *x, uint8_t len)
  382. 239:deps//simpleserial/simpleserial.c **** {
  383. 240:deps//simpleserial/simpleserial.c **** uint8_t ncmds = num_commands & 0xFF;
  384. 241:deps//simpleserial/simpleserial.c **** simpleserial_put('r', 0x01, &ncmds);
  385. 242:deps//simpleserial/simpleserial.c **** return 0x00;
  386. 243:deps//simpleserial/simpleserial.c **** }
  387. 244:deps//simpleserial/simpleserial.c ****
  388. 245:deps//simpleserial/simpleserial.c **** typedef struct ss_cmd_repr {
  389. 246:deps//simpleserial/simpleserial.c **** uint8_t c;
  390. 247:deps//simpleserial/simpleserial.c **** uint8_t len;
  391. 248:deps//simpleserial/simpleserial.c **** uint8_t flags;
  392. 249:deps//simpleserial/simpleserial.c **** } ss_cmd_repr;
  393. 250:deps//simpleserial/simpleserial.c ****
  394. 251:deps//simpleserial/simpleserial.c **** uint8_t ss_get_commands(uint8_t *x, uint8_t len)
  395. 252:deps//simpleserial/simpleserial.c **** {
  396. 253:deps//simpleserial/simpleserial.c **** ss_cmd_repr repr_cmd_buf[MAX_SS_CMDS];
  397. 254:deps//simpleserial/simpleserial.c **** for (uint8_t i = 0; i < (num_commands & 0xFF); i++) {
  398. 255:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c;
  399. 256:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].len = commands[i].len;
  400. 257:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].flags = commands[i].flags;
  401. 258:deps//simpleserial/simpleserial.c **** }
  402. 259:deps//simpleserial/simpleserial.c ****
  403. 260:deps//simpleserial/simpleserial.c **** simpleserial_put('r', num_commands * 0x03, (void *) repr_cmd_buf);
  404. 261:deps//simpleserial/simpleserial.c **** return 0x00;
  405. 262:deps//simpleserial/simpleserial.c **** }
  406. 263:deps//simpleserial/simpleserial.c ****
  407. 264:deps//simpleserial/simpleserial.c **** static char hex_lookup[16] =
  408. 265:deps//simpleserial/simpleserial.c **** {
  409. 266:deps//simpleserial/simpleserial.c **** '0', '1', '2', '3', '4', '5', '6', '7',
  410. 267:deps//simpleserial/simpleserial.c **** '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
  411. 268:deps//simpleserial/simpleserial.c **** };
  412. 269:deps//simpleserial/simpleserial.c ****
  413. 270:deps//simpleserial/simpleserial.c **** int hex_decode(int len, char* ascii_buf, uint8_t* data_buf)
  414. 271:deps//simpleserial/simpleserial.c **** {
  415. 126 .loc 1 271 1 view -0
  416. 127 .cfi_startproc
  417. 128 @ args = 0, pretend = 0, frame = 0
  418. 129 @ frame_needed = 0, uses_anonymous_args = 0
  419. 272:deps//simpleserial/simpleserial.c **** for(int i = 0; i < len; i++)
  420. 130 .loc 1 272 2 view .LVU28
  421. 131 .LBB2:
  422. 132 .loc 1 272 6 view .LVU29
  423. 133 .loc 1 272 6 is_stmt 0 view .LVU30
  424. 134 .LBE2:
  425. 271:deps//simpleserial/simpleserial.c **** for(int i = 0; i < len; i++)
  426. 135 .loc 1 271 1 view .LVU31
  427. 136 0000 F0B5 push {r4, r5, r6, r7, lr}
  428. 137 .LCFI1:
  429. 138 .cfi_def_cfa_offset 20
  430. 139 .cfi_offset 4, -20
  431. 140 .cfi_offset 5, -16
  432. 141 .cfi_offset 6, -12
  433. 142 .cfi_offset 7, -8
  434. 143 .cfi_offset 14, -4
  435. 144 .LBB7:
  436. 145 .loc 1 272 10 view .LVU32
  437. 146 0002 0025 movs r5, #0
  438. 147 .LBB3:
  439. 273:deps//simpleserial/simpleserial.c **** {
  440. 274:deps//simpleserial/simpleserial.c **** char n_hi = ascii_buf[2*i];
  441. 275:deps//simpleserial/simpleserial.c **** char n_lo = ascii_buf[2*i+1];
  442. 148 .loc 1 275 8 view .LVU33
  443. 149 0004 4F1C adds r7, r1, #1
  444. 150 .LVL12:
  445. 151 .L10:
  446. 152 .loc 1 275 8 view .LVU34
  447. 153 .LBE3:
  448. 272:deps//simpleserial/simpleserial.c **** {
  449. 154 .loc 1 272 19 is_stmt 1 discriminator 1 view .LVU35
  450. 155 0006 8542 cmp r5, r0
  451. 156 0008 01DB blt .L20
  452. 157 .LBE7:
  453. 276:deps//simpleserial/simpleserial.c ****
  454. 277:deps//simpleserial/simpleserial.c **** if(n_lo >= '0' && n_lo <= '9')
  455. 278:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - '0';
  456. 279:deps//simpleserial/simpleserial.c **** else if(n_lo >= 'A' && n_lo <= 'F')
  457. 280:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - 'A' + 10;
  458. 281:deps//simpleserial/simpleserial.c **** else if(n_lo >= 'a' && n_lo <= 'f')
  459. 282:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - 'a' + 10;
  460. 283:deps//simpleserial/simpleserial.c **** else
  461. 284:deps//simpleserial/simpleserial.c **** return 1;
  462. 285:deps//simpleserial/simpleserial.c ****
  463. 286:deps//simpleserial/simpleserial.c **** if(n_hi >= '0' && n_hi <= '9')
  464. 287:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - '0') << 4;
  465. 288:deps//simpleserial/simpleserial.c **** else if(n_hi >= 'A' && n_hi <= 'F')
  466. 289:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - 'A' + 10) << 4;
  467. 290:deps//simpleserial/simpleserial.c **** else if(n_hi >= 'a' && n_hi <= 'f')
  468. 291:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - 'a' + 10) << 4;
  469. 292:deps//simpleserial/simpleserial.c **** else
  470. 293:deps//simpleserial/simpleserial.c **** return 1;
  471. 294:deps//simpleserial/simpleserial.c **** }
  472. 295:deps//simpleserial/simpleserial.c ****
  473. 296:deps//simpleserial/simpleserial.c **** return 0;
  474. 158 .loc 1 296 9 is_stmt 0 view .LVU36
  475. 159 000a 0020 movs r0, #0
  476. 160 .LVL13:
  477. 161 .loc 1 296 9 view .LVU37
  478. 162 000c 21E0 b .L9
  479. 163 .LVL14:
  480. 164 .L20:
  481. 165 .LBB8:
  482. 166 .LBB4:
  483. 274:deps//simpleserial/simpleserial.c **** char n_lo = ascii_buf[2*i+1];
  484. 167 .loc 1 274 3 is_stmt 1 view .LVU38
  485. 275:deps//simpleserial/simpleserial.c ****
  486. 168 .loc 1 275 8 is_stmt 0 view .LVU39
  487. 169 000e 17F81540 ldrb r4, [r7, r5, lsl #1] @ zero_extendqisi2
  488. 274:deps//simpleserial/simpleserial.c **** char n_lo = ascii_buf[2*i+1];
  489. 170 .loc 1 274 8 view .LVU40
  490. 171 0012 11F81530 ldrb r3, [r1, r5, lsl #1] @ zero_extendqisi2
  491. 172 .LVL15:
  492. 275:deps//simpleserial/simpleserial.c ****
  493. 173 .loc 1 275 3 is_stmt 1 view .LVU41
  494. 277:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - '0';
  495. 174 .loc 1 277 3 view .LVU42
  496. 277:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - '0';
  497. 175 .loc 1 277 18 is_stmt 0 view .LVU43
  498. 176 0016 A4F13006 sub r6, r4, #48
  499. 177 001a F6B2 uxtb r6, r6
  500. 277:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - '0';
  501. 178 .loc 1 277 5 view .LVU44
  502. 179 001c 092E cmp r6, #9
  503. 180 001e 0CD8 bhi .L11
  504. 278:deps//simpleserial/simpleserial.c **** else if(n_lo >= 'A' && n_lo <= 'F')
  505. 181 .loc 1 278 4 is_stmt 1 view .LVU45
  506. 278:deps//simpleserial/simpleserial.c **** else if(n_lo >= 'A' && n_lo <= 'F')
  507. 182 .loc 1 278 16 is_stmt 0 view .LVU46
  508. 183 0020 1670 strb r6, [r2]
  509. 184 .LVL16:
  510. 185 .L12:
  511. 286:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - '0') << 4;
  512. 186 .loc 1 286 3 is_stmt 1 view .LVU47
  513. 286:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - '0') << 4;
  514. 187 .loc 1 286 18 is_stmt 0 view .LVU48
  515. 188 0022 A3F13004 sub r4, r3, #48
  516. 286:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - '0') << 4;
  517. 189 .loc 1 286 5 view .LVU49
  518. 190 0026 E6B2 uxtb r6, r4
  519. 191 0028 092E cmp r6, #9
  520. 192 002a 15D8 bhi .L16
  521. 193 .L23:
  522. 289:deps//simpleserial/simpleserial.c **** else if(n_hi >= 'a' && n_hi <= 'f')
  523. 194 .loc 1 289 16 view .LVU50
  524. 195 002c 1378 ldrb r3, [r2] @ zero_extendqisi2
  525. 196 .LVL17:
  526. 289:deps//simpleserial/simpleserial.c **** else if(n_hi >= 'a' && n_hi <= 'f')
  527. 197 .loc 1 289 16 view .LVU51
  528. 198 002e 43EA0413 orr r3, r3, r4, lsl #4
  529. 199 .L22:
  530. 291:deps//simpleserial/simpleserial.c **** else
  531. 200 .loc 1 291 16 view .LVU52
  532. 201 0032 1370 strb r3, [r2]
  533. 202 .LBE4:
  534. 272:deps//simpleserial/simpleserial.c **** {
  535. 203 .loc 1 272 27 is_stmt 1 view .LVU53
  536. 204 0034 0135 adds r5, r5, #1
  537. 205 .LVL18:
  538. 272:deps//simpleserial/simpleserial.c **** {
  539. 206 .loc 1 272 27 is_stmt 0 view .LVU54
  540. 207 0036 0132 adds r2, r2, #1
  541. 208 0038 E5E7 b .L10
  542. 209 .LVL19:
  543. 210 .L11:
  544. 211 .LBB5:
  545. 279:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - 'A' + 10;
  546. 212 .loc 1 279 8 is_stmt 1 view .LVU55
  547. 279:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - 'A' + 10;
  548. 213 .loc 1 279 10 is_stmt 0 view .LVU56
  549. 214 003a A4F14106 sub r6, r4, #65
  550. 215 003e 052E cmp r6, #5
  551. 216 0040 02D8 bhi .L13
  552. 280:deps//simpleserial/simpleserial.c **** else if(n_lo >= 'a' && n_lo <= 'f')
  553. 217 .loc 1 280 4 is_stmt 1 view .LVU57
  554. 280:deps//simpleserial/simpleserial.c **** else if(n_lo >= 'a' && n_lo <= 'f')
  555. 218 .loc 1 280 29 is_stmt 0 view .LVU58
  556. 219 0042 373C subs r4, r4, #55
  557. 220 .LVL20:
  558. 221 .L21:
  559. 282:deps//simpleserial/simpleserial.c **** else
  560. 222 .loc 1 282 16 view .LVU59
  561. 223 0044 1470 strb r4, [r2]
  562. 224 .LVL21:
  563. 282:deps//simpleserial/simpleserial.c **** else
  564. 225 .loc 1 282 16 view .LVU60
  565. 226 0046 ECE7 b .L12
  566. 227 .LVL22:
  567. 228 .L13:
  568. 281:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - 'a' + 10;
  569. 229 .loc 1 281 8 is_stmt 1 view .LVU61
  570. 281:deps//simpleserial/simpleserial.c **** data_buf[i] = n_lo - 'a' + 10;
  571. 230 .loc 1 281 10 is_stmt 0 view .LVU62
  572. 231 0048 A4F16106 sub r6, r4, #97
  573. 232 004c 052E cmp r6, #5
  574. 233 004e 01D9 bls .L14
  575. 234 .LVL23:
  576. 235 .L19:
  577. 284:deps//simpleserial/simpleserial.c ****
  578. 236 .loc 1 284 11 view .LVU63
  579. 237 0050 0120 movs r0, #1
  580. 238 .LVL24:
  581. 239 .L9:
  582. 284:deps//simpleserial/simpleserial.c ****
  583. 240 .loc 1 284 11 view .LVU64
  584. 241 .LBE5:
  585. 242 .LBE8:
  586. 297:deps//simpleserial/simpleserial.c **** }
  587. 243 .loc 1 297 1 view .LVU65
  588. 244 0052 F0BD pop {r4, r5, r6, r7, pc}
  589. 245 .LVL25:
  590. 246 .L14:
  591. 247 .LBB9:
  592. 248 .LBB6:
  593. 282:deps//simpleserial/simpleserial.c **** else
  594. 249 .loc 1 282 4 is_stmt 1 view .LVU66
  595. 282:deps//simpleserial/simpleserial.c **** else
  596. 250 .loc 1 282 29 is_stmt 0 view .LVU67
  597. 251 0054 573C subs r4, r4, #87
  598. 252 .LVL26:
  599. 282:deps//simpleserial/simpleserial.c **** else
  600. 253 .loc 1 282 29 view .LVU68
  601. 254 0056 F5E7 b .L21
  602. 255 .LVL27:
  603. 256 .L16:
  604. 288:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - 'A' + 10) << 4;
  605. 257 .loc 1 288 8 is_stmt 1 view .LVU69
  606. 288:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - 'A' + 10) << 4;
  607. 258 .loc 1 288 10 is_stmt 0 view .LVU70
  608. 259 0058 A3F14104 sub r4, r3, #65
  609. 260 005c 052C cmp r4, #5
  610. 261 005e 02D8 bhi .L18
  611. 289:deps//simpleserial/simpleserial.c **** else if(n_hi >= 'a' && n_hi <= 'f')
  612. 262 .loc 1 289 4 is_stmt 1 view .LVU71
  613. 289:deps//simpleserial/simpleserial.c **** else if(n_hi >= 'a' && n_hi <= 'f')
  614. 263 .loc 1 289 31 is_stmt 0 view .LVU72
  615. 264 0060 A3F13704 sub r4, r3, #55
  616. 265 0064 E2E7 b .L23
  617. 266 .L18:
  618. 290:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - 'a' + 10) << 4;
  619. 267 .loc 1 290 8 is_stmt 1 view .LVU73
  620. 290:deps//simpleserial/simpleserial.c **** data_buf[i] |= (n_hi - 'a' + 10) << 4;
  621. 268 .loc 1 290 10 is_stmt 0 view .LVU74
  622. 269 0066 A3F16104 sub r4, r3, #97
  623. 270 006a 052C cmp r4, #5
  624. 271 006c F0D8 bhi .L19
  625. 291:deps//simpleserial/simpleserial.c **** else
  626. 272 .loc 1 291 4 is_stmt 1 view .LVU75
  627. 291:deps//simpleserial/simpleserial.c **** else
  628. 273 .loc 1 291 16 is_stmt 0 view .LVU76
  629. 274 006e 1478 ldrb r4, [r2] @ zero_extendqisi2
  630. 291:deps//simpleserial/simpleserial.c **** else
  631. 275 .loc 1 291 31 view .LVU77
  632. 276 0070 573B subs r3, r3, #87
  633. 277 .LVL28:
  634. 291:deps//simpleserial/simpleserial.c **** else
  635. 278 .loc 1 291 16 view .LVU78
  636. 279 0072 44EA0313 orr r3, r4, r3, lsl #4
  637. 280 .LVL29:
  638. 291:deps//simpleserial/simpleserial.c **** else
  639. 281 .loc 1 291 16 view .LVU79
  640. 282 0076 DCE7 b .L22
  641. 283 .LBE6:
  642. 284 .LBE9:
  643. 285 .cfi_endproc
  644. 286 .LFE4:
  645. 288 .section .text.simpleserial_addcmd_flags,"ax",%progbits
  646. 289 .align 1
  647. 290 .global simpleserial_addcmd_flags
  648. 291 .syntax unified
  649. 292 .thumb
  650. 293 .thumb_func
  651. 294 .fpu softvfp
  652. 296 simpleserial_addcmd_flags:
  653. 297 .LVL30:
  654. 298 .LFB7:
  655. 298:deps//simpleserial/simpleserial.c ****
  656. 299:deps//simpleserial/simpleserial.c ****
  657. 300:deps//simpleserial/simpleserial.c ****
  658. 301:deps//simpleserial/simpleserial.c **** // Set up the SimpleSerial module by preparing internal commands
  659. 302:deps//simpleserial/simpleserial.c **** // This just adds the "v" command for now...
  660. 303:deps//simpleserial/simpleserial.c **** void simpleserial_init()
  661. 304:deps//simpleserial/simpleserial.c **** {
  662. 305:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('v', 0, check_version);
  663. 306:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('w', 0, ss_get_commands);
  664. 307:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('y', 0, ss_num_commands);
  665. 308:deps//simpleserial/simpleserial.c **** }
  666. 309:deps//simpleserial/simpleserial.c ****
  667. 310:deps//simpleserial/simpleserial.c **** int simpleserial_addcmd(char c, unsigned int len, uint8_t (*fp)(uint8_t*, uint8_t))
  668. 311:deps//simpleserial/simpleserial.c **** {
  669. 312:deps//simpleserial/simpleserial.c **** return simpleserial_addcmd_flags(c, len, fp, CMD_FLAG_NONE);
  670. 313:deps//simpleserial/simpleserial.c **** }
  671. 314:deps//simpleserial/simpleserial.c ****
  672. 315:deps//simpleserial/simpleserial.c **** int simpleserial_addcmd_flags(char c, unsigned int len, uint8_t (*fp)(uint8_t*, uint8_t), uint8_t f
  673. 316:deps//simpleserial/simpleserial.c **** {
  674. 299 .loc 1 316 1 is_stmt 1 view -0
  675. 300 .cfi_startproc
  676. 301 @ args = 0, pretend = 0, frame = 0
  677. 302 @ frame_needed = 0, uses_anonymous_args = 0
  678. 317:deps//simpleserial/simpleserial.c **** if(num_commands >= MAX_SS_CMDS)
  679. 303 .loc 1 317 2 view .LVU81
  680. 316:deps//simpleserial/simpleserial.c **** if(num_commands >= MAX_SS_CMDS)
  681. 304 .loc 1 316 1 is_stmt 0 view .LVU82
  682. 305 0000 70B5 push {r4, r5, r6, lr}
  683. 306 .LCFI2:
  684. 307 .cfi_def_cfa_offset 16
  685. 308 .cfi_offset 4, -16
  686. 309 .cfi_offset 5, -12
  687. 310 .cfi_offset 6, -8
  688. 311 .cfi_offset 14, -4
  689. 312 .loc 1 317 18 view .LVU83
  690. 313 0002 094E ldr r6, .L28
  691. 314 0004 3468 ldr r4, [r6]
  692. 315 .loc 1 317 4 view .LVU84
  693. 316 0006 0F2C cmp r4, #15
  694. 317 0008 0BDC bgt .L27
  695. 318:deps//simpleserial/simpleserial.c **** return 1;
  696. 319:deps//simpleserial/simpleserial.c ****
  697. 320:deps//simpleserial/simpleserial.c **** if(len >= MAX_SS_LEN)
  698. 318 .loc 1 320 2 is_stmt 1 view .LVU85
  699. 319 .loc 1 320 4 is_stmt 0 view .LVU86
  700. 320 000a BF29 cmp r1, #191
  701. 321 000c 09D8 bhi .L27
  702. 321:deps//simpleserial/simpleserial.c **** return 1;
  703. 322:deps//simpleserial/simpleserial.c ****
  704. 323:deps//simpleserial/simpleserial.c **** commands[num_commands].c = c;
  705. 322 .loc 1 323 2 is_stmt 1 view .LVU87
  706. 323 .loc 1 323 29 is_stmt 0 view .LVU88
  707. 324 000e 06EB0415 add r5, r6, r4, lsl #4
  708. 324:deps//simpleserial/simpleserial.c **** commands[num_commands].len = len;
  709. 325:deps//simpleserial/simpleserial.c **** commands[num_commands].fp = fp;
  710. 325 .loc 1 325 29 view .LVU89
  711. 326 0012 C5E90212 strd r1, r2, [r5, #8]
  712. 326:deps//simpleserial/simpleserial.c **** commands[num_commands].flags = fl;
  713. 327:deps//simpleserial/simpleserial.c **** num_commands++;
  714. 327 .loc 1 327 14 view .LVU90
  715. 328 0016 0134 adds r4, r4, #1
  716. 323:deps//simpleserial/simpleserial.c **** commands[num_commands].len = len;
  717. 329 .loc 1 323 29 view .LVU91
  718. 330 0018 2871 strb r0, [r5, #4]
  719. 324:deps//simpleserial/simpleserial.c **** commands[num_commands].len = len;
  720. 331 .loc 1 324 2 is_stmt 1 view .LVU92
  721. 326:deps//simpleserial/simpleserial.c **** commands[num_commands].flags = fl;
  722. 332 .loc 1 326 2 view .LVU93
  723. 326:deps//simpleserial/simpleserial.c **** commands[num_commands].flags = fl;
  724. 333 .loc 1 326 31 is_stmt 0 view .LVU94
  725. 334 001a 2B74 strb r3, [r5, #16]
  726. 335 .loc 1 327 2 is_stmt 1 view .LVU95
  727. 336 .loc 1 327 14 is_stmt 0 view .LVU96
  728. 337 001c 3460 str r4, [r6]
  729. 328:deps//simpleserial/simpleserial.c ****
  730. 329:deps//simpleserial/simpleserial.c **** return 0;
  731. 338 .loc 1 329 2 is_stmt 1 view .LVU97
  732. 339 .loc 1 329 9 is_stmt 0 view .LVU98
  733. 340 001e 0020 movs r0, #0
  734. 341 .LVL31:
  735. 342 .L24:
  736. 330:deps//simpleserial/simpleserial.c **** }
  737. 343 .loc 1 330 1 view .LVU99
  738. 344 0020 70BD pop {r4, r5, r6, pc}
  739. 345 .LVL32:
  740. 346 .L27:
  741. 318:deps//simpleserial/simpleserial.c ****
  742. 347 .loc 1 318 10 view .LVU100
  743. 348 0022 0120 movs r0, #1
  744. 349 .LVL33:
  745. 318:deps//simpleserial/simpleserial.c ****
  746. 350 .loc 1 318 10 view .LVU101
  747. 351 0024 FCE7 b .L24
  748. 352 .L29:
  749. 353 0026 00BF .align 2
  750. 354 .L28:
  751. 355 0028 00000000 .word .LANCHOR0
  752. 356 .cfi_endproc
  753. 357 .LFE7:
  754. 359 .section .text.simpleserial_addcmd,"ax",%progbits
  755. 360 .align 1
  756. 361 .global simpleserial_addcmd
  757. 362 .syntax unified
  758. 363 .thumb
  759. 364 .thumb_func
  760. 365 .fpu softvfp
  761. 367 simpleserial_addcmd:
  762. 368 .LVL34:
  763. 369 .LFB6:
  764. 311:deps//simpleserial/simpleserial.c **** return simpleserial_addcmd_flags(c, len, fp, CMD_FLAG_NONE);
  765. 370 .loc 1 311 1 is_stmt 1 view -0
  766. 371 .cfi_startproc
  767. 372 @ args = 0, pretend = 0, frame = 0
  768. 373 @ frame_needed = 0, uses_anonymous_args = 0
  769. 374 @ link register save eliminated.
  770. 312:deps//simpleserial/simpleserial.c **** }
  771. 375 .loc 1 312 2 view .LVU103
  772. 312:deps//simpleserial/simpleserial.c **** }
  773. 376 .loc 1 312 9 is_stmt 0 view .LVU104
  774. 377 0000 0023 movs r3, #0
  775. 378 0002 FFF7FEBF b simpleserial_addcmd_flags
  776. 379 .LVL35:
  777. 312:deps//simpleserial/simpleserial.c **** }
  778. 380 .loc 1 312 9 view .LVU105
  779. 381 .cfi_endproc
  780. 382 .LFE6:
  781. 384 .section .text.simpleserial_init,"ax",%progbits
  782. 385 .align 1
  783. 386 .global simpleserial_init
  784. 387 .syntax unified
  785. 388 .thumb
  786. 389 .thumb_func
  787. 390 .fpu softvfp
  788. 392 simpleserial_init:
  789. 393 .LFB5:
  790. 304:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('v', 0, check_version);
  791. 394 .loc 1 304 1 is_stmt 1 view -0
  792. 395 .cfi_startproc
  793. 396 @ args = 0, pretend = 0, frame = 0
  794. 397 @ frame_needed = 0, uses_anonymous_args = 0
  795. 305:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('w', 0, ss_get_commands);
  796. 398 .loc 1 305 2 view .LVU107
  797. 304:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('v', 0, check_version);
  798. 399 .loc 1 304 1 is_stmt 0 view .LVU108
  799. 400 0000 08B5 push {r3, lr}
  800. 401 .LCFI3:
  801. 402 .cfi_def_cfa_offset 8
  802. 403 .cfi_offset 3, -8
  803. 404 .cfi_offset 14, -4
  804. 305:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('w', 0, ss_get_commands);
  805. 405 .loc 1 305 2 view .LVU109
  806. 406 0002 074A ldr r2, .L32
  807. 407 0004 0021 movs r1, #0
  808. 408 0006 7620 movs r0, #118
  809. 409 0008 FFF7FEFF bl simpleserial_addcmd
  810. 410 .LVL36:
  811. 306:deps//simpleserial/simpleserial.c **** simpleserial_addcmd('y', 0, ss_num_commands);
  812. 411 .loc 1 306 5 is_stmt 1 view .LVU110
  813. 412 000c 054A ldr r2, .L32+4
  814. 413 000e 7720 movs r0, #119
  815. 414 0010 FFF7FEFF bl simpleserial_addcmd
  816. 415 .LVL37:
  817. 307:deps//simpleserial/simpleserial.c **** }
  818. 416 .loc 1 307 5 view .LVU111
  819. 308:deps//simpleserial/simpleserial.c ****
  820. 417 .loc 1 308 1 is_stmt 0 view .LVU112
  821. 418 0014 BDE80840 pop {r3, lr}
  822. 419 .LCFI4:
  823. 420 .cfi_restore 14
  824. 421 .cfi_restore 3
  825. 422 .cfi_def_cfa_offset 0
  826. 307:deps//simpleserial/simpleserial.c **** }
  827. 423 .loc 1 307 5 view .LVU113
  828. 424 0018 034A ldr r2, .L32+8
  829. 425 001a 7920 movs r0, #121
  830. 426 001c FFF7FEBF b simpleserial_addcmd
  831. 427 .LVL38:
  832. 428 .L33:
  833. 429 .align 2
  834. 430 .L32:
  835. 431 0020 00000000 .word check_version
  836. 432 0024 00000000 .word ss_get_commands
  837. 433 0028 00000000 .word ss_num_commands
  838. 434 .cfi_endproc
  839. 435 .LFE5:
  840. 437 .section .text.simpleserial_put,"ax",%progbits
  841. 438 .align 1
  842. 439 .global simpleserial_put
  843. 440 .syntax unified
  844. 441 .thumb
  845. 442 .thumb_func
  846. 443 .fpu softvfp
  847. 445 simpleserial_put:
  848. 446 .LVL39:
  849. 447 .LFB9:
  850. 331:deps//simpleserial/simpleserial.c ****
  851. 332:deps//simpleserial/simpleserial.c **** void simpleserial_get(void)
  852. 333:deps//simpleserial/simpleserial.c **** {
  853. 334:deps//simpleserial/simpleserial.c **** char ascii_buf[2*MAX_SS_LEN];
  854. 335:deps//simpleserial/simpleserial.c **** uint8_t data_buf[MAX_SS_LEN];
  855. 336:deps//simpleserial/simpleserial.c **** char c;
  856. 337:deps//simpleserial/simpleserial.c ****
  857. 338:deps//simpleserial/simpleserial.c **** // Find which command we're receiving
  858. 339:deps//simpleserial/simpleserial.c **** c = getch();
  859. 340:deps//simpleserial/simpleserial.c ****
  860. 341:deps//simpleserial/simpleserial.c **** int cmd;
  861. 342:deps//simpleserial/simpleserial.c **** for(cmd = 0; cmd < num_commands; cmd++)
  862. 343:deps//simpleserial/simpleserial.c **** {
  863. 344:deps//simpleserial/simpleserial.c **** if(commands[cmd].c == c)
  864. 345:deps//simpleserial/simpleserial.c **** break;
  865. 346:deps//simpleserial/simpleserial.c **** }
  866. 347:deps//simpleserial/simpleserial.c ****
  867. 348:deps//simpleserial/simpleserial.c **** // If we didn't find a match, give up right away
  868. 349:deps//simpleserial/simpleserial.c **** if(cmd == num_commands)
  869. 350:deps//simpleserial/simpleserial.c **** return;
  870. 351:deps//simpleserial/simpleserial.c ****
  871. 352:deps//simpleserial/simpleserial.c **** // If flag CMD_FLAG_LEN is set, the next byte indicates the sent length
  872. 353:deps//simpleserial/simpleserial.c **** if ((commands[cmd].flags & CMD_FLAG_LEN) != 0)
  873. 354:deps//simpleserial/simpleserial.c **** {
  874. 355:deps//simpleserial/simpleserial.c **** uint8_t l = 0;
  875. 356:deps//simpleserial/simpleserial.c **** char buff[2];
  876. 357:deps//simpleserial/simpleserial.c **** buff[0] = getch();
  877. 358:deps//simpleserial/simpleserial.c **** buff[1] = getch();
  878. 359:deps//simpleserial/simpleserial.c **** if (hex_decode(1, buff, &l))
  879. 360:deps//simpleserial/simpleserial.c **** return;
  880. 361:deps//simpleserial/simpleserial.c **** commands[cmd].len = l;
  881. 362:deps//simpleserial/simpleserial.c **** }
  882. 363:deps//simpleserial/simpleserial.c ****
  883. 364:deps//simpleserial/simpleserial.c **** // Receive characters until we fill the ASCII buffer
  884. 365:deps//simpleserial/simpleserial.c **** for(int i = 0; i < 2*commands[cmd].len; i++)
  885. 366:deps//simpleserial/simpleserial.c **** {
  886. 367:deps//simpleserial/simpleserial.c **** c = getch();
  887. 368:deps//simpleserial/simpleserial.c ****
  888. 369:deps//simpleserial/simpleserial.c **** // Check for early \n
  889. 370:deps//simpleserial/simpleserial.c **** if(c == '\n' || c == '\r')
  890. 371:deps//simpleserial/simpleserial.c **** return;
  891. 372:deps//simpleserial/simpleserial.c ****
  892. 373:deps//simpleserial/simpleserial.c **** ascii_buf[i] = c;
  893. 374:deps//simpleserial/simpleserial.c **** }
  894. 375:deps//simpleserial/simpleserial.c ****
  895. 376:deps//simpleserial/simpleserial.c **** // Assert that last character is \n or \r
  896. 377:deps//simpleserial/simpleserial.c **** c = getch();
  897. 378:deps//simpleserial/simpleserial.c **** if(c != '\n' && c != '\r')
  898. 379:deps//simpleserial/simpleserial.c **** return;
  899. 380:deps//simpleserial/simpleserial.c ****
  900. 381:deps//simpleserial/simpleserial.c **** // ASCII buffer is full: convert to bytes
  901. 382:deps//simpleserial/simpleserial.c **** // Check for illegal characters here
  902. 383:deps//simpleserial/simpleserial.c **** if(hex_decode(commands[cmd].len, ascii_buf, data_buf))
  903. 384:deps//simpleserial/simpleserial.c **** return;
  904. 385:deps//simpleserial/simpleserial.c ****
  905. 386:deps//simpleserial/simpleserial.c **** // Callback
  906. 387:deps//simpleserial/simpleserial.c **** uint8_t ret[1];
  907. 388:deps//simpleserial/simpleserial.c **** ret[0] = commands[cmd].fp(data_buf, commands[cmd].len);
  908. 389:deps//simpleserial/simpleserial.c ****
  909. 390:deps//simpleserial/simpleserial.c **** // Acknowledge (if version is 1.1)
  910. 391:deps//simpleserial/simpleserial.c **** #if SS_VER == SS_VER_1_1
  911. 392:deps//simpleserial/simpleserial.c **** simpleserial_put('z', 1, ret);
  912. 393:deps//simpleserial/simpleserial.c **** #endif
  913. 394:deps//simpleserial/simpleserial.c **** }
  914. 395:deps//simpleserial/simpleserial.c ****
  915. 396:deps//simpleserial/simpleserial.c **** void simpleserial_put(char c, uint8_t size, uint8_t* output)
  916. 397:deps//simpleserial/simpleserial.c **** {
  917. 448 .loc 1 397 1 is_stmt 1 view -0
  918. 449 .cfi_startproc
  919. 450 @ args = 0, pretend = 0, frame = 0
  920. 451 @ frame_needed = 0, uses_anonymous_args = 0
  921. 398:deps//simpleserial/simpleserial.c **** // Write first character
  922. 399:deps//simpleserial/simpleserial.c **** putch(c);
  923. 452 .loc 1 399 2 view .LVU115
  924. 397:deps//simpleserial/simpleserial.c **** // Write first character
  925. 453 .loc 1 397 1 is_stmt 0 view .LVU116
  926. 454 0000 F8B5 push {r3, r4, r5, r6, r7, lr}
  927. 455 .LCFI5:
  928. 456 .cfi_def_cfa_offset 24
  929. 457 .cfi_offset 3, -24
  930. 458 .cfi_offset 4, -20
  931. 459 .cfi_offset 5, -16
  932. 460 .cfi_offset 6, -12
  933. 461 .cfi_offset 7, -8
  934. 462 .cfi_offset 14, -4
  935. 397:deps//simpleserial/simpleserial.c **** // Write first character
  936. 463 .loc 1 397 1 view .LVU117
  937. 464 0002 1446 mov r4, r2
  938. 465 0004 0E46 mov r6, r1
  939. 466 .loc 1 399 2 view .LVU118
  940. 467 0006 FFF7FEFF bl putch
  941. 468 .LVL40:
  942. 400:deps//simpleserial/simpleserial.c ****
  943. 401:deps//simpleserial/simpleserial.c **** // Write each byte as two nibbles
  944. 402:deps//simpleserial/simpleserial.c **** for(int i = 0; i < size; i++)
  945. 469 .loc 1 402 2 is_stmt 1 view .LVU119
  946. 470 .LBB10:
  947. 471 .loc 1 402 6 view .LVU120
  948. 403:deps//simpleserial/simpleserial.c **** {
  949. 404:deps//simpleserial/simpleserial.c **** putch(hex_lookup[output[i] >> 4 ]);
  950. 472 .loc 1 404 3 is_stmt 0 view .LVU121
  951. 473 000a 0C4F ldr r7, .L37
  952. 474 000c 651E subs r5, r4, #1
  953. 402:deps//simpleserial/simpleserial.c **** {
  954. 475 .loc 1 402 19 view .LVU122
  955. 476 000e C4F10104 rsb r4, r4, #1
  956. 477 .LVL41:
  957. 478 .L35:
  958. 402:deps//simpleserial/simpleserial.c **** {
  959. 479 .loc 1 402 19 is_stmt 1 discriminator 1 view .LVU123
  960. 480 0012 6319 adds r3, r4, r5
  961. 481 0014 9E42 cmp r6, r3
  962. 482 0016 04DC bgt .L36
  963. 483 .LBE10:
  964. 405:deps//simpleserial/simpleserial.c **** putch(hex_lookup[output[i] & 0xF]);
  965. 406:deps//simpleserial/simpleserial.c **** }
  966. 407:deps//simpleserial/simpleserial.c ****
  967. 408:deps//simpleserial/simpleserial.c **** // Write trailing '\n'
  968. 409:deps//simpleserial/simpleserial.c **** putch('\n');
  969. 484 .loc 1 409 2 view .LVU124
  970. 410:deps//simpleserial/simpleserial.c **** }
  971. 485 .loc 1 410 1 is_stmt 0 view .LVU125
  972. 486 0018 BDE8F840 pop {r3, r4, r5, r6, r7, lr}
  973. 487 .LCFI6:
  974. 488 .cfi_remember_state
  975. 489 .cfi_restore 14
  976. 490 .cfi_restore 7
  977. 491 .cfi_restore 6
  978. 492 .cfi_restore 5
  979. 493 .cfi_restore 4
  980. 494 .cfi_restore 3
  981. 495 .cfi_def_cfa_offset 0
  982. 409:deps//simpleserial/simpleserial.c **** }
  983. 496 .loc 1 409 2 view .LVU126
  984. 497 001c 0A20 movs r0, #10
  985. 498 001e FFF7FEBF b putch
  986. 499 .LVL42:
  987. 500 .L36:
  988. 501 .LCFI7:
  989. 502 .cfi_restore_state
  990. 503 .LBB11:
  991. 404:deps//simpleserial/simpleserial.c **** putch(hex_lookup[output[i] & 0xF]);
  992. 504 .loc 1 404 3 is_stmt 1 discriminator 3 view .LVU127
  993. 404:deps//simpleserial/simpleserial.c **** putch(hex_lookup[output[i] & 0xF]);
  994. 505 .loc 1 404 30 is_stmt 0 discriminator 3 view .LVU128
  995. 506 0022 15F8013F ldrb r3, [r5, #1]! @ zero_extendqisi2
  996. 507 0026 1B09 lsrs r3, r3, #4
  997. 404:deps//simpleserial/simpleserial.c **** putch(hex_lookup[output[i] & 0xF]);
  998. 508 .loc 1 404 3 discriminator 3 view .LVU129
  999. 509 0028 F85C ldrb r0, [r7, r3] @ zero_extendqisi2
  1000. 510 002a FFF7FEFF bl putch
  1001. 511 .LVL43:
  1002. 405:deps//simpleserial/simpleserial.c **** }
  1003. 512 .loc 1 405 3 is_stmt 1 discriminator 3 view .LVU130
  1004. 405:deps//simpleserial/simpleserial.c **** }
  1005. 513 .loc 1 405 30 is_stmt 0 discriminator 3 view .LVU131
  1006. 514 002e 2B78 ldrb r3, [r5] @ zero_extendqisi2
  1007. 515 0030 03F00F03 and r3, r3, #15
  1008. 405:deps//simpleserial/simpleserial.c **** }
  1009. 516 .loc 1 405 3 discriminator 3 view .LVU132
  1010. 517 0034 F85C ldrb r0, [r7, r3] @ zero_extendqisi2
  1011. 518 0036 FFF7FEFF bl putch
  1012. 519 .LVL44:
  1013. 402:deps//simpleserial/simpleserial.c **** {
  1014. 520 .loc 1 402 28 is_stmt 1 discriminator 3 view .LVU133
  1015. 521 003a EAE7 b .L35
  1016. 522 .L38:
  1017. 523 .align 2
  1018. 524 .L37:
  1019. 525 003c 00000000 .word .LANCHOR1
  1020. 526 .LBE11:
  1021. 527 .cfi_endproc
  1022. 528 .LFE9:
  1023. 530 .section .text.ss_num_commands,"ax",%progbits
  1024. 531 .align 1
  1025. 532 .global ss_num_commands
  1026. 533 .syntax unified
  1027. 534 .thumb
  1028. 535 .thumb_func
  1029. 536 .fpu softvfp
  1030. 538 ss_num_commands:
  1031. 539 .LVL45:
  1032. 540 .LFB2:
  1033. 239:deps//simpleserial/simpleserial.c **** uint8_t ncmds = num_commands & 0xFF;
  1034. 541 .loc 1 239 1 view -0
  1035. 542 .cfi_startproc
  1036. 543 @ args = 0, pretend = 0, frame = 8
  1037. 544 @ frame_needed = 0, uses_anonymous_args = 0
  1038. 240:deps//simpleserial/simpleserial.c **** simpleserial_put('r', 0x01, &ncmds);
  1039. 545 .loc 1 240 5 view .LVU135
  1040. 239:deps//simpleserial/simpleserial.c **** uint8_t ncmds = num_commands & 0xFF;
  1041. 546 .loc 1 239 1 is_stmt 0 view .LVU136
  1042. 547 0000 07B5 push {r0, r1, r2, lr}
  1043. 548 .LCFI8:
  1044. 549 .cfi_def_cfa_offset 16
  1045. 550 .cfi_offset 14, -4
  1046. 240:deps//simpleserial/simpleserial.c **** simpleserial_put('r', 0x01, &ncmds);
  1047. 551 .loc 1 240 13 view .LVU137
  1048. 552 0002 074B ldr r3, .L40
  1049. 241:deps//simpleserial/simpleserial.c **** return 0x00;
  1050. 553 .loc 1 241 5 view .LVU138
  1051. 554 0004 0DF10702 add r2, sp, #7
  1052. 240:deps//simpleserial/simpleserial.c **** simpleserial_put('r', 0x01, &ncmds);
  1053. 555 .loc 1 240 13 view .LVU139
  1054. 556 0008 1B68 ldr r3, [r3]
  1055. 557 000a 8DF80730 strb r3, [sp, #7]
  1056. 241:deps//simpleserial/simpleserial.c **** return 0x00;
  1057. 558 .loc 1 241 5 is_stmt 1 view .LVU140
  1058. 559 000e 0121 movs r1, #1
  1059. 560 .LVL46:
  1060. 241:deps//simpleserial/simpleserial.c **** return 0x00;
  1061. 561 .loc 1 241 5 is_stmt 0 view .LVU141
  1062. 562 0010 7220 movs r0, #114
  1063. 563 .LVL47:
  1064. 241:deps//simpleserial/simpleserial.c **** return 0x00;
  1065. 564 .loc 1 241 5 view .LVU142
  1066. 565 0012 FFF7FEFF bl simpleserial_put
  1067. 566 .LVL48:
  1068. 242:deps//simpleserial/simpleserial.c **** }
  1069. 567 .loc 1 242 5 is_stmt 1 view .LVU143
  1070. 243:deps//simpleserial/simpleserial.c ****
  1071. 568 .loc 1 243 1 is_stmt 0 view .LVU144
  1072. 569 0016 0020 movs r0, #0
  1073. 570 0018 03B0 add sp, sp, #12
  1074. 571 .LCFI9:
  1075. 572 .cfi_def_cfa_offset 4
  1076. 573 @ sp needed
  1077. 574 001a 5DF804FB ldr pc, [sp], #4
  1078. 575 .L41:
  1079. 576 001e 00BF .align 2
  1080. 577 .L40:
  1081. 578 0020 00000000 .word .LANCHOR0
  1082. 579 .cfi_endproc
  1083. 580 .LFE2:
  1084. 582 .section .text.ss_get_commands,"ax",%progbits
  1085. 583 .align 1
  1086. 584 .global ss_get_commands
  1087. 585 .syntax unified
  1088. 586 .thumb
  1089. 587 .thumb_func
  1090. 588 .fpu softvfp
  1091. 590 ss_get_commands:
  1092. 591 .LVL49:
  1093. 592 .LFB3:
  1094. 252:deps//simpleserial/simpleserial.c **** ss_cmd_repr repr_cmd_buf[MAX_SS_CMDS];
  1095. 593 .loc 1 252 1 is_stmt 1 view -0
  1096. 594 .cfi_startproc
  1097. 595 @ args = 0, pretend = 0, frame = 48
  1098. 596 @ frame_needed = 0, uses_anonymous_args = 0
  1099. 253:deps//simpleserial/simpleserial.c **** for (uint8_t i = 0; i < (num_commands & 0xFF); i++) {
  1100. 597 .loc 1 253 5 view .LVU146
  1101. 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c;
  1102. 598 .loc 1 254 5 view .LVU147
  1103. 599 .LBB12:
  1104. 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c;
  1105. 600 .loc 1 254 10 view .LVU148
  1106. 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c;
  1107. 601 .loc 1 254 10 is_stmt 0 view .LVU149
  1108. 602 .LBE12:
  1109. 252:deps//simpleserial/simpleserial.c **** ss_cmd_repr repr_cmd_buf[MAX_SS_CMDS];
  1110. 603 .loc 1 252 1 view .LVU150
  1111. 604 0000 70B5 push {r4, r5, r6, lr}
  1112. 605 .LCFI10:
  1113. 606 .cfi_def_cfa_offset 16
  1114. 607 .cfi_offset 4, -16
  1115. 608 .cfi_offset 5, -12
  1116. 609 .cfi_offset 6, -8
  1117. 610 .cfi_offset 14, -4
  1118. 611 .LBB13:
  1119. 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c;
  1120. 612 .loc 1 254 43 view .LVU151
  1121. 613 0002 124C ldr r4, .L45
  1122. 614 0004 2168 ldr r1, [r4]
  1123. 615 .LVL50:
  1124. 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c;
  1125. 616 .loc 1 254 43 view .LVU152
  1126. 617 .LBE13:
  1127. 252:deps//simpleserial/simpleserial.c **** ss_cmd_repr repr_cmd_buf[MAX_SS_CMDS];
  1128. 618 .loc 1 252 1 view .LVU153
  1129. 619 0006 8CB0 sub sp, sp, #48
  1130. 620 .LCFI11:
  1131. 621 .cfi_def_cfa_offset 64
  1132. 622 .LBB14:
  1133. 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c;
  1134. 623 .loc 1 254 43 view .LVU154
  1135. 624 0008 CDB2 uxtb r5, r1
  1136. 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c;
  1137. 625 .loc 1 254 5 view .LVU155
  1138. 626 000a 0020 movs r0, #0
  1139. 627 .LVL51:
  1140. 628 .L43:
  1141. 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c;
  1142. 629 .loc 1 254 27 is_stmt 1 discriminator 1 view .LVU156
  1143. 630 000c C3B2 uxtb r3, r0
  1144. 631 000e AB42 cmp r3, r5
  1145. 632 0010 00F10100 add r0, r0, #1
  1146. 633 .LVL52:
  1147. 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c;
  1148. 634 .loc 1 254 27 is_stmt 0 discriminator 1 view .LVU157
  1149. 635 0014 09DB blt .L44
  1150. 636 .LBE14:
  1151. 260:deps//simpleserial/simpleserial.c **** return 0x00;
  1152. 637 .loc 1 260 5 is_stmt 1 view .LVU158
  1153. 638 0016 01EB4101 add r1, r1, r1, lsl #1
  1154. 639 001a 6A46 mov r2, sp
  1155. 640 001c C9B2 uxtb r1, r1
  1156. 641 001e 7220 movs r0, #114
  1157. 642 0020 FFF7FEFF bl simpleserial_put
  1158. 643 .LVL53:
  1159. 261:deps//simpleserial/simpleserial.c **** }
  1160. 644 .loc 1 261 5 view .LVU159
  1161. 262:deps//simpleserial/simpleserial.c ****
  1162. 645 .loc 1 262 1 is_stmt 0 view .LVU160
  1163. 646 0024 0020 movs r0, #0
  1164. 647 0026 0CB0 add sp, sp, #48
  1165. 648 .LCFI12:
  1166. 649 .cfi_remember_state
  1167. 650 .cfi_def_cfa_offset 16
  1168. 651 @ sp needed
  1169. 652 0028 70BD pop {r4, r5, r6, pc}
  1170. 653 .LVL54:
  1171. 654 .L44:
  1172. 655 .LCFI13:
  1173. 656 .cfi_restore_state
  1174. 657 .LBB15:
  1175. 255:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].len = commands[i].len;
  1176. 658 .loc 1 255 9 is_stmt 1 discriminator 3 view .LVU161
  1177. 255:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].len = commands[i].len;
  1178. 659 .loc 1 255 27 is_stmt 0 discriminator 3 view .LVU162
  1179. 660 002a 03EB4302 add r2, r3, r3, lsl #1
  1180. 661 002e 3032 adds r2, r2, #48
  1181. 255:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].len = commands[i].len;
  1182. 662 .loc 1 255 40 discriminator 3 view .LVU163
  1183. 663 0030 04EB0313 add r3, r4, r3, lsl #4
  1184. 664 .LVL55:
  1185. 255:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].len = commands[i].len;
  1186. 665 .loc 1 255 27 discriminator 3 view .LVU164
  1187. 666 0034 6A44 add r2, sp, r2
  1188. 667 0036 1E79 ldrb r6, [r3, #4] @ zero_extendqisi2
  1189. 668 0038 02F8306C strb r6, [r2, #-48]
  1190. 256:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].flags = commands[i].flags;
  1191. 669 .loc 1 256 9 is_stmt 1 discriminator 3 view .LVU165
  1192. 256:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].flags = commands[i].flags;
  1193. 670 .loc 1 256 29 is_stmt 0 discriminator 3 view .LVU166
  1194. 671 003c 9E68 ldr r6, [r3, #8]
  1195. 257:deps//simpleserial/simpleserial.c **** }
  1196. 672 .loc 1 257 31 discriminator 3 view .LVU167
  1197. 673 003e 1B7C ldrb r3, [r3, #16] @ zero_extendqisi2
  1198. 256:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].flags = commands[i].flags;
  1199. 674 .loc 1 256 29 discriminator 3 view .LVU168
  1200. 675 0040 02F82F6C strb r6, [r2, #-47]
  1201. 257:deps//simpleserial/simpleserial.c **** }
  1202. 676 .loc 1 257 9 is_stmt 1 discriminator 3 view .LVU169
  1203. 257:deps//simpleserial/simpleserial.c **** }
  1204. 677 .loc 1 257 31 is_stmt 0 discriminator 3 view .LVU170
  1205. 678 0044 02F82E3C strb r3, [r2, #-46]
  1206. 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c;
  1207. 679 .loc 1 254 53 is_stmt 1 discriminator 3 view .LVU171
  1208. 680 .LVL56:
  1209. 254:deps//simpleserial/simpleserial.c **** repr_cmd_buf[i].c = commands[i].c;
  1210. 681 .loc 1 254 53 is_stmt 0 discriminator 3 view .LVU172
  1211. 682 0048 E0E7 b .L43
  1212. 683 .L46:
  1213. 684 004a 00BF .align 2
  1214. 685 .L45:
  1215. 686 004c 00000000 .word .LANCHOR0
  1216. 687 .LBE15:
  1217. 688 .cfi_endproc
  1218. 689 .LFE3:
  1219. 691 .section .text.simpleserial_get,"ax",%progbits
  1220. 692 .align 1
  1221. 693 .global simpleserial_get
  1222. 694 .syntax unified
  1223. 695 .thumb
  1224. 696 .thumb_func
  1225. 697 .fpu softvfp
  1226. 699 simpleserial_get:
  1227. 700 .LFB8:
  1228. 333:deps//simpleserial/simpleserial.c **** char ascii_buf[2*MAX_SS_LEN];
  1229. 701 .loc 1 333 1 is_stmt 1 view -0
  1230. 702 .cfi_startproc
  1231. 703 @ args = 0, pretend = 0, frame = 584
  1232. 704 @ frame_needed = 0, uses_anonymous_args = 0
  1233. 334:deps//simpleserial/simpleserial.c **** uint8_t data_buf[MAX_SS_LEN];
  1234. 705 .loc 1 334 2 view .LVU174
  1235. 335:deps//simpleserial/simpleserial.c **** char c;
  1236. 706 .loc 1 335 2 view .LVU175
  1237. 336:deps//simpleserial/simpleserial.c ****
  1238. 707 .loc 1 336 2 view .LVU176
  1239. 339:deps//simpleserial/simpleserial.c ****
  1240. 708 .loc 1 339 2 view .LVU177
  1241. 333:deps//simpleserial/simpleserial.c **** char ascii_buf[2*MAX_SS_LEN];
  1242. 709 .loc 1 333 1 is_stmt 0 view .LVU178
  1243. 710 0000 2DE9F041 push {r4, r5, r6, r7, r8, lr}
  1244. 711 .LCFI14:
  1245. 712 .cfi_def_cfa_offset 24
  1246. 713 .cfi_offset 4, -24
  1247. 714 .cfi_offset 5, -20
  1248. 715 .cfi_offset 6, -16
  1249. 716 .cfi_offset 7, -12
  1250. 717 .cfi_offset 8, -8
  1251. 718 .cfi_offset 14, -4
  1252. 342:deps//simpleserial/simpleserial.c **** {
  1253. 719 .loc 1 342 19 view .LVU179
  1254. 720 0004 2D4D ldr r5, .L71
  1255. 333:deps//simpleserial/simpleserial.c **** char ascii_buf[2*MAX_SS_LEN];
  1256. 721 .loc 1 333 1 view .LVU180
  1257. 722 0006 ADF5127D sub sp, sp, #584
  1258. 723 .LCFI15:
  1259. 724 .cfi_def_cfa_offset 608
  1260. 339:deps//simpleserial/simpleserial.c ****
  1261. 725 .loc 1 339 6 view .LVU181
  1262. 726 000a FFF7FEFF bl getch
  1263. 727 .LVL57:
  1264. 341:deps//simpleserial/simpleserial.c **** for(cmd = 0; cmd < num_commands; cmd++)
  1265. 728 .loc 1 341 2 is_stmt 1 view .LVU182
  1266. 342:deps//simpleserial/simpleserial.c **** {
  1267. 729 .loc 1 342 2 view .LVU183
  1268. 342:deps//simpleserial/simpleserial.c **** {
  1269. 730 .loc 1 342 19 is_stmt 0 view .LVU184
  1270. 731 000e 2A46 mov r2, r5
  1271. 342:deps//simpleserial/simpleserial.c **** {
  1272. 732 .loc 1 342 10 view .LVU185
  1273. 733 0010 0023 movs r3, #0
  1274. 342:deps//simpleserial/simpleserial.c **** {
  1275. 734 .loc 1 342 19 view .LVU186
  1276. 735 0012 52F8041B ldr r1, [r2], #4
  1277. 736 .LVL58:
  1278. 737 .L48:
  1279. 342:deps//simpleserial/simpleserial.c **** {
  1280. 738 .loc 1 342 19 is_stmt 1 discriminator 1 view .LVU187
  1281. 739 0016 9942 cmp r1, r3
  1282. 740 0018 40DC bgt .L50
  1283. 349:deps//simpleserial/simpleserial.c **** return;
  1284. 741 .loc 1 349 2 view .LVU188
  1285. 349:deps//simpleserial/simpleserial.c **** return;
  1286. 742 .loc 1 349 4 is_stmt 0 view .LVU189
  1287. 743 001a 3BD0 beq .L47
  1288. 744 .L49:
  1289. 353:deps//simpleserial/simpleserial.c **** {
  1290. 745 .loc 1 353 2 is_stmt 1 view .LVU190
  1291. 353:deps//simpleserial/simpleserial.c **** {
  1292. 746 .loc 1 353 20 is_stmt 0 view .LVU191
  1293. 747 001c 05EB0314 add r4, r5, r3, lsl #4
  1294. 748 0020 1E01 lsls r6, r3, #4
  1295. 353:deps//simpleserial/simpleserial.c **** {
  1296. 749 .loc 1 353 5 view .LVU192
  1297. 750 0022 237C ldrb r3, [r4, #16] @ zero_extendqisi2
  1298. 751 .LVL59:
  1299. 353:deps//simpleserial/simpleserial.c **** {
  1300. 752 .loc 1 353 5 view .LVU193
  1301. 753 0024 DB07 lsls r3, r3, #31
  1302. 754 0026 13D5 bpl .L52
  1303. 755 .LBB16:
  1304. 355:deps//simpleserial/simpleserial.c **** char buff[2];
  1305. 756 .loc 1 355 3 is_stmt 1 view .LVU194
  1306. 355:deps//simpleserial/simpleserial.c **** char buff[2];
  1307. 757 .loc 1 355 11 is_stmt 0 view .LVU195
  1308. 758 0028 0023 movs r3, #0
  1309. 759 002a 8DF80830 strb r3, [sp, #8]
  1310. 356:deps//simpleserial/simpleserial.c **** buff[0] = getch();
  1311. 760 .loc 1 356 3 is_stmt 1 view .LVU196
  1312. 357:deps//simpleserial/simpleserial.c **** buff[1] = getch();
  1313. 761 .loc 1 357 3 view .LVU197
  1314. 357:deps//simpleserial/simpleserial.c **** buff[1] = getch();
  1315. 762 .loc 1 357 13 is_stmt 0 view .LVU198
  1316. 763 002e FFF7FEFF bl getch
  1317. 764 .LVL60:
  1318. 357:deps//simpleserial/simpleserial.c **** buff[1] = getch();
  1319. 765 .loc 1 357 11 view .LVU199
  1320. 766 0032 8DF8C800 strb r0, [sp, #200]
  1321. 358:deps//simpleserial/simpleserial.c **** if (hex_decode(1, buff, &l))
  1322. 767 .loc 1 358 3 is_stmt 1 view .LVU200
  1323. 358:deps//simpleserial/simpleserial.c **** if (hex_decode(1, buff, &l))
  1324. 768 .loc 1 358 13 is_stmt 0 view .LVU201
  1325. 769 0036 FFF7FEFF bl getch
  1326. 770 .LVL61:
  1327. 359:deps//simpleserial/simpleserial.c **** return;
  1328. 771 .loc 1 359 7 view .LVU202
  1329. 772 003a 02AA add r2, sp, #8
  1330. 358:deps//simpleserial/simpleserial.c **** if (hex_decode(1, buff, &l))
  1331. 773 .loc 1 358 11 view .LVU203
  1332. 774 003c 8DF8C900 strb r0, [sp, #201]
  1333. 359:deps//simpleserial/simpleserial.c **** return;
  1334. 775 .loc 1 359 3 is_stmt 1 view .LVU204
  1335. 359:deps//simpleserial/simpleserial.c **** return;
  1336. 776 .loc 1 359 7 is_stmt 0 view .LVU205
  1337. 777 0040 32A9 add r1, sp, #200
  1338. 778 0042 0120 movs r0, #1
  1339. 779 0044 FFF7FEFF bl hex_decode
  1340. 780 .LVL62:
  1341. 359:deps//simpleserial/simpleserial.c **** return;
  1342. 781 .loc 1 359 6 view .LVU206
  1343. 782 0048 20BB cbnz r0, .L47
  1344. 361:deps//simpleserial/simpleserial.c **** }
  1345. 783 .loc 1 361 3 is_stmt 1 view .LVU207
  1346. 361:deps//simpleserial/simpleserial.c **** }
  1347. 784 .loc 1 361 21 is_stmt 0 view .LVU208
  1348. 785 004a 9DF80830 ldrb r3, [sp, #8] @ zero_extendqisi2
  1349. 786 004e A360 str r3, [r4, #8]
  1350. 787 .L52:
  1351. 788 0050 32AF add r7, sp, #200
  1352. 789 .LBE16:
  1353. 342:deps//simpleserial/simpleserial.c **** {
  1354. 790 .loc 1 342 10 discriminator 1 view .LVU209
  1355. 791 0052 0024 movs r4, #0
  1356. 792 .LBB17:
  1357. 365:deps//simpleserial/simpleserial.c **** {
  1358. 793 .loc 1 365 36 discriminator 1 view .LVU210
  1359. 794 0054 05EB0608 add r8, r5, r6
  1360. 795 .L55:
  1361. 796 .LVL63:
  1362. 365:deps//simpleserial/simpleserial.c **** {
  1363. 797 .loc 1 365 19 is_stmt 1 discriminator 1 view .LVU211
  1364. 365:deps//simpleserial/simpleserial.c **** {
  1365. 798 .loc 1 365 22 is_stmt 0 discriminator 1 view .LVU212
  1366. 799 0058 D8F80830 ldr r3, [r8, #8]
  1367. 365:deps//simpleserial/simpleserial.c **** {
  1368. 800 .loc 1 365 19 discriminator 1 view .LVU213
  1369. 801 005c B4EB430F cmp r4, r3, lsl #1
  1370. 802 0060 22D3 bcc .L56
  1371. 803 .LBE17:
  1372. 377:deps//simpleserial/simpleserial.c **** if(c != '\n' && c != '\r')
  1373. 804 .loc 1 377 2 is_stmt 1 view .LVU214
  1374. 377:deps//simpleserial/simpleserial.c **** if(c != '\n' && c != '\r')
  1375. 805 .loc 1 377 6 is_stmt 0 view .LVU215
  1376. 806 0062 FFF7FEFF bl getch
  1377. 807 .LVL64:
  1378. 378:deps//simpleserial/simpleserial.c **** return;
  1379. 808 .loc 1 378 2 is_stmt 1 view .LVU216
  1380. 378:deps//simpleserial/simpleserial.c **** return;
  1381. 809 .loc 1 378 4 is_stmt 0 view .LVU217
  1382. 810 0066 0A28 cmp r0, #10
  1383. 811 0068 01D0 beq .L57
  1384. 378:deps//simpleserial/simpleserial.c **** return;
  1385. 812 .loc 1 378 15 discriminator 1 view .LVU218
  1386. 813 006a 0D28 cmp r0, #13
  1387. 814 006c 12D1 bne .L47
  1388. 815 .L57:
  1389. 383:deps//simpleserial/simpleserial.c **** return;
  1390. 816 .loc 1 383 2 is_stmt 1 view .LVU219
  1391. 383:deps//simpleserial/simpleserial.c **** return;
  1392. 817 .loc 1 383 29 is_stmt 0 view .LVU220
  1393. 818 006e 3544 add r5, r5, r6
  1394. 383:deps//simpleserial/simpleserial.c **** return;
  1395. 819 .loc 1 383 5 view .LVU221
  1396. 820 0070 02AA add r2, sp, #8
  1397. 383:deps//simpleserial/simpleserial.c **** return;
  1398. 821 .loc 1 383 29 view .LVU222
  1399. 822 0072 AC68 ldr r4, [r5, #8]
  1400. 823 .LVL65:
  1401. 383:deps//simpleserial/simpleserial.c **** return;
  1402. 824 .loc 1 383 5 view .LVU223
  1403. 825 0074 32A9 add r1, sp, #200
  1404. 826 0076 2046 mov r0, r4
  1405. 827 .LVL66:
  1406. 383:deps//simpleserial/simpleserial.c **** return;
  1407. 828 .loc 1 383 5 view .LVU224
  1408. 829 0078 FFF7FEFF bl hex_decode
  1409. 830 .LVL67:
  1410. 383:deps//simpleserial/simpleserial.c **** return;
  1411. 831 .loc 1 383 4 view .LVU225
  1412. 832 007c 50B9 cbnz r0, .L47
  1413. 387:deps//simpleserial/simpleserial.c **** ret[0] = commands[cmd].fp(data_buf, commands[cmd].len);
  1414. 833 .loc 1 387 2 is_stmt 1 view .LVU226
  1415. 388:deps//simpleserial/simpleserial.c ****
  1416. 834 .loc 1 388 2 view .LVU227
  1417. 388:deps//simpleserial/simpleserial.c ****
  1418. 835 .loc 1 388 11 is_stmt 0 view .LVU228
  1419. 836 007e E1B2 uxtb r1, r4
  1420. 837 0080 EB68 ldr r3, [r5, #12]
  1421. 838 0082 02A8 add r0, sp, #8
  1422. 839 0084 9847 blx r3
  1423. 840 .LVL68:
  1424. 392:deps//simpleserial/simpleserial.c **** #endif
  1425. 841 .loc 1 392 2 view .LVU229
  1426. 842 0086 01AA add r2, sp, #4
  1427. 388:deps//simpleserial/simpleserial.c ****
  1428. 843 .loc 1 388 9 view .LVU230
  1429. 844 0088 8DF80400 strb r0, [sp, #4]
  1430. 392:deps//simpleserial/simpleserial.c **** #endif
  1431. 845 .loc 1 392 2 is_stmt 1 view .LVU231
  1432. 846 008c 0121 movs r1, #1
  1433. 847 008e 7A20 movs r0, #122
  1434. 848 0090 FFF7FEFF bl simpleserial_put
  1435. 849 .LVL69:
  1436. 850 .L47:
  1437. 394:deps//simpleserial/simpleserial.c ****
  1438. 851 .loc 1 394 1 is_stmt 0 view .LVU232
  1439. 852 0094 0DF5127D add sp, sp, #584
  1440. 853 .LCFI16:
  1441. 854 .cfi_remember_state
  1442. 855 .cfi_def_cfa_offset 24
  1443. 856 @ sp needed
  1444. 857 0098 BDE8F081 pop {r4, r5, r6, r7, r8, pc}
  1445. 858 .LVL70:
  1446. 859 .L50:
  1447. 860 .LCFI17:
  1448. 861 .cfi_restore_state
  1449. 344:deps//simpleserial/simpleserial.c **** break;
  1450. 862 .loc 1 344 3 is_stmt 1 view .LVU233
  1451. 344:deps//simpleserial/simpleserial.c **** break;
  1452. 863 .loc 1 344 19 is_stmt 0 view .LVU234
  1453. 864 009c 1C01 lsls r4, r3, #4
  1454. 344:deps//simpleserial/simpleserial.c **** break;
  1455. 865 .loc 1 344 5 view .LVU235
  1456. 866 009e A45C ldrb r4, [r4, r2] @ zero_extendqisi2
  1457. 867 00a0 8442 cmp r4, r0
  1458. 868 00a2 BBD0 beq .L49
  1459. 342:deps//simpleserial/simpleserial.c **** {
  1460. 869 .loc 1 342 38 is_stmt 1 discriminator 2 view .LVU236
  1461. 870 00a4 0133 adds r3, r3, #1
  1462. 871 .LVL71:
  1463. 342:deps//simpleserial/simpleserial.c **** {
  1464. 872 .loc 1 342 38 is_stmt 0 discriminator 2 view .LVU237
  1465. 873 00a6 B6E7 b .L48
  1466. 874 .LVL72:
  1467. 875 .L56:
  1468. 876 .LBB18:
  1469. 367:deps//simpleserial/simpleserial.c ****
  1470. 877 .loc 1 367 3 is_stmt 1 view .LVU238
  1471. 367:deps//simpleserial/simpleserial.c ****
  1472. 878 .loc 1 367 7 is_stmt 0 view .LVU239
  1473. 879 00a8 FFF7FEFF bl getch
  1474. 880 .LVL73:
  1475. 370:deps//simpleserial/simpleserial.c **** return;
  1476. 881 .loc 1 370 3 is_stmt 1 view .LVU240
  1477. 370:deps//simpleserial/simpleserial.c **** return;
  1478. 882 .loc 1 370 5 is_stmt 0 view .LVU241
  1479. 883 00ac 0A28 cmp r0, #10
  1480. 884 00ae F1D0 beq .L47
  1481. 370:deps//simpleserial/simpleserial.c **** return;
  1482. 885 .loc 1 370 16 discriminator 1 view .LVU242
  1483. 886 00b0 0D28 cmp r0, #13
  1484. 887 00b2 EFD0 beq .L47
  1485. 373:deps//simpleserial/simpleserial.c **** }
  1486. 888 .loc 1 373 3 is_stmt 1 discriminator 2 view .LVU243
  1487. 373:deps//simpleserial/simpleserial.c **** }
  1488. 889 .loc 1 373 16 is_stmt 0 discriminator 2 view .LVU244
  1489. 890 00b4 07F8010B strb r0, [r7], #1
  1490. 365:deps//simpleserial/simpleserial.c **** {
  1491. 891 .loc 1 365 43 is_stmt 1 discriminator 2 view .LVU245
  1492. 892 00b8 0134 adds r4, r4, #1
  1493. 893 .LVL74:
  1494. 365:deps//simpleserial/simpleserial.c **** {
  1495. 894 .loc 1 365 43 is_stmt 0 discriminator 2 view .LVU246
  1496. 895 00ba CDE7 b .L55
  1497. 896 .L72:
  1498. 897 .align 2
  1499. 898 .L71:
  1500. 899 00bc 00000000 .word .LANCHOR0
  1501. 900 .LBE18:
  1502. 901 .cfi_endproc
  1503. 902 .LFE8:
  1504. 904 .section .rodata
  1505. 905 .set .LANCHOR1,. + 0
  1506. 908 hex_lookup:
  1507. 909 0000 30313233 .ascii "0123456789ABCDEF"
  1508. 909 34353637
  1509. 909 38394142
  1510. 909 43444546
  1511. 910 .bss
  1512. 911 .align 2
  1513. 912 .set .LANCHOR0,. + 0
  1514. 915 num_commands:
  1515. 916 0000 00000000 .space 4
  1516. 919 commands:
  1517. 920 0004 00000000 .space 256
  1518. 920 00000000
  1519. 920 00000000
  1520. 920 00000000
  1521. 920 00000000
  1522. 921 .text
  1523. 922 .Letext0:
  1524. 923 .file 2 "/usr/arm-none-eabi/include/machine/_default_types.h"
  1525. 924 .file 3 "/usr/arm-none-eabi/include/sys/_stdint.h"
  1526. 925 .file 4 "deps//hal/stm32f3/stm32f3_hal.h"
  1527. DEFINED SYMBOLS
  1528. *ABS*:0000000000000000 simpleserial.c
  1529. /tmp/ccs4vduc.s:16 .text.check_version:0000000000000000 $t
  1530. /tmp/ccs4vduc.s:24 .text.check_version:0000000000000000 check_version
  1531. /tmp/ccs4vduc.s:43 .text.ss_crc:0000000000000000 $t
  1532. /tmp/ccs4vduc.s:50 .text.ss_crc:0000000000000000 ss_crc
  1533. /tmp/ccs4vduc.s:116 .text.hex_decode:0000000000000000 $t
  1534. /tmp/ccs4vduc.s:123 .text.hex_decode:0000000000000000 hex_decode
  1535. /tmp/ccs4vduc.s:289 .text.simpleserial_addcmd_flags:0000000000000000 $t
  1536. /tmp/ccs4vduc.s:296 .text.simpleserial_addcmd_flags:0000000000000000 simpleserial_addcmd_flags
  1537. /tmp/ccs4vduc.s:355 .text.simpleserial_addcmd_flags:0000000000000028 $d
  1538. /tmp/ccs4vduc.s:360 .text.simpleserial_addcmd:0000000000000000 $t
  1539. /tmp/ccs4vduc.s:367 .text.simpleserial_addcmd:0000000000000000 simpleserial_addcmd
  1540. /tmp/ccs4vduc.s:385 .text.simpleserial_init:0000000000000000 $t
  1541. /tmp/ccs4vduc.s:392 .text.simpleserial_init:0000000000000000 simpleserial_init
  1542. /tmp/ccs4vduc.s:431 .text.simpleserial_init:0000000000000020 $d
  1543. /tmp/ccs4vduc.s:590 .text.ss_get_commands:0000000000000000 ss_get_commands
  1544. /tmp/ccs4vduc.s:538 .text.ss_num_commands:0000000000000000 ss_num_commands
  1545. /tmp/ccs4vduc.s:438 .text.simpleserial_put:0000000000000000 $t
  1546. /tmp/ccs4vduc.s:445 .text.simpleserial_put:0000000000000000 simpleserial_put
  1547. /tmp/ccs4vduc.s:525 .text.simpleserial_put:000000000000003c $d
  1548. /tmp/ccs4vduc.s:531 .text.ss_num_commands:0000000000000000 $t
  1549. /tmp/ccs4vduc.s:578 .text.ss_num_commands:0000000000000020 $d
  1550. /tmp/ccs4vduc.s:583 .text.ss_get_commands:0000000000000000 $t
  1551. /tmp/ccs4vduc.s:686 .text.ss_get_commands:000000000000004c $d
  1552. /tmp/ccs4vduc.s:692 .text.simpleserial_get:0000000000000000 $t
  1553. /tmp/ccs4vduc.s:699 .text.simpleserial_get:0000000000000000 simpleserial_get
  1554. /tmp/ccs4vduc.s:899 .text.simpleserial_get:00000000000000bc $d
  1555. /tmp/ccs4vduc.s:908 .rodata:0000000000000000 hex_lookup
  1556. /tmp/ccs4vduc.s:911 .bss:0000000000000000 $d
  1557. /tmp/ccs4vduc.s:915 .bss:0000000000000000 num_commands
  1558. /tmp/ccs4vduc.s:919 .bss:0000000000000004 commands
  1559. UNDEFINED SYMBOLS
  1560. putch
  1561. getch