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