|
1 | 1 | from __future__ import print_function
|
| 2 | +from warnings import warn |
2 | 3 | import PSL.commands_proto as CP
|
3 | 4 | import numpy as np
|
4 | 5 | import time
|
@@ -394,7 +395,7 @@ def __retrievebuffer__(self):
|
394 | 395 | '''
|
395 | 396 | Fetch data acquired by the I2C scope. refer to :func:`__captureStart__`
|
396 | 397 | '''
|
397 |
| - total_int_samples = self.total_bytes / 2 |
| 398 | + total_int_samples = self.total_bytes // 2 |
398 | 399 | DATA_SPLITTING = 500
|
399 | 400 | print('fetchin samples : ', total_int_samples, ' split', DATA_SPLITTING)
|
400 | 401 | data = b''
|
@@ -525,56 +526,57 @@ class I2C(I2CMaster, I2CSlave): # for backwards compatibility
|
525 | 526 | def __init__(self, H):
|
526 | 527 | I2CMaster.__init__(self, H)
|
527 | 528 | I2CSlave.__init__(self, H, None)
|
| 529 | + warn('I2C is deprecated; use I2CMaster and I2CSlave', DeprecationWarning) |
528 | 530 |
|
529 |
| - def start(self, address, rw): |
| 531 | + def start(self, address, rw): # nosec |
530 | 532 | self.address = address
|
531 | 533 | return super().start(rw)
|
532 |
| - |
533 |
| - def restart(self, address, rw): |
| 534 | + |
| 535 | + def restart(self, address, rw): # nosec |
534 | 536 | self.address = address
|
535 | 537 | return super().restart(rw)
|
536 | 538 |
|
537 |
| - def simpleRead(self, address, numbytes): |
| 539 | + def simpleRead(self, address, numbytes): # nosec |
538 | 540 | self.address = address
|
539 | 541 | return super().simpleRead(numbytes)
|
540 | 542 |
|
541 |
| - def simple_read_byte(self, address): |
| 543 | + def simple_read_byte(self, address): # nosec |
542 | 544 | self.address = address
|
543 | 545 | return super().simple_read_byte()
|
544 | 546 |
|
545 |
| - def simple_read_int(self, address): |
| 547 | + def simple_read_int(self, address): # nosec |
546 | 548 | self.address = address
|
547 | 549 | return super().simple_read_int()
|
548 | 550 |
|
549 |
| - def simple_read_long(self, address): |
| 551 | + def simple_read_long(self, address): # nosec |
550 | 552 | self.address = address
|
551 | 553 | return super().simple_read_long()
|
552 | 554 |
|
553 |
| - def readBulk(self, device_address, register_address, bytes_to_read): |
| 555 | + def readBulk(self, device_address, register_address, bytes_to_read): # nosec |
554 | 556 | self.address = device_address
|
555 | 557 | return super().readBulk(register_address, bytes_to_read)
|
556 | 558 |
|
557 |
| - def read_bulk_byte(self, device_address, register_address): |
| 559 | + def read_bulk_byte(self, device_address, register_address): # nosec |
558 | 560 | self.address = device_address
|
559 | 561 | return super().read_bulk_byte(register_address)
|
560 | 562 |
|
561 |
| - def read_bulk_int(self, device_address, register_address): |
| 563 | + def read_bulk_int(self, device_address, register_address): # nosec |
562 | 564 | self.address = device_address
|
563 | 565 | return super().read_bulk_int(register_address)
|
564 | 566 |
|
565 |
| - def read_bulk_long(self, device_address, register_address): |
| 567 | + def read_bulk_long(self, device_address, register_address): # nosec |
566 | 568 | self.address = device_address
|
567 | 569 | return super().read_bulk_long(register_address)
|
568 | 570 |
|
569 |
| - def writeBulk(self, device_address, bytestream): |
| 571 | + def writeBulk(self, device_address, bytestream): # nosec |
570 | 572 | self.address = device_address
|
571 | 573 | return super().writeBulk(bytestream)
|
572 | 574 |
|
573 |
| - def __captureStart__(self, address, location, sample_length, total_samples, tg): |
| 575 | + def __captureStart__(self, address, location, sample_length, total_samples, tg): # nosec |
574 | 576 | self.address = address
|
575 | 577 | return super().__captureStart__(location, sample_length, total_samples, tg)
|
576 | 578 |
|
577 |
| - def capture(self, address, location, sample_length, total_samples, tg, *args): |
| 579 | + def capture(self, address, location, sample_length, total_samples, tg, *args): # nosec |
578 | 580 | self.address = address
|
579 | 581 | return super().capture(location, sample_length, total_samples, tg, *args)
|
580 | 582 |
|
|
0 commit comments