Skip to content

Commit

Permalink
Added cp210x driver with fixes for WSDA-200 and WSDA-104
Browse files Browse the repository at this point in the history
  • Loading branch information
jpherbst committed May 9, 2018
1 parent 63a6713 commit de49c02
Show file tree
Hide file tree
Showing 6 changed files with 1,510 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Linux/cp210x/install.sh

# vim
*.swp
9 changes: 9 additions & 0 deletions Linux/cp210x/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
obj-m = cp210x.o
KDIR = /lib/modules/`uname -r`/build
SRCDIR = $(PWD)
# try this instead if you don't have PWD defined
# SRCDIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
all:
$(MAKE) -C $(KDIR) M=$(SRCDIR) modules
clean:
$(MAKE) -C $(KDIR) M=$(SRCDIR) clean
28 changes: 28 additions & 0 deletions Linux/cp210x/build_install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import tarfile
from StringIO import StringIO

def main():
installScript = open("install.sh.in").read()
payloadStart = len(installScript.splitlines()) + 1
#payloadStart = len(installScript) - 1 + len(str(len(installScript)))
#if len(installScript) - 1 + len(str(payloadStart)) != payloadStart:
# payloadStart += 1

print "payloadstart=%s" % payloadStart
installScript = installScript.replace("payloadstart=0", "payloadstart=%s" % payloadStart)

output = open("install.sh", 'wb')

tarData = StringIO()
tarFile = tarfile.open(fileobj=tarData, mode='w:bz2')
tarFile.add("cp210x.c")
tarFile.add("Makefile")
tarFile.add("dkms.conf")
tarFile.close()

output.write(installScript)
output.write(tarData.getvalue())
output.close()

if __name__ == "__main__":
main()
Loading

0 comments on commit de49c02

Please sign in to comment.