Skip to content

Commit de49c02

Browse files
committed
Added cp210x driver with fixes for WSDA-200 and WSDA-104
1 parent 63a6713 commit de49c02

6 files changed

Lines changed: 1510 additions & 0 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Linux/cp210x/install.sh
2+
3+
# vim
4+
*.swp

Linux/cp210x/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
obj-m = cp210x.o
2+
KDIR = /lib/modules/`uname -r`/build
3+
SRCDIR = $(PWD)
4+
# try this instead if you don't have PWD defined
5+
# SRCDIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
6+
all:
7+
$(MAKE) -C $(KDIR) M=$(SRCDIR) modules
8+
clean:
9+
$(MAKE) -C $(KDIR) M=$(SRCDIR) clean

Linux/cp210x/build_install.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import tarfile
2+
from StringIO import StringIO
3+
4+
def main():
5+
installScript = open("install.sh.in").read()
6+
payloadStart = len(installScript.splitlines()) + 1
7+
#payloadStart = len(installScript) - 1 + len(str(len(installScript)))
8+
#if len(installScript) - 1 + len(str(payloadStart)) != payloadStart:
9+
# payloadStart += 1
10+
11+
print "payloadstart=%s" % payloadStart
12+
installScript = installScript.replace("payloadstart=0", "payloadstart=%s" % payloadStart)
13+
14+
output = open("install.sh", 'wb')
15+
16+
tarData = StringIO()
17+
tarFile = tarfile.open(fileobj=tarData, mode='w:bz2')
18+
tarFile.add("cp210x.c")
19+
tarFile.add("Makefile")
20+
tarFile.add("dkms.conf")
21+
tarFile.close()
22+
23+
output.write(installScript)
24+
output.write(tarData.getvalue())
25+
output.close()
26+
27+
if __name__ == "__main__":
28+
main()

0 commit comments

Comments
 (0)