FreeCalypso > hg > freecalypso-reveng
comparison pirelli/fw-disasm @ 262:db000ea183a5
pirelli/fw-disasm: CV charging analyzed
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 26 Dec 2017 12:26:23 +0000 |
parents | 61e0be63559c |
children |
comparison
equal
deleted
inserted
replaced
261:61e0be63559c | 262:db000ea183a5 |
---|---|
1288 2e299e: 2003 mov r0, #3 | 1288 2e299e: 2003 mov r0, #3 |
1289 2e29a0: f0b2 fa8f bl 0x394ec2 | 1289 2e29a0: f0b2 fa8f bl 0x394ec2 |
1290 2e29a4: f0d1 f905 bl 0x3b3bb2 | 1290 2e29a4: f0d1 f905 bl 0x3b3bb2 |
1291 2e29a8: b002 add sp, #8 | 1291 2e29a8: b002 add sp, #8 |
1292 2e29aa: bd70 pop {r4, r5, r6, pc} | 1292 2e29aa: bd70 pop {r4, r5, r6, pc} |
1293 | |
1294 $pwr_CI_charge_timer_process: | |
1295 2e29e4: b510 push {r4, lr} | |
1296 2e29e6: b082 sub sp, #8 | |
1297 2e29e8: f066 fc90 bl 0x34930c ; $ABB_Read_Status | |
1298 2e29ec: 09c0 lsr r0, r0, #7 | |
1299 2e29ee: d324 bcc 0x2e2a3a ; return | |
1300 ; charging power still present | |
1301 2e29f0: 4cec ldr r4, =0x1774e70 ; via 0x2e2da4 | |
1302 2e29f2: 6820 ldr r0, [r4, #0] | |
1303 2e29f4: 8f81 ldrh r1, [r0, #60] ; 0x3c | |
1304 2e29f6: 8f40 ldrh r0, [r0, #58] ; 0x3a | |
1305 2e29f8: 0840 lsr r0, r0, #1 | |
1306 2e29fa: 4281 cmp r1, r0 | |
1307 2e29fc: dd08 ble 0x2e2a10 | |
1308 ; taking too long? | |
1309 2e29fe: f7ff fbdd bl 0x2e21bc | |
1310 2e2a02: 2800 cmp r0, #0 | |
1311 2e2a04: d104 bne 0x2e2a10 | |
1312 2e2a06: 6820 ldr r0, [r4, #0] | |
1313 2e2a08: 303c add r0, #60 ; 0x3c | |
1314 2e2a0a: 8801 ldrh r1, [r0, #0] | |
1315 2e2a0c: 3901 sub r1, #1 | |
1316 2e2a0e: e003 b 0x2e2a18 | |
1317 ; no time issue | |
1318 2e2a10: 6820 ldr r0, [r4, #0] | |
1319 2e2a12: 303c add r0, #60 ; 0x3c | |
1320 2e2a14: 8801 ldrh r1, [r0, #0] | |
1321 2e2a16: 3101 add r1, #1 | |
1322 2e2a18: 8001 strh r1, [r0, #0] | |
1323 2e2a1a: 6820 ldr r0, [r4, #0] | |
1324 2e2a1c: 8f81 ldrh r1, [r0, #60] ; 0x3c | |
1325 2e2a1e: 8f40 ldrh r0, [r0, #58] ; 0x3a | |
1326 2e2a20: 4281 cmp r1, r0 | |
1327 2e2a22: dd08 ble 0x2e2a36 | |
1328 2e2a24: 48e9 ldr r0, =0xa0020 ; via 0x2e2dcc | |
1329 2e2a26: 9000 str r0, [sp, #0] | |
1330 2e2a28: a02e add r0, pc, #184 ; 0xb8 | |
1331 2e2a2a: 211d mov r1, #29 ; 0x1d | |
1332 2e2a2c: 2200 mov r2, #0 | |
1333 2e2a2e: 43d2 mvn r2, r2 | |
1334 2e2a30: 2302 mov r3, #2 | |
1335 2e2a32: f0f8 f8ff bl 0x3dac34 | |
1336 2e2a36: f04b f903 bl 0x32dc40 ; $pwr_get_battery_temperature | |
1337 2e2a3a: b002 add sp, #8 | |
1338 2e2a3c: bd10 pop {r4, pc} | |
1339 2e2a3e: 46c0 nop (mov r8, r8) | |
1340 | |
1341 $pwr_CV_charge_process: | |
1342 2e2b14: b5f0 push {r4, r5, r6, r7, lr} | |
1343 2e2b16: 4640 mov r0, r8 | |
1344 2e2b18: 4649 mov r1, r9 | |
1345 2e2b1a: 4652 mov r2, r10 | |
1346 2e2b1c: 465b mov r3, r11 | |
1347 2e2b1e: b40f push {r0, r1, r2, r3} | |
1348 2e2b20: b082 sub sp, #8 | |
1349 2e2b22: 2138 mov r1, #56 ; 0x38 | |
1350 2e2b24: 489f ldr r0, =0x1774e70 ; via 0x2e2da4 | |
1351 2e2b26: 6800 ldr r0, [r0, #0] | |
1352 2e2b28: 5e08 ldrsh r0, [r1, r0] | |
1353 2e2b2a: f04a fff8 bl 0x32db1e ; $pwr_bat_temp_within_limits | |
1354 2e2b2e: 2800 cmp r0, #0 | |
1355 2e2b30: d115 bne 0x2e2b5e | |
1356 ; error path | |
1357 2e2b32: f7ff fbdc bl 0x2e22ee | |
1358 2e2b36: 48a5 ldr r0, =0xa0020 ; via 0x2e2dcc | |
1359 2e2b38: 9000 str r0, [sp, #0] | |
1360 2e2b3a: a037 add r0, pc, #220 ; 0xdc | |
1361 2e2b3c: 2121 mov r1, #33 ; 0x21 | |
1362 2e2b3e: 2200 mov r2, #0 | |
1363 2e2b40: 43d2 mvn r2, r2 | |
1364 2e2b42: 2302 mov r3, #2 | |
1365 2e2b44: f0f8 f876 bl 0x3dac34 | |
1366 2e2b48: 2000 mov r0, #0 | |
1367 2e2b4a: f0b2 f9ba bl 0x394ec2 | |
1368 2e2b4e: 2032 mov r0, #50 ; 0x32 | |
1369 2e2b50: 493a ldr r1, =0x1774e38 ; via 0x2e2c3c | |
1370 2e2b52: 6809 ldr r1, [r1, #0] | |
1371 2e2b54: 5c40 ldrb r0, [r0, r1] | |
1372 2e2b56: 2800 cmp r0, #0 | |
1373 2e2b58: d100 bne 0x2e2b5c | |
1374 2e2b5a: e11d b 0x2e2d98 | |
1375 2e2b5c: e157 b 0x2e2e0e | |
1376 ; good path | |
1377 2e2b5e: 4e37 ldr r6, =0x1774e38 ; via 0x2e2c3c | |
1378 2e2b60: 2133 mov r1, #51 ; 0x33 | |
1379 2e2b62: 6830 ldr r0, [r6, #0] | |
1380 2e2b64: 5c08 ldrb r0, [r1, r0] | |
1381 2e2b66: 2800 cmp r0, #0 | |
1382 2e2b68: d10d bne 0x2e2b86 | |
1383 ; is_adc_on FALSE | |
1384 2e2b6a: 2001 mov r0, #1 | |
1385 2e2b6c: 2122 mov r1, #34 ; 0x22 | |
1386 2e2b6e: 2200 mov r2, #0 | |
1387 2e2b70: f066 fb4c bl 0x34920c | |
1388 2e2b74: 2001 mov r0, #1 | |
1389 2e2b76: f7ce fe92 bl 0x2b189e | |
1390 2e2b7a: 2001 mov r0, #1 | |
1391 2e2b7c: 2122 mov r1, #34 ; 0x22 | |
1392 2e2b7e: f066 fb6c bl 0x34925a | |
1393 2e2b82: 1c04 add r4, r0, #0 | |
1394 2e2b84: e001 b 0x2e2b8a | |
1395 ; is_adc_on TRUE | |
1396 2e2b86: 6830 ldr r0, [r6, #0] | |
1397 2e2b88: 8904 ldrh r4, [r0, #8] | |
1398 ; is_adc_on paths join | |
1399 2e2b8a: 1c20 add r0, r4, #0 | |
1400 2e2b8c: f04b fae1 bl 0x32e152 ; Ichg averaging | |
1401 2e2b90: 1c04 add r4, r0, #0 | |
1402 2e2b92: 4d4e ldr r5, =0x1774b78 ; via 0x2e2ccc | |
1403 2e2b94: f04a ffb1 bl 0x32dafa ; $pwr_adc_to_mA | |
1404 2e2b98: 80e8 strh r0, [r5, #6] | |
1405 2e2b9a: 88e8 ldrh r0, [r5, #6] | |
1406 2e2b9c: f04b fa8e bl 0x32e0bc | |
1407 ; "TIMER2" trace | |
1408 2e2ba0: 488a ldr r0, =0xa0020 ; via 0x2e2dcc | |
1409 2e2ba2: 9000 str r0, [sp, #0] | |
1410 2e2ba4: a0cd add r0, pc, #820 ; 0x334 | |
1411 2e2ba6: 2106 mov r1, #6 | |
1412 2e2ba8: 2200 mov r2, #0 | |
1413 2e2baa: 43d2 mvn r2, r2 | |
1414 2e2bac: 2302 mov r3, #2 | |
1415 2e2bae: f0f8 f841 bl 0x3dac34 | |
1416 ; "Ichg (MADC code) " trace | |
1417 2e2bb2: 4886 ldr r0, =0xa0020 ; via 0x2e2dcc | |
1418 2e2bb4: 9000 str r0, [sp, #0] | |
1419 2e2bb6: a040 add r0, pc, #256 ; 0x100 | |
1420 2e2bb8: 2111 mov r1, #17 ; 0x11 | |
1421 2e2bba: 1c22 add r2, r4, #0 | |
1422 2e2bbc: 2305 mov r3, #5 | |
1423 2e2bbe: f0f8 f839 bl 0x3dac34 | |
1424 2e2bc2: 2133 mov r1, #51 ; 0x33 | |
1425 2e2bc4: 6830 ldr r0, [r6, #0] | |
1426 2e2bc6: 5c08 ldrb r0, [r1, r0] | |
1427 2e2bc8: 2800 cmp r0, #0 | |
1428 2e2bca: d10c bne 0x2e2be6 | |
1429 ; is_adc_on FALSE | |
1430 2e2bcc: 2001 mov r0, #1 | |
1431 2e2bce: 211e mov r1, #30 ; 0x1e | |
1432 2e2bd0: 2200 mov r2, #0 | |
1433 2e2bd2: f066 fb1b bl 0x34920c | |
1434 2e2bd6: 2001 mov r0, #1 | |
1435 2e2bd8: f7ce fe61 bl 0x2b189e | |
1436 2e2bdc: 2001 mov r0, #1 | |
1437 2e2bde: 211e mov r1, #30 ; 0x1e | |
1438 2e2be0: f066 fb3b bl 0x34925a | |
1439 2e2be4: e001 b 0x2e2bea | |
1440 ; is_adc_on TRUE | |
1441 2e2be6: f04b fa77 bl 0x32e0d8 | |
1442 ; is_adc_on paths join | |
1443 2e2bea: 4680 mov r8, r0 | |
1444 2e2bec: 4d37 ldr r5, =0x1774b78 ; via 0x2e2ccc | |
1445 2e2bee: 4640 mov r0, r8 | |
1446 2e2bf0: f04a ff7a bl 0x32dae8 ; $pwr_adc_to_mvolt | |
1447 2e2bf4: 80a8 strh r0, [r5, #4] | |
1448 2e2bf6: 486b ldr r0, =0x1774e70 ; via 0x2e2da4 | |
1449 2e2bf8: 4681 mov r9, r0 | |
1450 2e2bfa: 2138 mov r1, #56 ; 0x38 | |
1451 2e2bfc: 6800 ldr r0, [r0, #0] | |
1452 2e2bfe: 5e08 ldrsh r0, [r1, r0] | |
1453 2e2c00: 3001 add r0, #1 | |
1454 2e2c02: 2800 cmp r0, #0 | |
1455 2e2c04: d100 bne 0x2e2c08 | |
1456 2e2c06: e098 b 0x2e2d3a | |
1457 ; temperature != -1 | |
1458 2e2c08: 88aa ldrh r2, [r5, #4] | |
1459 2e2c0a: 48d6 ldr r0, =0x108c ; via 0x2e2f64 | |
1460 2e2c0c: 4282 cmp r2, r0 | |
1461 2e2c0e: da17 bge 0x2e2c40 | |
1462 ; Vbat < 4236 | |
1463 2e2c10: 49d6 ldr r1, =0x17749c8 ; via 0x2e2f6c | |
1464 2e2c12: 2000 mov r0, #0 | |
1465 2e2c14: 8008 strh r0, [r1, #0] | |
1466 2e2c16: e046 b 0x2e2ca6 | |
1467 ; Vbat >= 4236 | |
1468 2e2c40: 4bca ldr r3, =0x17749c8 ; via 0x2e2f6c | |
1469 2e2c42: 8818 ldrh r0, [r3, #0] | |
1470 2e2c44: 3001 add r0, #1 | |
1471 2e2c46: 0400 lsl r0, r0, #16 | |
1472 2e2c48: 0c01 lsr r1, r0, #16 | |
1473 2e2c4a: 8019 strh r1, [r3, #0] | |
1474 2e2c4c: 48c8 ldr r0, =0x17749c4 ; via 0x2e2f70 | |
1475 2e2c4e: 4682 mov r10, r0 | |
1476 2e2c50: 8800 ldrh r0, [r0, #0] | |
1477 2e2c52: 4281 cmp r1, r0 | |
1478 2e2c54: dd27 ble 0x2e2ca6 | |
1479 ; Vbat has been high 4 times in a row | |
1480 2e2c56: 4fc7 ldr r7, =0x17749ca ; via 0x2e2f74 | |
1481 2e2c58: 8839 ldrh r1, [r7, #0] | |
1482 2e2c5a: 48c7 ldr r0, =0x17749c6 ; via 0x2e2f78 | |
1483 2e2c5c: 8800 ldrh r0, [r0, #0] | |
1484 2e2c5e: 3830 sub r0, #48 ; 0x30 | |
1485 2e2c60: 4288 cmp r0, r1 | |
1486 2e2c62: dc1d bgt 0x2e2ca0 | |
1487 ; DAC -= 2 | |
1488 2e2c64: 1e88 sub r0, r1, #2 | |
1489 2e2c66: 8038 strh r0, [r7, #0] | |
1490 2e2c68: 2001 mov r0, #1 | |
1491 2e2c6a: 213a mov r1, #58 ; 0x3a | |
1492 2e2c6c: 2200 mov r2, #0 | |
1493 2e2c6e: f066 facd bl 0x34920c | |
1494 2e2c72: 883a ldrh r2, [r7, #0] | |
1495 2e2c74: 2001 mov r0, #1 | |
1496 2e2c76: 2132 mov r1, #50 ; 0x32 | |
1497 2e2c78: f066 fac8 bl 0x34920c | |
1498 2e2c7c: 2001 mov r0, #1 | |
1499 2e2c7e: 213a mov r1, #58 ; 0x3a | |
1500 2e2c80: 2201 mov r2, #1 | |
1501 2e2c82: f066 fac3 bl 0x34920c | |
1502 ; set counter threshold to 10 (started out as 3) | |
1503 2e2c86: 4650 mov r0, r10 | |
1504 2e2c88: 210a mov r1, #10 ; 0xa | |
1505 2e2c8a: 8001 strh r1, [r0, #0] | |
1506 ; "Sub CV DAC" trace | |
1507 2e2c8c: 883a ldrh r2, [r7, #0] | |
1508 2e2c8e: 484f ldr r0, =0xa0020 ; via 0x2e2dcc | |
1509 2e2c90: 9000 str r0, [sp, #0] | |
1510 2e2c92: a094 add r0, pc, #592 ; 0x250 | |
1511 2e2c94: 210b mov r1, #11 ; 0xb | |
1512 2e2c96: 2305 mov r3, #5 | |
1513 2e2c98: f0f7 ffcc bl 0x3dac34 | |
1514 2e2c9c: 48bc ldr r0, =0x1774b7c ; via 0x2e2f90 | |
1515 2e2c9e: 8802 ldrh r2, [r0, #0] | |
1516 ; counter to 0 | |
1517 2e2ca0: 48b2 ldr r0, =0x17749c8 ; via 0x2e2f6c | |
1518 2e2ca2: 2100 mov r1, #0 | |
1519 2e2ca4: 8001 strh r1, [r0, #0] | |
1520 ; end of high Vbat check | |
1521 ; now check against low threshold of 4160 | |
1522 2e2ca6: 2041 mov r0, #65 ; 0x41 | |
1523 2e2ca8: 0180 lsl r0, r0, #6 | |
1524 2e2caa: 4282 cmp r2, r0 | |
1525 2e2cac: db10 blt 0x2e2cd0 | |
1526 ; Vbat >= 4160 | |
1527 2e2cae: 49b3 ldr r1, =0x17749c0 ; via 0x2e2f7c | |
1528 2e2cb0: 2000 mov r0, #0 | |
1529 2e2cb2: 8008 strh r0, [r1, #0] | |
1530 2e2cb4: e041 b 0x2e2d3a | |
1531 ; Vbat < 4160 | |
1532 ; increment counter | |
1533 2e2cd0: 49aa ldr r1, =0x17749c0 ; via 0x2e2f7c | |
1534 2e2cd2: 8808 ldrh r0, [r1, #0] | |
1535 2e2cd4: 3001 add r0, #1 | |
1536 2e2cd6: 0400 lsl r0, r0, #16 | |
1537 2e2cd8: 0c00 lsr r0, r0, #16 | |
1538 2e2cda: 8008 strh r0, [r1, #0] | |
1539 2e2cdc: 4fa4 ldr r7, =0x17749c4 ; via 0x2e2f70 | |
1540 2e2cde: 8839 ldrh r1, [r7, #0] | |
1541 2e2ce0: 4288 cmp r0, r1 | |
1542 2e2ce2: dd2a ble 0x2e2d3a | |
1543 ; counter incremented past the limit | |
1544 2e2ce4: 2000 mov r0, #0 | |
1545 2e2ce6: 4683 mov r11, r0 | |
1546 2e2ce8: 49a2 ldr r1, =0x17749ca ; via 0x2e2f74 | |
1547 2e2cea: 880b ldrh r3, [r1, #0] | |
1548 2e2cec: 1c18 add r0, r3, #0 | |
1549 2e2cee: 3807 sub r0, #7 | |
1550 2e2cf0: 4aa1 ldr r2, =0x17749c6 ; via 0x2e2f78 | |
1551 2e2cf2: 8812 ldrh r2, [r2, #0] | |
1552 2e2cf4: 4290 cmp r0, r2 | |
1553 2e2cf6: dc1d bgt 0x2e2d34 | |
1554 2e2cf8: 468a mov r10, r1 | |
1555 2e2cfa: 1c58 add r0, r3, #1 | |
1556 2e2cfc: 8008 strh r0, [r1, #0] | |
1557 2e2cfe: 2001 mov r0, #1 | |
1558 2e2d00: 213a mov r1, #58 ; 0x3a | |
1559 2e2d02: 2200 mov r2, #0 | |
1560 2e2d04: f066 fa82 bl 0x34920c | |
1561 2e2d08: 4650 mov r0, r10 | |
1562 2e2d0a: 8802 ldrh r2, [r0, #0] | |
1563 2e2d0c: 2001 mov r0, #1 | |
1564 2e2d0e: 2132 mov r1, #50 ; 0x32 | |
1565 2e2d10: f066 fa7c bl 0x34920c | |
1566 2e2d14: 2001 mov r0, #1 | |
1567 2e2d16: 213a mov r1, #58 ; 0x3a | |
1568 2e2d18: 2201 mov r2, #1 | |
1569 2e2d1a: f066 fa77 bl 0x34920c | |
1570 2e2d1e: 200a mov r0, #10 ; 0xa | |
1571 2e2d20: 8038 strh r0, [r7, #0] | |
1572 ; "Add CV DAC" trace | |
1573 2e2d22: 4650 mov r0, r10 | |
1574 2e2d24: 8802 ldrh r2, [r0, #0] | |
1575 2e2d26: 4829 ldr r0, =0xa0020 ; via 0x2e2dcc | |
1576 2e2d28: 9000 str r0, [sp, #0] | |
1577 2e2d2a: a071 add r0, pc, #452 ; 0x1c4 | |
1578 2e2d2c: 210b mov r1, #11 ; 0xb | |
1579 2e2d2e: 2305 mov r3, #5 | |
1580 2e2d30: f0f7 ff80 bl 0x3dac34 | |
1581 ; zero the counter | |
1582 2e2d34: 4891 ldr r0, =0x17749c0 ; via 0x2e2f7c | |
1583 2e2d36: 4659 mov r1, r11 | |
1584 2e2d38: 8001 strh r1, [r0, #0] | |
1585 ; end of DAC adjustment logic | |
1586 ; "Vbat (MADC code) " trace | |
1587 2e2d3a: 4824 ldr r0, =0xa0020 ; via 0x2e2dcc | |
1588 2e2d3c: 9000 str r0, [sp, #0] | |
1589 2e2d3e: a07c add r0, pc, #496 ; 0x1f0 | |
1590 2e2d40: 2111 mov r1, #17 ; 0x11 | |
1591 2e2d42: 4642 mov r2, r8 | |
1592 2e2d44: 2305 mov r3, #5 | |
1593 2e2d46: f0f7 ff75 bl 0x3dac34 | |
1594 ; get the display backlight current draw | |
1595 2e2d4a: f0fc faba bl 0x3df2c2 | |
1596 2e2d4e: 4649 mov r1, r9 | |
1597 2e2d50: 6809 ldr r1, [r1, #0] | |
1598 2e2d52: 894a ldrh r2, [r1, #10] ; 0xa | |
1599 2e2d54: 1810 add r0, r2, r0 | |
1600 2e2d56: 0400 lsl r0, r0, #16 | |
1601 2e2d58: 0c00 lsr r0, r0, #16 | |
1602 2e2d5a: 4284 cmp r4, r0 | |
1603 2e2d5c: dc38 bgt 0x2e2dd0 | |
1604 ; Ichg <= end_current + display_backlight_current | |
1605 2e2d5e: 4a88 ldr r2, =0x17749c2 ; via 0x2e2f80 | |
1606 2e2d60: 8810 ldrh r0, [r2, #0] | |
1607 2e2d62: 3001 add r0, #1 | |
1608 2e2d64: 0400 lsl r0, r0, #16 | |
1609 2e2d66: 0c00 lsr r0, r0, #16 | |
1610 2e2d68: 8010 strh r0, [r2, #0] | |
1611 2e2d6a: 281e cmp r0, #30 ; 0x1e | |
1612 2e2d6c: dd1c ble 0x2e2da8 | |
1613 ; this seems to be the end-of-charge condition | |
1614 2e2d6e: 4985 ldr r1, =0x17749b8 ; via 0x2e2f84 | |
1615 2e2d70: 2000 mov r0, #0 | |
1616 2e2d72: 7008 strb r0, [r1, #0] | |
1617 2e2d74: f7ff fabb bl 0x2e22ee ; $pwr_stop_charging | |
1618 2e2d78: f0b2 f86a bl 0x394e50 ; $pwr_send_charge_stop_event ? | |
1619 ; "Fast charge termination criterion" trace | |
1620 2e2d7c: 4813 ldr r0, =0xa0020 ; via 0x2e2dcc | |
1621 2e2d7e: 9000 str r0, [sp, #0] | |
1622 2e2d80: a05e add r0, pc, #376 ; 0x178 | |
1623 2e2d82: 2121 mov r1, #33 ; 0x21 | |
1624 2e2d84: 2200 mov r2, #0 | |
1625 2e2d86: 43d2 mvn r2, r2 | |
1626 2e2d88: 2305 mov r3, #5 | |
1627 2e2d8a: f0f7 ff53 bl 0x3dac34 | |
1628 2e2d8e: 2032 mov r0, #50 ; 0x32 | |
1629 2e2d90: 6831 ldr r1, [r6, #0] | |
1630 2e2d92: 5c40 ldrb r0, [r0, r1] | |
1631 2e2d94: 2800 cmp r0, #0 | |
1632 2e2d96: d13a bne 0x2e2e0e | |
1633 2e2d98: 2001 mov r0, #1 | |
1634 2e2d9a: 213c mov r1, #60 ; 0x3c | |
1635 2e2d9c: 2201 mov r2, #1 | |
1636 2e2d9e: f066 fa35 bl 0x34920c | |
1637 2e2da2: e045 b 0x2e2e30 | |
1638 2e2da4: 4e70 ldr r6, =0x10ae ; via 0x2e2f68 | |
1639 2e2da6: 0177 lsl r7, r6, #5 | |
1640 ; counter <= 30 | |
1641 2e2da8: 2048 mov r0, #72 ; 0x48 | |
1642 2e2daa: 5c40 ldrb r0, [r0, r1] | |
1643 2e2dac: 2801 cmp r0, #1 | |
1644 2e2dae: d137 bne 0x2e2e20 | |
1645 2e2db0: 2400 mov r4, #0 | |
1646 2e2db2: 4874 ldr r0, =0x17749b8 ; via 0x2e2f84 | |
1647 2e2db4: 7801 ldrb r1, [r0, #0] | |
1648 2e2db6: 2900 cmp r1, #0 | |
1649 2e2db8: d005 beq 0x2e2dc6 | |
1650 2e2dba: 7004 strb r4, [r0, #0] | |
1651 2e2dbc: f0b2 f848 bl 0x394e50 | |
1652 2e2dc0: 2064 mov r0, #100 ; 0x64 | |
1653 2e2dc2: f0b2 f8ba bl 0x394f3a | |
1654 2e2dc6: 486e ldr r0, =0x17749c2 ; via 0x2e2f80 | |
1655 2e2dc8: 8004 strh r4, [r0, #0] | |
1656 2e2dca: e029 b 0x2e2e20 | |
1657 ; Ichg hasn't fallen low enough | |
1658 ; zero the Ichg low counter | |
1659 2e2dd0: 4a6b ldr r2, =0x17749c2 ; via 0x2e2f80 | |
1660 2e2dd2: 2000 mov r0, #0 | |
1661 2e2dd4: 8010 strh r0, [r2, #0] | |
1662 ; another Vbat check | |
1663 2e2dd6: 88a8 ldrh r0, [r5, #4] | |
1664 2e2dd8: 4a63 ldr r2, =0x10ae ; via 0x2e2f68 | |
1665 2e2dda: 4290 cmp r0, r2 | |
1666 2e2ddc: dd1a ble 0x2e2e14 | |
1667 ; Vbat > 4270 | |
1668 2e2dde: 4866 ldr r0, =0x17749c6 ; via 0x2e2f78 | |
1669 2e2de0: 8800 ldrh r0, [r0, #0] | |
1670 2e2de2: 4a64 ldr r2, =0x17749ca ; via 0x2e2f74 | |
1671 2e2de4: 8812 ldrh r2, [r2, #0] | |
1672 2e2de6: 1a80 sub r0, r0, r2 | |
1673 2e2de8: 2832 cmp r0, #50 ; 0x32 | |
1674 2e2dea: dd13 ble 0x2e2e14 | |
1675 ; overvoltage handling | |
1676 2e2dec: f7ff fa7f bl 0x2e22ee | |
1677 2e2df0: 2009 mov r0, #9 | |
1678 2e2df2: 43c0 mvn r0, r0 | |
1679 2e2df4: 8028 strh r0, [r5, #0] | |
1680 2e2df6: 4865 ldr r0, =0xa0020 ; via 0x2e2f8c | |
1681 2e2df8: 9000 str r0, [sp, #0] | |
1682 2e2dfa: a049 add r0, pc, #292 ; 0x124 | |
1683 2e2dfc: 210e mov r1, #14 ; 0xe | |
1684 2e2dfe: 2200 mov r2, #0 | |
1685 2e2e00: 43d2 mvn r2, r2 | |
1686 2e2e02: 2302 mov r3, #2 | |
1687 2e2e04: f0f7 ff16 bl 0x3dac34 | |
1688 2e2e08: 2003 mov r0, #3 | |
1689 2e2e0a: f0b2 f85a bl 0x394ec2 | |
1690 2e2e0e: f0d0 fed0 bl 0x3b3bb2 | |
1691 2e2e12: e00d b 0x2e2e30 | |
1692 ; overcurrent check | |
1693 2e2e14: 2033 mov r0, #51 ; 0x33 | |
1694 2e2e16: 0100 lsl r0, r0, #4 | |
1695 2e2e18: 8909 ldrh r1, [r1, #8] | |
1696 2e2e1a: 1840 add r0, r0, r1 | |
1697 2e2e1c: 4284 cmp r4, r0 | |
1698 2e2e1e: dc05 bgt 0x2e2e2c | |
1699 ; TIMER2 reset | |
1700 2e2e20: 2002 mov r0, #2 | |
1701 2e2e22: 4959 ldr r1, =0x363 ; via 0x2e2f88 | |
1702 2e2e24: 2200 mov r2, #0 | |
1703 2e2e26: f048 f827 bl 0x32ae78 | |
1704 2e2e2a: e001 b 0x2e2e30 | |
1705 2e2e2c: f7ff fad1 bl 0x2e23d2 | |
1706 2e2e30: b002 add sp, #8 | |
1707 2e2e32: bc0f pop {r0, r1, r2, r3} | |
1708 2e2e34: 4680 mov r8, r0 | |
1709 2e2e36: 4689 mov r9, r1 | |
1710 2e2e38: 4692 mov r10, r2 | |
1711 2e2e3a: 469b mov r11, r3 | |
1712 2e2e3c: bdf0 pop {r4, r5, r6, r7, pc} | |
1293 | 1713 |
1294 $l1_abb_power_on: | 1714 $l1_abb_power_on: |
1295 31c036: b510 push {r4, lr} | 1715 31c036: b510 push {r4, lr} |
1296 31c038: b084 sub sp, #16 ; 0x10 | 1716 31c038: b084 sub sp, #16 ; 0x10 |
1297 31c03a: 2000 mov r0, #0 | 1717 31c03a: 2000 mov r0, #0 |
5309 | 5729 |
5310 0x17749c0: 16-bit var, init to 0 in pwr_start_CV_charging() | 5730 0x17749c0: 16-bit var, init to 0 in pwr_start_CV_charging() |
5311 0x17749c2: 16-bit var, init to 0 in pwr_start_CV_charging() | 5731 0x17749c2: 16-bit var, init to 0 in pwr_start_CV_charging() |
5312 0x17749c4: 16-bit var, init to 3 in pwr_start_CV_charging() | 5732 0x17749c4: 16-bit var, init to 3 in pwr_start_CV_charging() |
5313 0x17749c6: 16-bit var, initial CV DAC value gets written here | 5733 0x17749c6: 16-bit var, initial CV DAC value gets written here |
5734 this var seems to hold the initial value | |
5314 0x17749c8: 16-bit var, init to 0 in pwr_start_CV_charging() | 5735 0x17749c8: 16-bit var, init to 0 in pwr_start_CV_charging() |
5315 0x17749ca: 16-bit var, initial CV DAC value gets written here | 5736 0x17749ca: 16-bit var, initial CV DAC value gets written here |
5737 this var gets decremented as the DAC is adjusted down | |
5316 | 5738 |
5317 0x1774b78: 16-bit var, gets -4 written into it if the battery T | 5739 0x1774b78: 16-bit var, gets -4 written into it if the battery T |
5318 is too high, or -5 if it is too low | 5740 is too high, or -5 if it is too low |
5319 0x1774b7a: 16-bit var set to 0 when starting CI charging, | 5741 0x1774b7a: 16-bit var set to 0 when starting CI charging, |
5320 set to 1 when starting CV charging | 5742 set to 1 when starting CV charging |
5321 0x1774b7c: 16-bit var battery voltage in mV | 5743 0x1774b7c: 16-bit var battery voltage in mV |
5322 0x1774b7e: 16-bit var zeroed in pwr_stop_charging() | 5744 0x1774b7e: 16-bit var zeroed in pwr_stop_charging() |
5323 Ichg in mA gets written here in CI process | 5745 Ichg in mA gets written here in CI and CV processes |
5324 0x1774b80: 16-bit var zeroed in pwr_stop_charging() | 5746 0x1774b80: 16-bit var zeroed in pwr_stop_charging() |
5325 0x1774b82: 16-bit var gets i2v offset (raw ADC) written into it | 5747 0x1774b82: 16-bit var gets i2v offset (raw ADC) written into it |
5326 | 5748 |
5327 0x1774ccc: 16-bit var initial battery % is stored here | 5749 0x1774ccc: 16-bit var initial battery % is stored here |
5328 | 5750 |