iic.ls 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. 1 ; C Compiler for STM8 (COSMIC Software)
  2. 2 ; Parser V4.8.32 - 23 Mar 2010
  3. 3 ; Generator V4.3.4 - 23 Mar 2010
  4. 2727 ; 29 void IIC_Init(void) {
  5. 2729 switch .text
  6. 2730 0000 _IIC_Init:
  7. 2734 ; 35 I2C_CR1 = 0x00;
  8. 2736 0000 725f5210 clr _I2C_CR1
  9. 2737 ; 37 I2C_FREQR = 8;
  10. 2739 0004 35085212 mov _I2C_FREQR,#8
  11. 2740 ; 40 I2C_CCRL = 40;
  12. 2742 0008 3528521b mov _I2C_CCRL,#40
  13. 2743 ; 41 I2C_CCRH = 0;
  14. 2745 000c 725f521c clr _I2C_CCRH
  15. 2746 ; 43 I2C_TRISER = 9;
  16. 2748 0010 3509521d mov _I2C_TRISER,#9
  17. 2749 ; 45 I2C_CR1 = 0x01;
  18. 2751 0014 35015210 mov _I2C_CR1,#1
  19. 2752 ; 47 I2C_OARL = (SLAVE_ADDRESS << 1);
  20. 2754 0018 35a25213 mov _I2C_OARL,#162
  21. 2755 ; 48 I2C_OARH |= 0x40;
  22. 2757 001c 721c5214 bset _I2C_OARH,#6
  23. 2758 ; 50 I2C_CR2 |= 1 << 2;
  24. 2760 0020 72145211 bset _I2C_CR2,#2
  25. 2761 ; 52 I2C_ITR = 0x07;
  26. 2763 0024 3507521a mov _I2C_ITR,#7
  27. 2764 ; 53 }
  28. 2767 0028 81 ret
  29. 2838 ; 62 int TempCalculate(uint Rv,int B,int Revise,int BasicRx)
  30. 2838 ; 63 {
  31. 2839 switch .text
  32. 2840 0029 _TempCalculate:
  33. 2842 0029 89 pushw x
  34. 2843 002a 5208 subw sp,#8
  35. 2844 00000008 OFST: set 8
  36. 2847 ; 66 Rx = Rv * 1.0 / BasicRx;
  37. 2849 002c 1e11 ldw x,(OFST+9,sp)
  38. 2850 002e cd0000 call c_itof
  39. 2852 0031 96 ldw x,sp
  40. 2853 0032 1c0001 addw x,#OFST-7
  41. 2854 0035 cd0000 call c_rtol
  42. 2856 0038 1e09 ldw x,(OFST+1,sp)
  43. 2857 003a cd0000 call c_uitof
  44. 2859 003d ae000c ldw x,#L7671
  45. 2860 0040 cd0000 call c_fmul
  46. 2862 0043 96 ldw x,sp
  47. 2863 0044 1c0001 addw x,#OFST-7
  48. 2864 0047 cd0000 call c_fdiv
  49. 2866 004a 96 ldw x,sp
  50. 2867 004b 1c0005 addw x,#OFST-3
  51. 2868 004e cd0000 call c_rtol
  52. 2870 ; 68 Rx = log(Rx);
  53. 2872 0051 1e07 ldw x,(OFST-1,sp)
  54. 2873 0053 89 pushw x
  55. 2874 0054 1e07 ldw x,(OFST-1,sp)
  56. 2875 0056 89 pushw x
  57. 2876 0057 cd0000 call _log
  58. 2878 005a 5b04 addw sp,#4
  59. 2879 005c 96 ldw x,sp
  60. 2880 005d 1c0005 addw x,#OFST-3
  61. 2881 0060 cd0000 call c_rtol
  62. 2883 ; 70 Rx = Rx / B;
  63. 2885 0063 1e0d ldw x,(OFST+5,sp)
  64. 2886 0065 cd0000 call c_itof
  65. 2888 0068 96 ldw x,sp
  66. 2889 0069 1c0005 addw x,#OFST-3
  67. 2890 006c cd0000 call c_fgdiv
  68. 2892 ; 71 Rx = 1/(Rx+0.003354);
  69. 2894 006f 96 ldw x,sp
  70. 2895 0070 1c0005 addw x,#OFST-3
  71. 2896 0073 cd0000 call c_ltor
  72. 2898 0076 ae0008 ldw x,#L7771
  73. 2899 0079 cd0000 call c_fadd
  74. 2901 007c 96 ldw x,sp
  75. 2902 007d 1c0001 addw x,#OFST-7
  76. 2903 0080 cd0000 call c_rtol
  77. 2905 0083 a601 ld a,#1
  78. 2906 0085 cd0000 call c_ctof
  79. 2908 0088 96 ldw x,sp
  80. 2909 0089 1c0001 addw x,#OFST-7
  81. 2910 008c cd0000 call c_fdiv
  82. 2912 008f 96 ldw x,sp
  83. 2913 0090 1c0005 addw x,#OFST-3
  84. 2914 0093 cd0000 call c_rtol
  85. 2916 ; 74 Rx = Rx - 273.13;
  86. 2918 0096 ae0004 ldw x,#L7002
  87. 2919 0099 cd0000 call c_ltor
  88. 2921 009c 96 ldw x,sp
  89. 2922 009d 1c0005 addw x,#OFST-3
  90. 2923 00a0 cd0000 call c_fgsub
  91. 2925 ; 75 Rx = Rx + Revise;
  92. 2927 00a3 1e0f ldw x,(OFST+7,sp)
  93. 2928 00a5 cd0000 call c_itof
  94. 2930 00a8 96 ldw x,sp
  95. 2931 00a9 1c0005 addw x,#OFST-3
  96. 2932 00ac cd0000 call c_fgadd
  97. 2934 ; 77 return (int)(Rx+0.5);
  98. 2936 00af 96 ldw x,sp
  99. 2937 00b0 1c0005 addw x,#OFST-3
  100. 2938 00b3 cd0000 call c_ltor
  101. 2940 00b6 ae0000 ldw x,#L7102
  102. 2941 00b9 cd0000 call c_fadd
  103. 2943 00bc cd0000 call c_ftoi
  104. 2947 00bf 5b0a addw sp,#10
  105. 2948 00c1 81 ret
  106. 3003 ; 89 void i2c_send(uchar *dat,uchar len){
  107. 3004 switch .text
  108. 3005 00c2 _i2c_send:
  109. 3007 00c2 89 pushw x
  110. 3008 00c3 88 push a
  111. 3009 00000001 OFST: set 1
  112. 3012 ; 91 dat_len = len;
  113. 3014 00c4 7b06 ld a,(OFST+5,sp)
  114. 3015 00c6 b723 ld _dat_len,a
  115. 3016 ; 92 for(i=0;i<len;i++){
  116. 3018 00c8 0f01 clr (OFST+0,sp)
  117. 3020 00ca 2016 jra L5502
  118. 3021 00cc L1502:
  119. 3022 ; 93 i2c_buffer[i] = dat[i];
  120. 3024 00cc 7b01 ld a,(OFST+0,sp)
  121. 3025 00ce 5f clrw x
  122. 3026 00cf 97 ld xl,a
  123. 3027 00d0 89 pushw x
  124. 3028 00d1 7b04 ld a,(OFST+3,sp)
  125. 3029 00d3 97 ld xl,a
  126. 3030 00d4 7b05 ld a,(OFST+4,sp)
  127. 3031 00d6 1b03 add a,(OFST+2,sp)
  128. 3032 00d8 2401 jrnc L21
  129. 3033 00da 5c incw x
  130. 3034 00db L21:
  131. 3035 00db 02 rlwa x,a
  132. 3036 00dc f6 ld a,(x)
  133. 3037 00dd 85 popw x
  134. 3038 00de e702 ld (_i2c_buffer,x),a
  135. 3039 ; 92 for(i=0;i<len;i++){
  136. 3041 00e0 0c01 inc (OFST+0,sp)
  137. 3042 00e2 L5502:
  138. 3045 00e2 7b01 ld a,(OFST+0,sp)
  139. 3046 00e4 1106 cp a,(OFST+5,sp)
  140. 3047 00e6 25e4 jrult L1502
  141. 3048 ; 95 }
  142. 3051 00e8 5b03 addw sp,#3
  143. 3052 00ea 81 ret
  144. 3098 ; 97 uchar i2c_recv(uchar *dat){
  145. 3099 switch .text
  146. 3100 00eb _i2c_recv:
  147. 3102 00eb 89 pushw x
  148. 3103 00ec 88 push a
  149. 3104 00000001 OFST: set 1
  150. 3107 ; 99 for(i=2;i<i2c_idx;i++) {
  151. 3109 00ed a602 ld a,#2
  152. 3110 00ef 6b01 ld (OFST+0,sp),a
  153. 3112 00f1 2015 jra L7012
  154. 3113 00f3 L3012:
  155. 3114 ; 100 dat[i-2] = i2c_buffer[i];
  156. 3116 00f3 7b01 ld a,(OFST+0,sp)
  157. 3117 00f5 5f clrw x
  158. 3118 00f6 97 ld xl,a
  159. 3119 00f7 5a decw x
  160. 3120 00f8 5a decw x
  161. 3121 00f9 72fb02 addw x,(OFST+1,sp)
  162. 3122 00fc 7b01 ld a,(OFST+0,sp)
  163. 3123 00fe 905f clrw y
  164. 3124 0100 9097 ld yl,a
  165. 3125 0102 90e602 ld a,(_i2c_buffer,y)
  166. 3126 0105 f7 ld (x),a
  167. 3127 ; 99 for(i=2;i<i2c_idx;i++) {
  168. 3129 0106 0c01 inc (OFST+0,sp)
  169. 3130 0108 L7012:
  170. 3133 0108 7b01 ld a,(OFST+0,sp)
  171. 3134 010a b124 cp a,_i2c_idx
  172. 3135 010c 25e5 jrult L3012
  173. 3136 ; 102 return i2c_idx;
  174. 3138 010e b624 ld a,_i2c_idx
  175. 3141 0110 5b03 addw sp,#3
  176. 3142 0112 81 ret
  177. 3201 ; 116 @svlreg @far @interrupt void I2C_EVENT_IRQ(void) {
  178. 3203 switch .text
  179. 3204 0113 f_I2C_EVENT_IRQ:
  180. 3206 00000001 OFST: set 1
  181. 3207 0113 3b0002 push c_x+2
  182. 3208 0116 be00 ldw x,c_x
  183. 3209 0118 89 pushw x
  184. 3210 0119 3b0002 push c_y+2
  185. 3211 011c be00 ldw x,c_y
  186. 3212 011e 89 pushw x
  187. 3213 011f be02 ldw x,c_lreg+2
  188. 3214 0121 89 pushw x
  189. 3215 0122 be00 ldw x,c_lreg
  190. 3216 0124 89 pushw x
  191. 3217 0125 88 push a
  192. 3220 ; 119 if (I2C_SR2 & (I2C_SR2_WUFH | I2C_SR2_OVR | I2C_SR2_ARLO | I2C_SR2_BERR)) {
  193. 3222 0126 c65218 ld a,_I2C_SR2
  194. 3223 0129 a52b bcp a,#43
  195. 3224 012b 270a jreq L1612
  196. 3225 ; 121 I2C_SR2 = 0;
  197. 3227 012d 725f5218 clr _I2C_SR2
  198. 3228 ; 123 I2C_CR2 |= I2C_CR2_STOP;
  199. 3230 0131 72125211 bset _I2C_CR2,#1
  200. 3231 ; 124 return;
  201. 3233 0135 2010 jra L04
  202. 3234 0137 L1612:
  203. 3235 ; 127 if (I2C_SR1 & I2C_SR1_ADDR) {
  204. 3237 0137 c65217 ld a,_I2C_SR1
  205. 3238 013a a502 bcp a,#2
  206. 3239 013c 271d jreq L3612
  207. 3240 ; 129 temp = I2C_SR3;
  208. 3242 013e c65219 ld a,_I2C_SR3
  209. 3243 ; 130 i2c_busy = 1;
  210. 3245 0141 35010022 mov _i2c_busy,#1
  211. 3246 ; 131 i2c_idx = 0;
  212. 3248 0145 3f24 clr _i2c_idx
  213. 3249 ; 132 return;
  214. 3250 0147 L04:
  215. 3253 0147 84 pop a
  216. 3254 0148 85 popw x
  217. 3255 0149 bf00 ldw c_lreg,x
  218. 3256 014b 85 popw x
  219. 3257 014c bf02 ldw c_lreg+2,x
  220. 3258 014e 85 popw x
  221. 3259 014f bf00 ldw c_y,x
  222. 3260 0151 320002 pop c_y+2
  223. 3261 0154 85 popw x
  224. 3262 0155 bf00 ldw c_x,x
  225. 3263 0157 320002 pop c_x+2
  226. 3264 015a 80 iret
  227. 3265 015b L3612:
  228. 3266 ; 135 if(I2C_SR1 & I2C_SR1_RXNE){
  229. 3268 015b c65217 ld a,_I2C_SR1
  230. 3269 015e a540 bcp a,#64
  231. 3270 0160 2717 jreq L5612
  232. 3271 ; 136 if (i2c_idx == I2C_MAX_SIZE)
  233. 3273 0162 b624 ld a,_i2c_idx
  234. 3274 0164 a120 cp a,#32
  235. 3275 0166 2602 jrne L7612
  236. 3276 ; 137 i2c_idx = 0;
  237. 3278 0168 3f24 clr _i2c_idx
  238. 3279 016a L7612:
  239. 3280 ; 138 i2c_buffer[i2c_idx++] = I2C_DR;
  240. 3282 016a b624 ld a,_i2c_idx
  241. 3283 016c 97 ld xl,a
  242. 3284 016d 3c24 inc _i2c_idx
  243. 3285 016f 9f ld a,xl
  244. 3286 0170 5f clrw x
  245. 3287 0171 97 ld xl,a
  246. 3288 0172 c65216 ld a,_I2C_DR
  247. 3289 0175 e702 ld (_i2c_buffer,x),a
  248. 3290 ; 139 return;
  249. 3292 0177 20ce jra L04
  250. 3293 0179 L5612:
  251. 3294 ; 142 if (I2C_SR2 & I2C_SR2_AF) {
  252. 3296 0179 c65218 ld a,_I2C_SR2
  253. 3297 017c a504 bcp a,#4
  254. 3298 017e 2708 jreq L1712
  255. 3299 ; 143 I2C_SR2 &= ~I2C_SR2_AF;
  256. 3301 0180 72155218 bres _I2C_SR2,#2
  257. 3302 ; 144 i2c_busy = 0;
  258. 3304 0184 3f22 clr _i2c_busy
  259. 3305 ; 145 return;
  260. 3307 0186 20bf jra L04
  261. 3308 0188 L1712:
  262. 3309 ; 148 if(I2C_SR1 & I2C_SR1_TXE){
  263. 3311 0188 c65217 ld a,_I2C_SR1
  264. 3312 018b a580 bcp a,#128
  265. 3313 018d 2719 jreq L3712
  266. 3314 ; 149 if (i2c_idx < dat_len)
  267. 3316 018f b624 ld a,_i2c_idx
  268. 3317 0191 b123 cp a,_dat_len
  269. 3318 0193 240f jruge L5712
  270. 3319 ; 150 I2C_DR = i2c_buffer[i2c_idx++];
  271. 3321 0195 b624 ld a,_i2c_idx
  272. 3322 0197 97 ld xl,a
  273. 3323 0198 3c24 inc _i2c_idx
  274. 3324 019a 9f ld a,xl
  275. 3325 019b 5f clrw x
  276. 3326 019c 97 ld xl,a
  277. 3327 019d e602 ld a,(_i2c_buffer,x)
  278. 3328 019f c75216 ld _I2C_DR,a
  279. 3330 01a2 2004 jra L3712
  280. 3331 01a4 L5712:
  281. 3332 ; 152 I2C_DR = 0x00;
  282. 3334 01a4 725f5216 clr _I2C_DR
  283. 3335 01a8 L3712:
  284. 3336 ; 155 if (I2C_SR1 & I2C_SR1_STOPF) {
  285. 3338 01a8 c65217 ld a,_I2C_SR1
  286. 3339 01ab a510 bcp a,#16
  287. 3340 01ad 2604 jrne L24
  288. 3341 01af ac8c028c jpf L1022
  289. 3342 01b3 L24:
  290. 3343 ; 156 I2C_CR2 |= I2C_CR2_ACK;
  291. 3345 01b3 72145211 bset _I2C_CR2,#2
  292. 3346 ; 157 i2c_busy = 0;
  293. 3348 01b7 3f22 clr _i2c_busy
  294. 3349 ; 159 if(0xAA == i2c_buffer[0]) { // 写指令
  295. 3351 01b9 b602 ld a,_i2c_buffer
  296. 3352 01bb a1aa cp a,#170
  297. 3353 01bd 2704 jreq L44
  298. 3354 01bf ac520252 jpf L3022
  299. 3355 01c3 L44:
  300. 3356 ; 160 switch(i2c_buffer[1]){
  301. 3358 01c3 b603 ld a,_i2c_buffer+1
  302. 3360 ; 189 default: break;
  303. 3361 01c5 4a dec a
  304. 3362 01c6 271b jreq L3112
  305. 3363 01c8 4a dec a
  306. 3364 01c9 2722 jreq L5112
  307. 3365 01cb 4a dec a
  308. 3366 01cc 2733 jreq L7112
  309. 3367 01ce 4a dec a
  310. 3368 01cf 2742 jreq L1212
  311. 3369 01d1 4a dec a
  312. 3370 01d2 2751 jreq L3212
  313. 3371 01d4 4a dec a
  314. 3372 01d5 2760 jreq L5212
  315. 3373 01d7 a004 sub a,#4
  316. 3374 01d9 2764 jreq L7212
  317. 3375 01db a07e sub a,#126
  318. 3376 01dd 2765 jreq L1312
  319. 3377 01df ac880288 jpf L1122
  320. 3378 01e3 L3112:
  321. 3379 ; 161 case 1:
  322. 3379 ; 162 //是否使能定时器,产生pwm:
  323. 3379 ; 163 turn_order = i2c_buffer[2];
  324. 3381 01e3 450400 mov _turn_order,_i2c_buffer+2
  325. 3382 ; 164 turn_sec = i2c_buffer[3];
  326. 3384 01e6 450500 mov _turn_sec,_i2c_buffer+3
  327. 3385 ; 165 break;
  328. 3387 01e9 ac880288 jpf L1122
  329. 3388 01ed L5112:
  330. 3389 ; 166 case 2:
  331. 3389 ; 167 COLLECT_FAN = i2c_buffer[2];
  332. 3391 01ed 3d04 tnz _i2c_buffer+2
  333. 3392 01ef 2602 jrne L64
  334. 3393 01f1 2006 jpf L02
  335. 3394 01f3 L64:
  336. 3395 01f3 72125000 bset _COLLECT_FAN
  337. 3396 01f7 2004 jra L22
  338. 3397 01f9 L02:
  339. 3398 01f9 72135000 bres _COLLECT_FAN
  340. 3399 01fd L22:
  341. 3400 ; 168 break;
  342. 3402 01fd ac880288 jra L1122
  343. 3403 0201 L7112:
  344. 3404 ; 169 case 3:
  345. 3404 ; 170 COOL = i2c_buffer[2];
  346. 3406 0201 3d04 tnz _i2c_buffer+2
  347. 3407 0203 2602 jrne L05
  348. 3408 0205 2006 jpf L42
  349. 3409 0207 L05:
  350. 3410 0207 72145000 bset _COOL
  351. 3411 020b 2004 jra L62
  352. 3412 020d L42:
  353. 3413 020d 72155000 bres _COOL
  354. 3414 0211 L62:
  355. 3415 ; 171 break;
  356. 3417 0211 2075 jra L1122
  357. 3418 0213 L1212:
  358. 3419 ; 172 case 4:
  359. 3419 ; 173 HEAT = i2c_buffer[2];
  360. 3421 0213 3d04 tnz _i2c_buffer+2
  361. 3422 0215 2602 jrne L25
  362. 3423 0217 2006 jpf L03
  363. 3424 0219 L25:
  364. 3425 0219 7212500f bset _HEAT
  365. 3426 021d 2004 jra L23
  366. 3427 021f L03:
  367. 3428 021f 7213500f bres _HEAT
  368. 3429 0223 L23:
  369. 3430 ; 174 break;
  370. 3432 0223 2063 jra L1122
  371. 3433 0225 L3212:
  372. 3434 ; 175 case 5:
  373. 3434 ; 176 COLD = i2c_buffer[2];
  374. 3436 0225 3d04 tnz _i2c_buffer+2
  375. 3437 0227 2602 jrne L45
  376. 3438 0229 2006 jpf L43
  377. 3439 022b L45:
  378. 3440 022b 7218500f bset _COLD
  379. 3441 022f 2004 jra L63
  380. 3442 0231 L43:
  381. 3443 0231 7219500f bres _COLD
  382. 3444 0235 L63:
  383. 3445 ; 177 break;
  384. 3447 0235 2051 jra L1122
  385. 3448 0237 L5212:
  386. 3449 ; 178 case 6:
  387. 3449 ; 179 up_dw_flag = i2c_buffer[2];
  388. 3451 0237 450400 mov _up_dw_flag,_i2c_buffer+2
  389. 3452 ; 180 fsl_sec = i2c_buffer[3];
  390. 3454 023a 450500 mov _fsl_sec,_i2c_buffer+3
  391. 3455 ; 181 break;
  392. 3457 023d 2049 jra L1122
  393. 3458 023f L7212:
  394. 3459 ; 182 case 0x0A:
  395. 3459 ; 183 wdgtim = i2c_buffer[2];
  396. 3461 023f 450400 mov _wdgtim,_i2c_buffer+2
  397. 3462 ; 184 break;
  398. 3464 0242 2044 jra L1122
  399. 3465 0244 L1312:
  400. 3466 ; 185 case 0x88:
  401. 3466 ; 186 IWDG_KR = 0x55; //解除 PR 及 RLR 的写保护
  402. 3468 0244 355550e0 mov _IWDG_KR,#85
  403. 3469 ; 187 IWDG_RLR = 0x00; //看门狗计数器重装载数值
  404. 3471 0248 725f50e2 clr _IWDG_RLR
  405. 3472 ; 188 break;
  406. 3474 024c 203a jra L1122
  407. 3475 024e L3312:
  408. 3476 ; 189 default: break;
  409. 3478 024e 2038 jra L1122
  410. 3479 0250 L7022:
  411. 3480 ; 190 };
  412. 3482 0250 2036 jra L1122
  413. 3483 0252 L3022:
  414. 3484 ; 192 else if(0x55 == i2c_buffer[0]){ // 读指令
  415. 3486 0252 b602 ld a,_i2c_buffer
  416. 3487 0254 a155 cp a,#85
  417. 3488 0256 2630 jrne L1122
  418. 3489 ; 193 switch(i2c_buffer[1]){
  419. 3491 0258 b603 ld a,_i2c_buffer+1
  420. 3493 ; 202 default:break;
  421. 3494 025a a007 sub a,#7
  422. 3495 025c 270f jreq L7312
  423. 3496 025e a005 sub a,#5
  424. 3497 0260 2626 jrne L1122
  425. 3498 ; 194 case 0x0C: // 获取STM8数据
  426. 3498 ; 195 i2c_send((char *)(&stm8_data),11);
  427. 3500 0262 4b0b push #11
  428. 3501 0264 ae0000 ldw x,#_stm8_data
  429. 3502 0267 cd00c2 call _i2c_send
  430. 3504 026a 84 pop a
  431. 3505 ; 196 break;
  432. 3507 026b 201b jra L1122
  433. 3508 026d L7312:
  434. 3509 ; 197 case 7:
  435. 3509 ; 198 turn_limit.turn = TURN_IN;
  436. 3511 026d 4f clr a
  437. 3512 btst _TURN_IN
  438. 3513 0273 49 rlc a
  439. 3514 0274 b700 ld _turn_limit,a
  440. 3515 ; 199 turn_limit.turn_init = TURN_IN0;
  441. 3517 0276 4f clr a
  442. 3518 btst _TURN_IN0
  443. 3519 027c 49 rlc a
  444. 3520 027d b701 ld _turn_limit+1,a
  445. 3521 ; 200 i2c_send((char *)(&turn_limit),2);
  446. 3523 027f 4b02 push #2
  447. 3524 0281 ae0000 ldw x,#_turn_limit
  448. 3525 0284 cd00c2 call _i2c_send
  449. 3527 0287 84 pop a
  450. 3528 ; 201 break;
  451. 3530 0288 L1412:
  452. 3531 ; 202 default:break;
  453. 3533 0288 L7122:
  454. 3535 0288 L1122:
  455. 3536 ; 206 return;
  456. 3538 0288 ac470147 jpf L04
  457. 3539 028c L1022:
  458. 3540 ; 208 }
  459. 3542 028c ac470147 jpf L04
  460. 3624 xdef f_I2C_EVENT_IRQ
  461. 3625 switch .ubsct
  462. 3626 0000 _turn_limit:
  463. 3627 0000 0000 ds.b 2
  464. 3628 xdef _turn_limit
  465. 3629 xref.b _fsl_sec
  466. 3630 xref.b _up_dw_flag
  467. 3631 xref.b _turn_sec
  468. 3632 xref.b _turn_order
  469. 3633 xdef _i2c_recv
  470. 3634 xdef _i2c_send
  471. 3635 xdef _TempCalculate
  472. 3636 0002 _i2c_buffer:
  473. 3637 0002 000000000000 ds.b 32
  474. 3638 xdef _i2c_buffer
  475. 3639 0022 _i2c_busy:
  476. 3640 0022 00 ds.b 1
  477. 3641 xdef _i2c_busy
  478. 3642 0023 _dat_len:
  479. 3643 0023 00 ds.b 1
  480. 3644 xdef _dat_len
  481. 3645 0024 _i2c_idx:
  482. 3646 0024 00 ds.b 1
  483. 3647 xdef _i2c_idx
  484. 3648 xref.b _stm8_data
  485. 3649 xref _log
  486. 3650 xref.b _wdgtim
  487. 3651 xdef _IIC_Init
  488. 3652 .const: section .text
  489. 3653 0000 L7102:
  490. 3654 0000 3f000000 dc.w 16128,0
  491. 3655 0004 L7002:
  492. 3656 0004 438890a3 dc.w 17288,-28509
  493. 3657 0008 L7771:
  494. 3658 0008 3b5bcec8 dc.w 15195,-12600
  495. 3659 000c L7671:
  496. 3660 000c 3f800000 dc.w 16256,0
  497. 3661 xref.b c_lreg
  498. 3662 xref.b c_x
  499. 3663 xref.b c_y
  500. 3683 xref c_ftoi
  501. 3684 xref c_fgadd
  502. 3685 xref c_fgsub
  503. 3686 xref c_fadd
  504. 3687 xref c_ltor
  505. 3688 xref c_ctof
  506. 3689 xref c_fgdiv
  507. 3690 xref c_fdiv
  508. 3691 xref c_rtol
  509. 3692 xref c_itof
  510. 3693 xref c_fmul
  511. 3694 xref c_uitof
  512. 3695 end