summaryrefslogtreecommitdiff
path: root/openpicc/application/gammatable.py
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-03-01 20:24:22 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-03-01 20:24:22 +0000
commit5b3bd67fb9c780d51b25b5304589b1aab0a1e8a7 (patch)
tree535512d41dc013187d6d8022b0b05bf32a1e0c06 /openpicc/application/gammatable.py
parentad5b96d584fc9962a9d8504067cd59697fb9a580 (diff)
Add pwm led code from sniffonly branch
git-svn-id: https://svn.openpcd.org:2342/trunk@435 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/gammatable.py')
-rw-r--r--openpicc/application/gammatable.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/openpicc/application/gammatable.py b/openpicc/application/gammatable.py
new file mode 100644
index 0000000..a2e59cd
--- /dev/null
+++ b/openpicc/application/gammatable.py
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+
+a = range(1001)
+
+#b = [ (pow(10, (float(e)/500))) * 202 - 202 for e in a]
+b = [ 65534 * (pow((float(e)/1000), 2)) for e in a]
+maximum = max(b)+1
+
+print "/* Autogenerated from gammatable.py */"
+print "const u_int16_t gammatable[] = {" + ", ".join( [str(int(round(int(e)))) for e in b] ) + "};"
+print "#define GAMMA_MAX %i" % maximum
+print "#define GAMMA_LEN %i" % len(b)
+
personal git repositories of Harald Welte. Your mileage may vary