summaryrefslogtreecommitdiff
path: root/decoders/ds1307
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2014-07-15 22:49:43 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2014-07-15 22:49:43 +0200
commit35b380b1156434b73d4a976c68f5ab3604c8510a (patch)
tree75a60785c37d242eee5886af138dba5ef0f177c1 /decoders/ds1307
parent22fc7ace72f3165c98208a8f544156e04a709639 (diff)
downloadlibsigrokdecode-35b380b1156434b73d4a976c68f5ab3604c8510a.tar.gz
libsigrokdecode-35b380b1156434b73d4a976c68f5ab3604c8510a.zip
All PDs: Minor whitespace and consistency fixes.
- No newlines at the end of files. - No trailing ';' characters. - Comparison with None: Use 'is None' or 'is not None'. - Comparison with True/False: Use 'if cond:' or 'if not cond:'. - Various minor whitespace fixes.
Diffstat (limited to 'decoders/ds1307')
-rw-r--r--decoders/ds1307/__init__.py1
-rw-r--r--decoders/ds1307/pd.py7
2 files changed, 3 insertions, 5 deletions
diff --git a/decoders/ds1307/__init__.py b/decoders/ds1307/__init__.py
index 5bc28c3..70980a6 100644
--- a/decoders/ds1307/__init__.py
+++ b/decoders/ds1307/__init__.py
@@ -24,4 +24,3 @@ real-time clock (RTC) specific registers and commands.
'''
from .pd import *
-
diff --git a/decoders/ds1307/pd.py b/decoders/ds1307/pd.py
index 1a49f9a..77effbf 100644
--- a/decoders/ds1307/pd.py
+++ b/decoders/ds1307/pd.py
@@ -1,6 +1,6 @@
##
## This file is part of the libsigrokdecode project.
-##
+##
## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
## Copyright (C) 2013 Matt Ranostay <mranostay@gmail.com>
##
@@ -81,7 +81,7 @@ class Decoder(srd.Decoder):
self.putx([0, ['Day of Week: %s' % days_of_week[self.days - 1]]])
def handle_reg_0x04(self, b): # Date
- self.date = bcd2int(b & 0x3f)
+ self.date = bcd2int(b & 0x3f)
self.putx([0, ['Days: %d' % self.date]])
def handle_reg_0x05(self, b): # Month
@@ -89,7 +89,7 @@ class Decoder(srd.Decoder):
self.putx([0, ['Months: %d' % self.months]])
def handle_reg_0x06(self, b): # Year
- self.years = bcd2int(b & 0xff) + 2000;
+ self.years = bcd2int(b & 0xff) + 2000
self.putx([0, ['Years: %d' % self.years]])
def handle_reg_0x07(self, b): # Control Register
@@ -164,4 +164,3 @@ class Decoder(srd.Decoder):
self.state = 'IDLE'
else:
pass # TODO?
-