Mercurial > public > hwos_code
comparison src/tft_outputs.asm @ 145:e3ac5b2021bc
NEW: Setpoint-Fallback option for external O2 sensor failure
author | heinrichsweikamp |
---|---|
date | Tue, 05 Aug 2014 16:55:09 +0200 |
parents | e0b758865e91 |
children | fdd4e30846ae |
comparison
equal
deleted
inserted
replaced
144:b839972db982 | 145:e3ac5b2021bc |
---|---|
949 return | 949 return |
950 | 950 |
951 global TFT_hud_voltages | 951 global TFT_hud_voltages |
952 TFT_hud_voltages: ; Show HUD details | 952 TFT_hud_voltages: ; Show HUD details |
953 WIN_SMALL .5,dive_hud_data_row | 953 WIN_SMALL .5,dive_hud_data_row |
954 call TFT_standard_color | |
955 btfss use_02_sensor1 | |
956 call TFT_warnings_color | |
954 movff o2_mv_sensor1+0,lo | 957 movff o2_mv_sensor1+0,lo |
955 movff o2_mv_sensor1+1,hi | 958 movff o2_mv_sensor1+1,hi |
956 bsf leftbind | 959 bsf leftbind |
957 output_16dp .4 ; x.xx | 960 output_16dp .4 ; x.xx |
958 bcf leftbind | 961 bcf leftbind |
959 STRCAT_PRINT "mV " | 962 STRCAT_PRINT "mV " |
960 WIN_SMALL .55,dive_hud_data_row | 963 WIN_SMALL .55,dive_hud_data_row |
964 call TFT_standard_color | |
965 btfss use_02_sensor2 | |
966 call TFT_warnings_color | |
961 movff o2_mv_sensor2+0,lo | 967 movff o2_mv_sensor2+0,lo |
962 movff o2_mv_sensor2+1,hi | 968 movff o2_mv_sensor2+1,hi |
963 bsf leftbind | 969 bsf leftbind |
964 output_16dp .4 ; x.xx | 970 output_16dp .4 ; x.xx |
965 bcf leftbind | 971 bcf leftbind |
966 STRCAT_PRINT "mV " | 972 STRCAT_PRINT "mV " |
967 WIN_SMALL .105,dive_hud_data_row | 973 WIN_SMALL .105,dive_hud_data_row |
974 call TFT_standard_color | |
975 btfss use_02_sensor3 | |
976 call TFT_warnings_color | |
968 movff o2_mv_sensor3+0,lo | 977 movff o2_mv_sensor3+0,lo |
969 movff o2_mv_sensor3+1,hi | 978 movff o2_mv_sensor3+1,hi |
970 bsf leftbind | 979 bsf leftbind |
971 output_16dp .4 ; x.xx | 980 output_16dp .4 ; x.xx |
972 bcf leftbind | 981 bcf leftbind |
973 STRCAT_PRINT "mV " | 982 STRCAT_PRINT "mV " |
983 call TFT_standard_color | |
974 return | 984 return |
975 | 985 |
976 global TFT_update_hud ; Update HUD data | 986 global TFT_update_hud ; Update HUD data |
977 TFT_update_hud: | 987 TFT_update_hud: |
978 ; show three sensors | 988 ; show three sensors |
1282 output_8 | 1292 output_8 |
1283 bcf leftbind | 1293 bcf leftbind |
1284 STRCAT_PRINT "!" | 1294 STRCAT_PRINT "!" |
1285 return | 1295 return |
1286 | 1296 |
1287 global TFT_update_raw_data | 1297 ; global TFT_update_raw_data |
1288 TFT_update_raw_data: | 1298 ;TFT_update_raw_data: |
1289 call TFT_standard_color | 1299 ; call TFT_standard_color |
1290 WIN_TINY .0,.0 | 1300 ; WIN_TINY .0,.0 |
1291 STRCPY "pres:" | 1301 ; STRCPY "pres:" |
1292 SAFE_2BYTE_COPY amb_pressure, lo | 1302 ; SAFE_2BYTE_COPY amb_pressure, lo |
1293 movlw .5 ;>1280mbar | 1303 ; movlw .5 ;>1280mbar |
1294 cpfslt hi | 1304 ; cpfslt hi |
1295 call TFT_warnings_color | 1305 ; call TFT_warnings_color |
1296 bsf leftbind | 1306 ; bsf leftbind |
1297 output_16 | 1307 ; output_16 |
1298 STRCAT_PRINT "mbar " | 1308 ; STRCAT_PRINT "mbar " |
1299 WIN_TINY .80,.0 | 1309 ; WIN_TINY .80,.0 |
1300 STRCPY "temp:" | 1310 ; STRCPY "temp:" |
1301 SAFE_2BYTE_COPY temperature, lo | 1311 ; SAFE_2BYTE_COPY temperature, lo |
1302 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | 1312 ; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required |
1303 movlw d'3' | 1313 ; movlw d'3' |
1304 movwf ignore_digits | 1314 ; movwf ignore_digits |
1305 output_16dp d'2' ; temperature | 1315 ; output_16dp d'2' ; temperature |
1306 STRCAT_PRINT "°C " | 1316 ; STRCAT_PRINT "°C " |
1307 | 1317 ; |
1308 call TFT_standard_color | 1318 ; call TFT_standard_color |
1309 call get_battery_voltage ; get battery voltage | 1319 ; call get_battery_voltage ; get battery voltage |
1310 WIN_TINY .0,.18 | 1320 ; WIN_TINY .0,.18 |
1311 STRCPY "AN06:" | 1321 ; STRCPY "AN06:" |
1312 movff ADRESL,lo | 1322 ; movff ADRESL,lo |
1313 movff ADRESH,hi | 1323 ; movff ADRESH,hi |
1314 output_16 | 1324 ; output_16 |
1315 STRCAT_PRINT "" | 1325 ; STRCAT_PRINT "" |
1316 WIN_TINY .80,.18 | 1326 ; WIN_TINY .80,.18 |
1317 STRCPY "BATT:" | 1327 ; STRCPY "BATT:" |
1318 movff batt_voltage+0,lo | 1328 ; movff batt_voltage+0,lo |
1319 movff batt_voltage+1,hi | 1329 ; movff batt_voltage+1,hi |
1320 output_16 | 1330 ; output_16 |
1321 STRCAT_PRINT "mV " | 1331 ; STRCAT_PRINT "mV " |
1322 | 1332 ; |
1323 call get_ambient_level ; get ambient light level | 1333 ; call get_ambient_level ; get ambient light level |
1324 WIN_TINY .0,.36 | 1334 ; WIN_TINY .0,.36 |
1325 STRCPY "AN07:" | 1335 ; STRCPY "AN07:" |
1326 movff ADRESL,lo | |
1327 movff ADRESH,hi | |
1328 output_16 | |
1329 STRCAT_PRINT " " | |
1330 WIN_TINY .80,.36 | |
1331 STRCPY "Amb.:" | |
1332 movff ambient_light+0,lo | |
1333 movff ambient_light+1,hi | |
1334 output_16 | |
1335 STRCAT_PRINT " " | |
1336 | |
1337 ; call get_rssi_level ; get rssi level | |
1338 ; WIN_TINY .0,.54 | |
1339 ; STRCPY "AN17:" | |
1340 ; movff ADRESL,lo | 1336 ; movff ADRESL,lo |
1341 ; movff ADRESH,hi | 1337 ; movff ADRESH,hi |
1342 ; output_16 | 1338 ; output_16 |
1343 ; STRCAT_PRINT " " | 1339 ; STRCAT_PRINT " " |
1344 ; WIN_TINY .80,.54 | 1340 ; WIN_TINY .80,.36 |
1345 ; STRCPY "RSSI:" | 1341 ; STRCPY "Amb.:" |
1346 ; movff rssi_value,lo | 1342 ; movff ambient_light+0,lo |
1347 ; output_8 | 1343 ; movff ambient_light+1,hi |
1348 ; STRCAT_PRINT " " | 1344 ; output_16 |
1349 | 1345 ; STRCAT_PRINT " " |
1350 WIN_TINY .0,.72 | 1346 ; |
1351 STRCPY "HUD_Status:" | 1347 ;; call get_rssi_level ; get rssi level |
1352 movff hud_status_byte,lo | 1348 ;; WIN_TINY .0,.54 |
1353 output_8 | 1349 ;; STRCPY "AN17:" |
1354 STRCAT_PRINT " " | 1350 ;; movff ADRESL,lo |
1355 WIN_TINY .80,.72 | 1351 ;; movff ADRESH,hi |
1356 STRCPY "HUD_BATT:" | 1352 ;; output_16 |
1357 movff hud_battery_mv+0,lo | 1353 ;; STRCAT_PRINT " " |
1358 movff hud_battery_mv+1,hi | 1354 ;; WIN_TINY .80,.54 |
1359 output_16 | 1355 ;; STRCPY "RSSI:" |
1360 STRCAT_PRINT "mV " | 1356 ;; movff rssi_value,lo |
1361 | 1357 ;; output_8 |
1362 ; call disable_ir | 1358 ;; STRCAT_PRINT " " |
1363 ; bsf mcp_power | 1359 ; |
1364 ; btfss mcp_power | 1360 ; WIN_TINY .0,.72 |
1365 ; bra $-4 | 1361 ; STRCPY "HUD_Status:" |
1366 ; call get_analog_inputs | 1362 ; movff hud_status_byte,lo |
1367 WIN_TINY .0,.90 | 1363 ; output_8 |
1368 STRCPY "Sens1.:" | 1364 ; STRCAT_PRINT " " |
1369 movff o2_mv_sensor1+0,lo | 1365 ; WIN_TINY .80,.72 |
1370 movff o2_mv_sensor1+1,hi | 1366 ; STRCPY "HUD_BATT:" |
1371 output_16dp d'4' | 1367 ; movff hud_battery_mv+0,lo |
1372 STRCAT_PRINT "mV " | 1368 ; movff hud_battery_mv+1,hi |
1373 WIN_TINY .80,.90 | 1369 ; output_16 |
1374 STRCPY "Sens2:" | 1370 ; STRCAT_PRINT "mV " |
1375 movff o2_mv_sensor2+0,lo | 1371 ; |
1376 movff o2_mv_sensor2+1,hi | 1372 ;; call disable_ir |
1377 output_16dp d'4' | 1373 ;; bsf mcp_power |
1378 STRCAT_PRINT "mV " | 1374 ;; btfss mcp_power |
1379 | 1375 ;; bra $-4 |
1380 WIN_TINY .0,.108 | 1376 ;; call get_analog_inputs |
1381 STRCPY "Sens3.:" | |
1382 movff o2_mv_sensor3+0,lo | |
1383 movff o2_mv_sensor3+1,hi | |
1384 output_16dp d'4' | |
1385 STRCAT_PRINT "mV " | |
1386 WIN_TINY .80,.108 ; Space | |
1387 | |
1388 WIN_TINY .0,.128 | |
1389 STRCPY "ccDX:" | |
1390 movff compass_DX_f+0,lo ; Display calibrated data | |
1391 movff compass_CX_f+0,WREG ; by substracting compass_CX_f | |
1392 subwf lo,F ; lo := lo - W | |
1393 movff compass_DX_f+1,hi | |
1394 movff compass_CX_f+1,WREG | |
1395 subwfb hi,F | |
1396 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1397 output_16 | |
1398 STRCAT_PRINT " " | |
1399 WIN_TINY .80,.128 | |
1400 STRCPY "ccDY:" | |
1401 movff compass_DY_f+0,lo | |
1402 movff compass_CY_f+0,WREG | |
1403 subwf lo,F | |
1404 movff compass_DY_f+1,hi | |
1405 movff compass_CY_f+1,WREG | |
1406 subwfb hi,F | |
1407 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1408 output_16 | |
1409 STRCAT_PRINT " " | |
1410 WIN_TINY .0,.146 | |
1411 STRCPY "ccDZ:" | |
1412 movff compass_DZ_f+0,lo | |
1413 movff compass_CZ_f+0,WREG | |
1414 subwf lo,F | |
1415 movff compass_DZ_f+1,hi | |
1416 movff compass_CZ_f+1,WREG | |
1417 subwfb hi,F | |
1418 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1419 output_16 | |
1420 STRCAT_PRINT " " | |
1421 WIN_TINY .80,.146 ; Space | |
1422 | |
1423 WIN_TINY .0,.164 | |
1424 STRCPY "AcDX:" | |
1425 movff accel_DX_f+0,lo | |
1426 movff accel_DX_f+1,hi | |
1427 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1428 output_16 | |
1429 STRCAT_PRINT "mg " | |
1430 WIN_TINY .80,.164 | |
1431 STRCPY "AcDY:" | |
1432 movff accel_DY_f+0,lo | |
1433 movff accel_DY_f+1,hi | |
1434 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1435 output_16 | |
1436 STRCAT_PRINT "mg " | |
1437 WIN_TINY .0,.182 | |
1438 STRCPY "AcDZ:" | |
1439 movff accel_DZ_f+0,lo | |
1440 movff accel_DZ_f+1,hi | |
1441 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1442 output_16 | |
1443 STRCAT_PRINT "mg " | |
1444 | |
1445 WIN_TINY .80,.182 | |
1446 STRCPY "Head:" | |
1447 movff compass_heading+0,lo | |
1448 movff compass_heading+1,hi | |
1449 | |
1450 btfsc hi,7 ; Uncalibrated compass ? | |
1451 bra TFT_update_compass_1 | |
1452 | |
1453 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1454 output_16 | |
1455 STRCAT_PRINT " " | |
1456 bra TFT_update_compass_2 | |
1457 | |
1458 TFT_update_compass_1: | |
1459 STRCAT_PRINT "---" | |
1460 | |
1461 TFT_update_compass_2: | |
1462 WIN_TINY .0,.200 | |
1463 STRCPY "calX:" | |
1464 movff compass_CX_f+0,lo | |
1465 movff compass_CX_f+1,hi | |
1466 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1467 output_16 | |
1468 STRCAT ", " | |
1469 movff compass_CY_f+0,lo | |
1470 movff compass_CY_f+1,hi | |
1471 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1472 output_16 | |
1473 STRCAT ", " | |
1474 movff compass_CZ_f+0,lo | |
1475 movff compass_CZ_f+1,hi | |
1476 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1477 output_16 | |
1478 STRCAT_PRINT " " | |
1479 | |
1480 WIN_TINY .0,.218 | |
1481 STRCPY "Roll:" | |
1482 movff compass_roll+0,lo | |
1483 movff compass_roll+1,hi | |
1484 call TFT_convert_signed_16bit | |
1485 output_16 | |
1486 STRCAT_PRINT " " | |
1487 | |
1488 WIN_TINY .80, .218 | |
1489 STRCPY "Pitch:" | |
1490 movff compass_pitch+0,lo | |
1491 movff compass_pitch+1,hi | |
1492 call TFT_convert_signed_16bit | |
1493 output_16 | |
1494 STRCAT_PRINT " " | |
1495 | |
1496 ; call TFT_serial | |
1497 bcf leftbind | |
1498 return | |
1499 | |
1500 global TFT_update_raw_data2 | |
1501 TFT_update_raw_data2: | |
1502 call TFT_standard_color | |
1503 WIN_TINY .0,.0 | |
1504 STRCPY "pres:" | |
1505 SAFE_2BYTE_COPY amb_pressure, lo | |
1506 movlw .5 ;>1280mbar | |
1507 cpfslt hi | |
1508 call TFT_warnings_color | |
1509 bsf leftbind | |
1510 output_16 | |
1511 STRCAT_PRINT "mbar " | |
1512 WIN_TINY .80,.0 | |
1513 STRCPY "temp:" | |
1514 SAFE_2BYTE_COPY temperature, lo | |
1515 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1516 movlw d'3' | |
1517 movwf ignore_digits | |
1518 output_16dp d'2' ; temperature | |
1519 STRCAT_PRINT "°C " | |
1520 | |
1521 call TFT_standard_color | |
1522 WIN_TINY .0,.18 | |
1523 STRCPY "D1:" | |
1524 movff D1+0,lo | |
1525 movff D1+1,hi | |
1526 output_16 | |
1527 STRCAT_PRINT "" | |
1528 WIN_TINY .80,.18 | |
1529 STRCPY "D2:" | |
1530 movff D2+0,lo | |
1531 movff D2+1,hi | |
1532 output_16 | |
1533 STRCAT_PRINT "" | |
1534 | |
1535 ; C1-C6 | |
1536 WIN_TINY .0,.36 | |
1537 STRCPY "C1:" | |
1538 movff C1+0,lo | |
1539 movff C1+1,hi | |
1540 output_16 | |
1541 STRCAT_PRINT "" | |
1542 WIN_TINY .80,.36 | |
1543 STRCPY "C2:" | |
1544 movff C2+0,lo | |
1545 movff C2+1,hi | |
1546 output_16 | |
1547 STRCAT_PRINT "" | |
1548 | |
1549 WIN_TINY .0,.54 | |
1550 STRCPY "C3:" | |
1551 movff C3+0,lo | |
1552 movff C3+1,hi | |
1553 output_16 | |
1554 STRCAT_PRINT "" | |
1555 WIN_TINY .80,.54 | |
1556 STRCPY "C4:" | |
1557 movff C4+0,lo | |
1558 movff C4+1,hi | |
1559 output_16 | |
1560 STRCAT_PRINT "" | |
1561 | |
1562 WIN_TINY .0,.72 | |
1563 STRCPY "C5:" | |
1564 movff C5+0,lo | |
1565 movff C5+1,hi | |
1566 output_16 | |
1567 STRCAT_PRINT "" | |
1568 WIN_TINY .80,.72 | |
1569 STRCPY "C6:" | |
1570 movff C6+0,lo | |
1571 movff C6+1,hi | |
1572 output_16 | |
1573 STRCAT_PRINT "" | |
1574 | |
1575 ; WIN_TINY .0,.90 | 1377 ; WIN_TINY .0,.90 |
1576 ; STRCPY "Sens1.:" | 1378 ; STRCPY "Sens1.:" |
1577 ; movff o2_mv_sensor1+0,lo | 1379 ; movff o2_mv_sensor1+0,lo |
1578 ; movff o2_mv_sensor1+1,hi | 1380 ; movff o2_mv_sensor1+1,hi |
1579 ; output_16dp d'4' | 1381 ; output_16dp d'4' |
1653 ; WIN_TINY .80,.182 | 1455 ; WIN_TINY .80,.182 |
1654 ; STRCPY "Head:" | 1456 ; STRCPY "Head:" |
1655 ; movff compass_heading+0,lo | 1457 ; movff compass_heading+0,lo |
1656 ; movff compass_heading+1,hi | 1458 ; movff compass_heading+1,hi |
1657 ; | 1459 ; |
1460 ; btfsc hi,7 ; Uncalibrated compass ? | |
1461 ; bra TFT_update_compass_1 | |
1462 ; | |
1463 ; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1464 ; output_16 | |
1465 ; STRCAT_PRINT " " | |
1466 ; bra TFT_update_compass_2 | |
1467 ; | |
1468 ;TFT_update_compass_1: | |
1469 ; STRCAT_PRINT "---" | |
1470 ; | |
1471 ;TFT_update_compass_2: | |
1658 ; WIN_TINY .0,.200 | 1472 ; WIN_TINY .0,.200 |
1659 ; STRCPY "calX:" | 1473 ; STRCPY "calX:" |
1660 ; movff compass_CX_f+0,lo | 1474 ; movff compass_CX_f+0,lo |
1661 ; movff compass_CX_f+1,hi | 1475 ; movff compass_CX_f+1,hi |
1662 ; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | 1476 ; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required |
1686 ; movff compass_pitch+0,lo | 1500 ; movff compass_pitch+0,lo |
1687 ; movff compass_pitch+1,hi | 1501 ; movff compass_pitch+1,hi |
1688 ; call TFT_convert_signed_16bit | 1502 ; call TFT_convert_signed_16bit |
1689 ; output_16 | 1503 ; output_16 |
1690 ; STRCAT_PRINT " " | 1504 ; STRCAT_PRINT " " |
1691 | 1505 ; |
1692 call TFT_serial | 1506 ; ; call TFT_serial |
1693 bcf leftbind | 1507 ; bcf leftbind |
1694 return | 1508 ; return |
1695 | 1509 ; |
1510 ; global TFT_update_raw_data2 | |
1511 ;TFT_update_raw_data2: | |
1512 ; call TFT_standard_color | |
1513 ; WIN_TINY .0,.0 | |
1514 ; STRCPY "pres:" | |
1515 ; SAFE_2BYTE_COPY amb_pressure, lo | |
1516 ; movlw .5 ;>1280mbar | |
1517 ; cpfslt hi | |
1518 ; call TFT_warnings_color | |
1519 ; bsf leftbind | |
1520 ; output_16 | |
1521 ; STRCAT_PRINT "mbar " | |
1522 ; WIN_TINY .80,.0 | |
1523 ; STRCPY "temp:" | |
1524 ; SAFE_2BYTE_COPY temperature, lo | |
1525 ; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1526 ; movlw d'3' | |
1527 ; movwf ignore_digits | |
1528 ; output_16dp d'2' ; temperature | |
1529 ; STRCAT_PRINT "°C " | |
1530 ; | |
1531 ; call TFT_standard_color | |
1532 ; WIN_TINY .0,.18 | |
1533 ; STRCPY "D1:" | |
1534 ; movff D1+0,lo | |
1535 ; movff D1+1,hi | |
1536 ; output_16 | |
1537 ; STRCAT_PRINT "" | |
1538 ; WIN_TINY .80,.18 | |
1539 ; STRCPY "D2:" | |
1540 ; movff D2+0,lo | |
1541 ; movff D2+1,hi | |
1542 ; output_16 | |
1543 ; STRCAT_PRINT "" | |
1544 ; | |
1545 ; ; C1-C6 | |
1546 ; WIN_TINY .0,.36 | |
1547 ; STRCPY "C1:" | |
1548 ; movff C1+0,lo | |
1549 ; movff C1+1,hi | |
1550 ; output_16 | |
1551 ; STRCAT_PRINT "" | |
1552 ; WIN_TINY .80,.36 | |
1553 ; STRCPY "C2:" | |
1554 ; movff C2+0,lo | |
1555 ; movff C2+1,hi | |
1556 ; output_16 | |
1557 ; STRCAT_PRINT "" | |
1558 ; | |
1559 ; WIN_TINY .0,.54 | |
1560 ; STRCPY "C3:" | |
1561 ; movff C3+0,lo | |
1562 ; movff C3+1,hi | |
1563 ; output_16 | |
1564 ; STRCAT_PRINT "" | |
1565 ; WIN_TINY .80,.54 | |
1566 ; STRCPY "C4:" | |
1567 ; movff C4+0,lo | |
1568 ; movff C4+1,hi | |
1569 ; output_16 | |
1570 ; STRCAT_PRINT "" | |
1571 ; | |
1572 ; WIN_TINY .0,.72 | |
1573 ; STRCPY "C5:" | |
1574 ; movff C5+0,lo | |
1575 ; movff C5+1,hi | |
1576 ; output_16 | |
1577 ; STRCAT_PRINT "" | |
1578 ; WIN_TINY .80,.72 | |
1579 ; STRCPY "C6:" | |
1580 ; movff C6+0,lo | |
1581 ; movff C6+1,hi | |
1582 ; output_16 | |
1583 ; STRCAT_PRINT "" | |
1584 ; | |
1585 ;; WIN_TINY .0,.90 | |
1586 ;; STRCPY "Sens1.:" | |
1587 ;; movff o2_mv_sensor1+0,lo | |
1588 ;; movff o2_mv_sensor1+1,hi | |
1589 ;; output_16dp d'4' | |
1590 ;; STRCAT_PRINT "mV " | |
1591 ;; WIN_TINY .80,.90 | |
1592 ;; STRCPY "Sens2:" | |
1593 ;; movff o2_mv_sensor2+0,lo | |
1594 ;; movff o2_mv_sensor2+1,hi | |
1595 ;; output_16dp d'4' | |
1596 ;; STRCAT_PRINT "mV " | |
1597 ;; | |
1598 ;; WIN_TINY .0,.108 | |
1599 ;; STRCPY "Sens3.:" | |
1600 ;; movff o2_mv_sensor3+0,lo | |
1601 ;; movff o2_mv_sensor3+1,hi | |
1602 ;; output_16dp d'4' | |
1603 ;; STRCAT_PRINT "mV " | |
1604 ;; WIN_TINY .80,.108 ; Space | |
1605 ;; | |
1606 ;; WIN_TINY .0,.128 | |
1607 ;; STRCPY "ccDX:" | |
1608 ;; movff compass_DX_f+0,lo ; Display calibrated data | |
1609 ;; movff compass_CX_f+0,WREG ; by substracting compass_CX_f | |
1610 ;; subwf lo,F ; lo := lo - W | |
1611 ;; movff compass_DX_f+1,hi | |
1612 ;; movff compass_CX_f+1,WREG | |
1613 ;; subwfb hi,F | |
1614 ;; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1615 ;; output_16 | |
1616 ;; STRCAT_PRINT " " | |
1617 ;; WIN_TINY .80,.128 | |
1618 ;; STRCPY "ccDY:" | |
1619 ;; movff compass_DY_f+0,lo | |
1620 ;; movff compass_CY_f+0,WREG | |
1621 ;; subwf lo,F | |
1622 ;; movff compass_DY_f+1,hi | |
1623 ;; movff compass_CY_f+1,WREG | |
1624 ;; subwfb hi,F | |
1625 ;; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1626 ;; output_16 | |
1627 ;; STRCAT_PRINT " " | |
1628 ;; WIN_TINY .0,.146 | |
1629 ;; STRCPY "ccDZ:" | |
1630 ;; movff compass_DZ_f+0,lo | |
1631 ;; movff compass_CZ_f+0,WREG | |
1632 ;; subwf lo,F | |
1633 ;; movff compass_DZ_f+1,hi | |
1634 ;; movff compass_CZ_f+1,WREG | |
1635 ;; subwfb hi,F | |
1636 ;; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1637 ;; output_16 | |
1638 ;; STRCAT_PRINT " " | |
1639 ;; WIN_TINY .80,.146 ; Space | |
1640 ;; | |
1641 ;; WIN_TINY .0,.164 | |
1642 ;; STRCPY "AcDX:" | |
1643 ;; movff accel_DX_f+0,lo | |
1644 ;; movff accel_DX_f+1,hi | |
1645 ;; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1646 ;; output_16 | |
1647 ;; STRCAT_PRINT "mg " | |
1648 ;; WIN_TINY .80,.164 | |
1649 ;; STRCPY "AcDY:" | |
1650 ;; movff accel_DY_f+0,lo | |
1651 ;; movff accel_DY_f+1,hi | |
1652 ;; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1653 ;; output_16 | |
1654 ;; STRCAT_PRINT "mg " | |
1655 ;; WIN_TINY .0,.182 | |
1656 ;; STRCPY "AcDZ:" | |
1657 ;; movff accel_DZ_f+0,lo | |
1658 ;; movff accel_DZ_f+1,hi | |
1659 ;; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1660 ;; output_16 | |
1661 ;; STRCAT_PRINT "mg " | |
1662 ;; | |
1663 ;; WIN_TINY .80,.182 | |
1664 ;; STRCPY "Head:" | |
1665 ;; movff compass_heading+0,lo | |
1666 ;; movff compass_heading+1,hi | |
1667 ;; | |
1668 ;; WIN_TINY .0,.200 | |
1669 ;; STRCPY "calX:" | |
1670 ;; movff compass_CX_f+0,lo | |
1671 ;; movff compass_CX_f+1,hi | |
1672 ;; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1673 ;; output_16 | |
1674 ;; STRCAT ", " | |
1675 ;; movff compass_CY_f+0,lo | |
1676 ;; movff compass_CY_f+1,hi | |
1677 ;; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1678 ;; output_16 | |
1679 ;; STRCAT ", " | |
1680 ;; movff compass_CZ_f+0,lo | |
1681 ;; movff compass_CZ_f+1,hi | |
1682 ;; call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1683 ;; output_16 | |
1684 ;; STRCAT_PRINT " " | |
1685 ;; | |
1686 ;; WIN_TINY .0,.218 | |
1687 ;; STRCPY "Roll:" | |
1688 ;; movff compass_roll+0,lo | |
1689 ;; movff compass_roll+1,hi | |
1690 ;; call TFT_convert_signed_16bit | |
1691 ;; output_16 | |
1692 ;; STRCAT_PRINT " " | |
1693 ;; | |
1694 ;; WIN_TINY .80, .218 | |
1695 ;; STRCPY "Pitch:" | |
1696 ;; movff compass_pitch+0,lo | |
1697 ;; movff compass_pitch+1,hi | |
1698 ;; call TFT_convert_signed_16bit | |
1699 ;; output_16 | |
1700 ;; STRCAT_PRINT " " | |
1701 ; | |
1702 ; call TFT_serial | |
1703 ; bcf leftbind | |
1704 ; return | |
1705 ; | |
1696 | 1706 |
1697 global TFT_surface_decosettings ; Show all deco settings | 1707 global TFT_surface_decosettings ; Show all deco settings |
1698 TFT_surface_decosettings: | 1708 TFT_surface_decosettings: |
1699 ; Deco Mode | 1709 ; Deco Mode |
1700 call TFT_standard_color | 1710 call TFT_standard_color |
2205 bsf ignore_digit5 ; Full degrees only | 2215 bsf ignore_digit5 ; Full degrees only |
2206 output_16 | 2216 output_16 |
2207 STRCAT_TEXT tLogTunitC | 2217 STRCAT_TEXT tLogTunitC |
2208 bra TFT_temp_divemode_common ; Done. | 2218 bra TFT_temp_divemode_common ; Done. |
2209 | 2219 |
2210 TFT_active_setpoint: ; Show setpoint | 2220 TFT_active_setpoint2: |
2211 WIN_STD active_gas_column,active_gas_row | |
2212 call TFT_standard_color | |
2213 btfsc is_bailout ; =1: Bailout | |
2214 bra TFT_active_setpoint_bail ; Show "Bailout" instead of Setpoint | |
2215 | |
2216 movff char_I_const_ppO2,lo | 2221 movff char_I_const_ppO2,lo |
2217 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo | 2222 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo |
2218 clrf hi | 2223 clrf hi |
2219 bsf leftbind | 2224 bsf leftbind |
2220 output_16dp d'3' | 2225 output_16dp d'3' |
2222 STRCAT_TEXT tbar | 2227 STRCAT_TEXT tbar |
2223 TSTOSS opt_ccr_mode ; =0: Fixed SP, =1: Sensor | 2228 TSTOSS opt_ccr_mode ; =0: Fixed SP, =1: Sensor |
2224 bra $+4 | 2229 bra $+4 |
2225 PUTC "*" | 2230 PUTC "*" |
2226 STRCAT_PRINT "" | 2231 STRCAT_PRINT "" |
2232 return | |
2233 | |
2234 TFT_active_setpoint: ; Show setpoint | |
2235 WIN_STD active_gas_column,active_gas_row | |
2236 call TFT_standard_color | |
2237 btfsc is_bailout ; =1: Bailout | |
2238 bra TFT_active_setpoint_bail ; Show "Bailout" instead of Setpoint | |
2239 | |
2240 rcall TFT_active_setpoint2 ; show setpoint (Non-Inverted in all cases) | |
2241 | |
2242 btfss setpoint_fallback ; =1: Fallback to SP1 due to external O2 sensor failure | |
2243 bra TFT_active_setpoint_diluent ; Done. | |
2244 btg blinking_setpoint ; Toggle blink bit... | |
2245 btfss blinking_setpoint ; blink now? | |
2246 bra TFT_active_setpoint_diluent ; Done. | |
2247 | |
2248 movlw color_yellow ; Blink in yellow | |
2249 call TFT_set_color | |
2250 WIN_STD_INVERT active_gas_column,active_gas_row | |
2251 movff char_I_const_ppO2,lo | |
2252 clrf hi | |
2253 bsf leftbind | |
2254 output_16dp d'3' | |
2255 bcf leftbind | |
2256 STRCAT_TEXT tbar | |
2257 TSTOSS opt_ccr_mode ; =0: Fixed SP, =1: Sensor | |
2258 bra $+4 | |
2259 PUTC "*" | |
2260 STRCAT_PRINT "" | |
2261 WIN_INVERT .0 ; Init new Wordprocessor | |
2227 | 2262 |
2228 TFT_active_setpoint_diluent: | 2263 TFT_active_setpoint_diluent: |
2229 call TFT_standard_color | 2264 call TFT_standard_color |
2230 WIN_SMALL active_dil_column,active_dil_row | 2265 WIN_SMALL active_dil_column,active_dil_row |
2231 movff char_I_O2_ratio,lo ; lo now stores O2 in % | 2266 movff char_I_O2_ratio,lo ; lo now stores O2 in % |
3385 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) | 3420 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) |
3386 STRCAT_PRINT "" | 3421 STRCAT_PRINT "" |
3387 call TFT_standard_color | 3422 call TFT_standard_color |
3388 return | 3423 return |
3389 | 3424 |
3425 global TFT_warning_fallback | |
3426 TFT_warning_fallback: ; Show fallback warning | |
3427 rcall TFT_warning_set_window ; Sets the row and column for the current warning | |
3428 tstfsz WREG ; Is there room for the warning? | |
3429 return ; No | |
3430 call TFT_warnings_color | |
3431 STRCPY_TEXT tDiveFallback ; "Fallback!" | |
3432 movlw warning_length ; Divemode string length | |
3433 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) | |
3434 STRCAT_PRINT "" | |
3435 call TFT_standard_color | |
3436 return | |
3437 | |
3390 global TFT_warning_gf | 3438 global TFT_warning_gf |
3391 TFT_warning_gf: ;GF | 3439 TFT_warning_gf: ;GF |
3392 rcall TFT_warning_set_window ; Sets the row and column for the current warning | 3440 rcall TFT_warning_set_window ; Sets the row and column for the current warning |
3393 tstfsz WREG ; Is there room for the warning? | 3441 tstfsz WREG ; Is there room for the warning? |
3394 return ; No | 3442 return ; No |